364 lines
804 KiB
JavaScript
364 lines
804 KiB
JavaScript
|
const I1=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=t(o);fetch(o.href,r)}};I1();function le(){}const Vr=n=>n;function ut(n,e){for(const t in e)n[t]=e[t];return n}function Ib(n){return n()}function bc(){return Object.create(null)}function rt(n){n.forEach(Ib)}function Yn(n){return typeof n=="function"}function Ee(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let rl;function Qn(n,e){return rl||(rl=document.createElement("a")),rl.href=e,n===rl.href}function R1(n){return Object.keys(n).length===0}function Rb(n,...e){if(n==null)return le;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function pn(n,e,t){n.$$.on_destroy.push(Rb(e,t))}function $n(n,e,t,i){if(n){const o=Nb(n,e,t,i);return n[0](o)}}function Nb(n,e,t,i){return n[1]&&i?ut(t.ctx.slice(),n[1](i(e))):t.ctx}function An(n,e,t,i){if(n[2]&&i){const o=n[2](i(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const r=[],l=Math.max(e.dirty.length,o.length);for(let s=0;s<l;s+=1)r[s]=e.dirty[s]|o[s];return r}return e.dirty|o}return e.dirty}function Dn(n,e,t,i,o,r){if(o){const l=Nb(e,t,i,r);n.p(l,o)}}function On(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function ui(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Wt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function gc(n){return n==null?"":n}function jb(n,e,t){return n.set(t),e}function Xe(n){return n&&Yn(n.destroy)?n.destroy:le}const zb=typeof window!="undefined";let vs=zb?()=>window.performance.now():()=>Date.now(),gf=zb?n=>requestAnimationFrame(n):le;const Lo=new Set;function Hb(n){Lo.forEach(e=>{e.c(n)||(Lo.delete(e),e.f())}),Lo.size!==0&&gf(Hb)}function ys(n){let e;return Lo.size===0&&gf(Hb),{promise:new Promise(t=>{Lo.add(e={c:n,f:t})}),abort(){Lo.delete(e)}}}function m(n,e){n.appendChild(e)}function qb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function N1(n){const e=g("style");return j1(qb(n),e),e.sheet}function j1(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function qn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function g(n){return document.createElement(n)}function j(n){return document.createTextNode(n)}function $(){return j(" ")}function lt(){return j("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Gt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Vn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Vb(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ci(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function At(n){return n===""?null:+n}function z1(n){return Array.from(n.childNodes)}function ge(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function _c(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ne(n,e,t){n.classList[t?"add":"remove"](e)}function Bb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");ret
|
||
|
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*r(_);f+=_*100+`%{${l(y,1-y)}}
|
||
|
`}const c=f+`100% {${l(t,1-t)}}
|
||
|
}`,u=`__svelte_${H1(c)}_${s}`,d=qb(n),{stylesheet:h,rules:b}=Kl.get(d)||q1(d,n);b[u]||(b[u]=!0,h.insertRule(`@keyframes ${u} ${c}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${u} ${i}ms linear ${o}ms 1 both`,Jl+=1,u}function Pr(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),o=t.length-i.length;o&&(n.style.animation=i.join(", "),Jl-=o,Jl||V1())}function V1(){gf(()=>{Jl||(Kl.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),Kl.clear())})}function B1(n,e,t,i){if(!e)return le;const o=n.getBoundingClientRect();if(e.left===o.left&&e.right===o.right&&e.top===o.top&&e.bottom===o.bottom)return le;const{delay:r=0,duration:l=300,easing:s=Vr,start:a=vs()+r,end:f=a+l,tick:c=le,css:u}=t(n,{from:e,to:o},i);let d=!0,h=!1,b;function v(){u&&(b=Er(n,0,1,l,r,s,u)),r||(h=!0)}function _(){u&&Pr(n,b),d=!1}return ys(y=>{if(!h&&y>=a&&(h=!0),h&&y>=f&&(c(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*s(S/l);c(C,1-C)}return!0}),v(),c(0,1),_}function U1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,o=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ub(n,o)}}function Ub(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),o=i.transform==="none"?"":i.transform;n.style.transform=`${o} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Fr;function wr(n){Fr=n}function ks(){if(!Fr)throw new Error("Function called outside component initialization");return Fr}function di(n){ks().$$.on_mount.push(n)}function W1(n){ks().$$.after_update.push(n)}function Y1(n){ks().$$.on_destroy.push(n)}function yn(){const n=ks();return(e,t,{cancelable:i=!1}={})=>{const o=n.$$.callbacks[e];if(o){const r=Bb(e,t,{cancelable:i});return o.slice().forEach(l=>{l.call(n,r)}),!r.defaultPrevented}return!0}}function ft(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const br=[],he=[],Rl=[],Da=[],Wb=Promise.resolve();let Oa=!1;function Yb(){Oa||(Oa=!0,Wb.then(Gb))}function Bi(){return Yb(),Wb}function Dt(n){Rl.push(n)}function Re(n){Da.push(n)}const Is=new Set;let ll=0;function Gb(){const n=Fr;do{for(;ll<br.length;){const e=br[ll];ll++,wr(e),G1(e.$$)}for(wr(null),br.length=0,ll=0;he.length;)he.pop()();for(let e=0;e<Rl.length;e+=1){const t=Rl[e];Is.has(t)||(Is.add(t),t())}Rl.length=0}while(br.length);for(;Da.length;)Da.pop()();Oa=!1,Is.clear(),wr(n)}function G1(n){if(n.fragment!==null){n.update(),rt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let tr;function _f(){return tr||(tr=Promise.resolve(),tr.then(()=>{tr=null})),tr}function fo(n,e,t){n.dispatchEvent(Bb(`${e?"intro":"outro"}${t}`))}const Nl=new Set;let si;function Ae(){si={r:0,c:[],p:si}}function De(){si.r||rt(si.c),si=si.p}function T(n,e){n&&n.i&&(Nl.delete(n),n.i(e))}function F(n,e,t,i){if(n&&n.o){if(Nl.has(n))return;Nl.add(n),si.c.push(()=>{Nl.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}}const vf={duration:0};function yf(n,e,t){let i=e(n,t),o=!1,r,l,s=0;function a(){r&&Pr(n,r)}function f(){const{delay:u=0,duration:d=300,easing:h=Vr,tick:b=le,css:v}=i||vf;v&&(r=Er(n,0,1,d,u,h,v,s++)),b(0,1);const _=vs()+u,y=_+d;l&&l.abort(),o=!0,Dt(()=>fo(n,!0,"start")),l=ys(S=>{if(o){if(S>=y)return b(1,0),fo(n,!0,"end"),a(),o=!1;if(S>=_){const C=h((S-_)/d);b(C,1-C)}}return o})}let c=!1;return{start(){c||(c=!0,Pr(n),Yn(i)?(i=i(),_f().then(f)):f())},invalidate(){c=!1},end(){o&&(a(),o=!1)}}}function Kb(n,e,t){let i=e(n,t),o=!0,r;const l=si;l.r+=1;function s(){const{delay:a=0,duration:f=300,easing:c=Vr,tick:u=le,css:d}=i||vf;d&&(r=Er(n,1,0,f,a,c,d));const h=vs()+a,b=h+f;Dt(()=>fo(n,!1,"start")),ys(v=>{if(o){if(v>=b)return u(0,1),fo(n,!1,"end"),--l.r||rt(l.c),!1;if(v>=h){const _=c((v-h)/f);u(1-_,_)}}return o})}return Yn(i)?_f().then(()=>{i=i(),s()}):s(),{end(a){a&&i.tick&&i.tick(1,0),o&&(r&&Pr(n,r),o=!1)}}}function ct(n,e,t,i){let o=e(n,t),r=i?0:1,l=null,s=null,a
|
||
|
`),function(r){if(i=r.indexOf(":"),e=js.trim(r.substr(0,i)).toLowerCase(),t=js.trim(r.substr(i+1)),e){if(o[e]&&m_.indexOf(e)>=0)return;o[e]=e==="set-cookie"?(o[e]?o[e]:[]).concat([t]):o[e]?o[e]+", "+t:t}}),o},w_=b_,zs=og,S_=function(n){return new Promise(function(e,t){var i=n.data,o=n.headers,r=n.responseType;fl.isFormData(i)&&delete o["Content-Type"];var l=new XMLHttpRequest;if(n.auth){var s=n.auth.username||"",a=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+a)}var f=y_(n.baseURL,n.url);function c(){if(l){var d="getAllResponseHeaders"in l?k_(l.getAllResponseHeaders()):null,h={data:r&&r!=="text"&&r!=="json"?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:d,config:n,request:l};g_(e,t,h),l=null}}if(l.open(n.method.toUpperCase(),v_(f,n.params,n.paramsSerializer),!0),l.timeout=n.timeout,"onloadend"in l?l.onloadend=c:l.onreadystatechange=function(){l&&l.readyState===4&&(l.status!==0||l.responseURL&&l.responseURL.indexOf("file:")===0)&&setTimeout(c)},l.onabort=function(){l&&(t(zs("Request aborted",n,"ECONNABORTED",l)),l=null)},l.onerror=function(){t(zs("Network Error",n,null,l)),l=null},l.ontimeout=function(){var d="timeout of "+n.timeout+"ms exceeded";n.timeoutErrorMessage&&(d=n.timeoutErrorMessage),t(zs(d,n,n.transitional&&n.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},fl.isStandardBrowserEnv()){var u=(n.withCredentials||w_(f))&&n.xsrfCookieName?__.read(n.xsrfCookieName):void 0;u&&(o[n.xsrfHeaderName]=u)}"setRequestHeader"in l&&fl.forEach(o,function(d,h){i===void 0&&h.toLowerCase()==="content-type"?delete o[h]:l.setRequestHeader(h,d)}),fl.isUndefined(n.withCredentials)||(l.withCredentials=!!n.withCredentials),r&&r!=="json"&&(l.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&l.addEventListener("progress",n.onDownloadProgress),typeof n.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",n.onUploadProgress),n.cancelToken&&n.cancelToken.promise.then(function(d){l&&(l.abort(),t(d),l=null)}),i||(i=null),l.send(i)})},Qt=Pn,Dc=function(n,e){f_.forEach(n,function(t,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(n[e]=t,delete n[i])})},C_=ig,x_={"Content-Type":"application/x-www-form-urlencoded"};function Oc(n,e){!Qt.isUndefined(n)&&Qt.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}var Tc,Hl={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(Tc=S_),Tc),transformRequest:[function(n,e){return Dc(e,"Accept"),Dc(e,"Content-Type"),Qt.isFormData(n)||Qt.isArrayBuffer(n)||Qt.isBuffer(n)||Qt.isStream(n)||Qt.isFile(n)||Qt.isBlob(n)?n:Qt.isArrayBufferView(n)?n.buffer:Qt.isURLSearchParams(n)?(Oc(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):Qt.isObject(n)||e&&e["Content-Type"]==="application/json"?(Oc(e,"application/json"),function(t,i,o){if(Qt.isString(t))try{return(i||JSON.parse)(t),Qt.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(t)}(n)):n}],transformResponse:[function(n){var e=this.transitional,t=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,o=!t&&this.responseType==="json";if(o||i&&Qt.isString(n)&&n.length)try{return JSON.parse(n)}catch(r){if(o)throw r.name==="SyntaxError"?C_(r,this,"E_JSON_PARSE"):r}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300}};Hl.headers={common:{Accept:"application/json, text/plain, */*"}},Qt.forEach(["delete","get","head"],function(n){Hl.headers[n]={}}),Qt.forEach(["post","put","patch"],function(n){Hl.headers[n]=Qt.merge(x_)});var kf=Hl,M_=Pn,$_=kf,rg=function(n){return!(!n||!n.__CANCEL__)},Ec=Pn,Hs=function(n,e,t){var i=this||$_;return M_.forEach(t,function(o){n=o.call(i,n,e)}),n},A_=rg,D_=kf;function qs(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var on=Pn,lg=function(n,e){e=e||{};var t={},i=["url","method","data"],o=
|
||
|
`+e.prev+e.base;return t+ri.call(n,","+t)+`
|
||
|
`+e.prev}function pl(n,e){var t=Ia(n),i=[];if(t){i.length=n.length;for(var o=0;o<n.length;o++)i[o]=Ei(n,o)?e(n[o],n):""}var r,l=typeof Js=="function"?Js(n):[];if(Vo){r={};for(var s=0;s<l.length;s++)r["$"+l[s]]=l[s]}for(var a in n)Ei(n,a)&&(t&&String(Number(a))===a&&a<n.length||Vo&&r["$"+a]instanceof Symbol||(bg.call(/[^\w$]/,a)?i.push(e(a,n)+": "+e(n[a],n)):i.push(a+": "+e(n[a],n))));if(typeof Js=="function")for(var f=0;f<l.length;f++)gg.call(n,l[f])&&i.push("["+e(l[f])+"]: "+e(n[l[f]],n));return i}var kg,Af=Cf,Ko=function(n,e){var t=hg(n,!!e);return typeof t=="function"&&Q_(n,".prototype.")>-1?mg(t):t},dv=function n(e,t,i,o){var r=t||{};if(Ei(r,"quoteStyle")&&r.quoteStyle!=="single"&&r.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ei(r,"maxStringLength")&&(typeof r.maxStringLength=="number"?r.maxStringLength<0&&r.maxStringLength!==1/0:r.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!Ei(r,"customInspect")||r.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ei(r,"indent")&&r.indent!==null&&r.indent!==" "&&!(parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ei(r,"numericSeparator")&&typeof r.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=r.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return yg(e,r);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return s?Wc(e,a):a}if(typeof e=="bigint"){var f=String(e)+"n";return s?Wc(e,f):f}var c=r.depth===void 0?5:r.depth;if(i===void 0&&(i=0),i>=c&&c>0&&typeof e=="object")return Ia(e)?"[Array]":"[Object]";var u=function(R,G){var U;if(R.indent===" ")U=" ";else{if(!(typeof R.indent=="number"&&R.indent>0))return null;U=ri.call(Array(R.indent+1)," ")}return{base:U,prev:ri.call(Array(G+1),U)}}(r,i);if(o===void 0)o=[];else if(Jc(o,e)>=0)return"[Circular]";function d(R,G,U){if(G&&(o=av.call(o)).push(G),U){var z={depth:r.depth};return Ei(r,"quoteStyle")&&(z.quoteStyle=r.quoteStyle),n(R,z,i+1,o)}return n(R,r,i+1,o)}if(typeof e=="function"&&!Kc(e)){var h=function(R){if(R.name)return R.name;var G=lv.call(rv.call(R),/^function\s*([\w$]+)/);return G?G[1]:null}(e),b=pl(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(b.length>0?" { "+ri.call(b,", ")+" }":"")}if(vg(e)){var v=Vo?Ri.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fa.call(e);return typeof e!="object"||Vo?v:or(v)}if(function(R){return!R||typeof R!="object"?!1:typeof HTMLElement!="undefined"&&R instanceof HTMLElement?!0:typeof R.nodeName=="string"&&typeof R.getAttribute=="function"}(e)){for(var _="<"+qc.call(String(e.nodeName)),y=e.attributes||[],S=0;S<y.length;S++)_+=" "+y[S].name+"="+_g(fv(y[S].value),"double",r);return _+=">",e.childNodes&&e.childNodes.length&&(_+="..."),_+="</"+qc.call(String(e.nodeName))+">"}if(Ia(e)){if(e.length===0)return"[]";var C=pl(e,d);return u&&!function(R){for(var G=0;G<R.length;G++)if(Jc(R[G],`
|
||
|
`)>=0)return!1;return!0}(C)?"["+Ra(C,u)+"]":"[ "+ri.call(C,", ")+" ]"}if(function(R){return!(Pi(R)!=="[object Error]"||rn&&typeof R=="object"&&rn in R)}(e)){var x=pl(e,d);return"cause"in Error.prototype||!("cause"in e)||gg.call(e,"cause")?x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ri.call(x,", ")+" }":"{ ["+String(e)+"] "+ri.call(Vc.call("[cause]: "+d(e.cause),x),", ")+" }"}if(typeof e=="object"&&l){if(Gc&&typeof e[Gc]=="function"&&La)return La(e,{depth:c-i});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(function(R){if(!ul||!R||typeof R!="object")return!1;try{ul.call(R);try{dl.call(R)}catch{return!0}return R instanceof Map}catch{}return!1}(e)){var M=[];return tv.call(e,function(R,G){M.push(d(G,e,!0)+" => "+d(R,e))}),Zc("Map",ul.call(e),M,u)}if(function(R){if(!dl||!R||typeof R!="object")return!1;try{dl.call(R);try{ul.call(R)}catch{return!0}return R instanceof Set}catch{}return!1}(e)){var A=[];return nv.call(e,function(R){A.push(d(R,e))}),Zc("Set",dl.call(e),A,u)}if(function(R){if(!nr||!R||typeof R!="object")return!1;try{nr.call(R,nr);try{ir.call(R,ir)}catch{return!0}return R instanceof WeakMap}catch{}return!1}(e))return Zs("WeakMap");if(function(R){if(!ir||!R||typeof R!="object")return!1;try{ir.call(R,ir);try{nr.call(R,nr)}catch{return!0}return R instanceof WeakSet}catch{}return!1}(e))return Zs("WeakSet");if(function(R){if(!Hc||!R||typeof R!="object")return!1;try{return Hc.call(R),!0}catch{}return!1}(e))return Zs("WeakRef");if(function(R){return!(Pi(R)!=="[object Number]"||rn&&typeof R=="object"&&rn in R)}(e))return or(d(Number(e)));if(function(R){if(!R||typeof R!="object"||!Ks)return!1;try{return Ks.call(R),!0}catch{}return!1}(e))return or(d(Ks.call(e)));if(function(R){return!(Pi(R)!=="[object Boolean]"||rn&&typeof R=="object"&&rn in R)}(e))return or(iv.call(e));if(function(R){return!(Pi(R)!=="[object String]"||rn&&typeof R=="object"&&rn in R)}(e))return or(d(String(e)));if(!function(R){return!(Pi(R)!=="[object Date]"||rn&&typeof R=="object"&&rn in R)}(e)&&!Kc(e)){var O=pl(e,d),D=Uc?Uc(e)===Object.prototype:e instanceof Object||e.constructor===Object,E=e instanceof Object?"":"null prototype",P=!D&&rn&&Object(e)===e&&rn in e?$f.call(Pi(e),8,-1):E?"Object":"",I=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(P||E?"["+ri.call(Vc.call([],P||[],E||[]),": ")+"] ":"");return O.length===0?I+"{}":u?I+"{"+Ra(O,u)+"}":I+"{ "+ri.call(O,", ")+" }"}return String(e)},pv=Af("%TypeError%"),hl=Af("%WeakMap%",!0),ml=Af("%Map%",!0),hv=Ko("WeakMap.prototype.get",!0),mv=Ko("WeakMap.prototype.set",!0),bv=Ko("WeakMap.prototype.has",!0),gv=Ko("Map.prototype.get",!0),_v=Ko("Map.prototype.set",!0),vv=Ko("Map.prototype.has",!0),Xs=function(n,e){for(var t,i=n;(t=i.next)!==null;i=t)if(t.key===e)return i.next=t.next,t.next=n.next,n.next=t,t},yv=String.prototype.replace,kv=/%20/g,Xc="RFC3986",Df={default:Xc,formatters:{RFC1738:function(n){return yv.call(n,kv,"+")},RFC3986:function(n){return String(n)}},RFC1738:"RFC1738",RFC3986:Xc},wv=Df,Qs=Object.prototype.hasOwnProperty,Ji=Array.isArray,ii=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),Qc=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},i=0;i<n.length;++i)n[i]!==void 0&&(t[i]=n[i]);return t},wg={arrayToObject:Qc,assign:function(n,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},n)},combine:function(n,e){return[].concat(n,e)},compact:function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],i=0;i<e.length;++i)for(var o=e[i],r=o.obj[o.prop],l=Object.keys(r),s=0;s<l.length;++s){var a=l[s],f=r[a];typeof f=="object"&&f!==null&&t.indexOf(f)===-1&&(e.push({obj:r,prop:a}),t.push(f))}return function(c){for(;c.length>1;){var u=c.pop(),d=u.obj[u.prop];if(Ji(d)){for(var h=[],b=0;b<d.length;++b)d[b]!==void 0&&h.push(d[b]);u.obj[u.prop]=h}}}(e),n},decode:function(n,e,t){var i=n.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},encode:function(n,e,t,i,o){if(n.length===0)return n;v
|
||
|
transform: ${f} translate(${(1-u)*o}px, ${(1-u)*r}px);
|
||
|
opacity: ${a-c*d}`}}function fn(n,{delay:e=0,duration:t=400,easing:i=As}={}){const o=getComputedStyle(n),r=+o.opacity,l=parseFloat(o.height),s=parseFloat(o.paddingTop),a=parseFloat(o.paddingBottom),f=parseFloat(o.marginTop),c=parseFloat(o.marginBottom),u=parseFloat(o.borderTopWidth),d=parseFloat(o.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*r};height: ${h*l}px;padding-top: ${h*s}px;padding-bottom: ${h*a}px;margin-top: ${h*f}px;margin-bottom: ${h*c}px;border-top-width: ${h*u}px;border-bottom-width: ${h*d}px;`}}function Bn(n,{delay:e=0,duration:t=400,easing:i=As,start:o=0,opacity:r=0}={}){const l=getComputedStyle(n),s=+l.opacity,a=l.transform==="none"?"":l.transform,f=1-o,c=s*(1-r);return{delay:e,duration:t,easing:i,css:(u,d)=>`
|
||
|
transform: ${a} scale(${1-f*d});
|
||
|
opacity: ${s-c*d}
|
||
|
`}}function Y2(n){let e,t,i,o;return{c(){e=g("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(r,l){w(r,e,l),n[13](e),Me(e,n[7]),i||(o=X(e,"input",n[14]),i=!0)},p(r,l){l&3&&t!==(t=r[0]||r[1])&&p(e,"placeholder",t),l&128&&e.value!==r[7]&&Me(e,r[7])},i:le,o:le,d(r){r&&k(e),n[13](null),i=!1,o()}}}function G2(n){let e,t,i,o;function r(a){n[12](a)}var l=n[4];function s(a){let f={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return l&&(e=new l(s(n)),he.push(()=>Fe(e,"value",r)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=lt()},m(a,f){e&&H(e,a,f),w(a,i,f),o=!0},p(a,f){const c={};if(f&8&&(c.extraAutocompleteKeys=a[3]),f&4&&(c.baseCollection=a[2]),f&3&&(c.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,c.value=a[7],Re(()=>t=!1)),l!==(l=a[4])){if(e){Ae();const u=e;F(u.$$.fragment,1,0,()=>{q(u,1)}),De()}l?(e=new l(s(a)),he.push(()=>Fe(e,"value",r)),e.$on("submit",a[10]),V(e.$$.fragment),T(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else l&&e.$set(c)},i(a){o||(e&&T(e.$$.fragment,a),o=!0)},o(a){e&&F(e.$$.fragment,a),o=!1},d(a){a&&k(i),e&&q(e,a)}}}function Ou(n){let e,t,i,o,r,l,s=n[7]!==n[0]&&Tu();return{c(){s&&s.c(),e=$(),t=g("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,f){s&&s.m(a,f),w(a,e,f),w(a,t,f),o=!0,r||(l=X(t,"click",n[15]),r=!0)},p(a,f){a[7]!==a[0]?s?f&129&&T(s,1):(s=Tu(),s.c(),T(s,1),s.m(e.parentNode,e)):s&&(Ae(),F(s,1,1,()=>{s=null}),De())},i(a){o||(T(s),Dt(()=>{i||(i=ct(t,ti,{duration:150,x:5},!0)),i.run(1)}),o=!0)},o(a){F(s),i||(i=ct(t,ti,{duration:150,x:5},!1)),i.run(0),o=!1},d(a){s&&s.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),r=!1,l()}}}function Tu(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(o,r){w(o,e,r),i=!0},i(o){i||(Dt(()=>{t||(t=ct(e,ti,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(o){t||(t=ct(e,ti,{duration:150,x:5},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end()}}}function K2(n){let e,t,i,o,r,l,s,a,f,c,u;const d=[G2,Y2],h=[];function b(_,y){return _[4]&&!_[5]?0:1}l=b(n),s=h[l]=d[l](n);let v=(n[0].length||n[7].length)&&Ou(n);return{c(){e=g("div"),t=g("form"),i=g("label"),o=g("i"),r=$(),s.c(),a=$(),v&&v.c(),p(o,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(_,y){w(_,e,y),m(e,t),m(t,i),m(i,o),m(t,r),h[l].m(t,null),m(t,a),v&&v.m(t,null),f=!0,c||(u=[X(t,"submit",Gt(n[10])),X(e,"click",Vn(n[11]))],c=!0)},p(_,[y]){let S=l;l=b(_),l===S?h[l].p(_,y):(Ae(),F(h[S],1,1,()=>{h[S]=null}),De(),s=h[l],s?s.p(_,y):(s=h[l]=d[l](_),s.c()),T(s,1),s.m(t,a)),_[0].length||_[7].length?v?(v.p(_,y),y&129&&T(v,1)):(v=Ou(_),v.c(),T(v,1),v.m(t,null)):v&&(Ae(),F(v,1,1,()=>{v=null}),De())},i(_){f||(T(s),T(v),f=!0)},o(_){F(s),F(v),f=!1},d(_){_&&k(e),h[l].d(),v&&v.d(),c=!1,rt(u)}}}function J2(n,e,t){const i=yn(),o="search_"+B.randomString(7);let{value:r=""}=e,{placeholder:l='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:s=new En}=e,{extraAutocompleteKeys:a=[]}=e,f,c=!1,u,d="";function h(M=!0){t(7,d=""),M&&(u==null||u.focus()),i("clear")}function b(){t(0,r=d),i("submit",r)}async function v(){f||c||(t(5,c=!0),t(4,f=(await _i(()=>import("./FilterAutocompleteInput.15d21df7.js"),[])).default),t(5,c=!1))}di(()=>{v()});function _(M){ft.call(this,n,M)}function y(M){d=M,t(7,d),t(0,r)}function S(M){he[M?"unshift":"push"](()=>{u=M,t(6,u)})}function C(){d=this.value,t(7,d),t(0,r)}const x=()=>{h(!1),b()};return n.$$set=M=>{"value"in M&&t(0,r=M.value),"placeholder"in M&&t(1,l=M.placeholder),"autocompleteCollection"in M&&t(2,s=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof r=="string"&&t(7,d=r)},[r,l,s,a,f,c,u,d,o,h,b,_,y,S,C,x]}class Ds extends Ie{constructor(e){super(),Le(this,e,J2,K2,Ee,{value:0
|
||
|
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function ok(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function rk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function lk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function sk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function Pu(n){let e;function t(r,l){return r[6]?fk:ak}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function ak(n){var s;let e,t,i,o,r,l=((s=n[0])==null?void 0:s.length)&&Fu(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No logs found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[0])!=null&&c.length?l?l.p(a,f):(l=Fu(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function fk(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
|
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Fu(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function Lu(n){let e;return{c(){e=g("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Iu(n,e){var oe,J,$e;let t,i,o,r=((oe=e[21].method)==null?void 0:oe.toUpperCase())+"",l,s,a,f,c,u=e[21].url+"",d,h,b,v,_,y,S=(e[21].referer||"N/A")+"",C,x,M,A,O,D=e[21].status+"",E,P,I,R,G,U,z,K,Y,W,te=(((J=e[21].meta)==null?void 0:J.errorMessage)||(($e=e[21].meta)==null?void 0:$e.errorData))&&Lu();R=new Ci({props:{date:e[21].created}});function ce(){return e[16](e[21])}function ve(...ee){return e[17](e[21],...ee)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("span"),l=j(r),a=$(),f=g("td"),c=g("span"),d=j(u),b=$(),te&&te.c(),v=$(),_=g("td"),y=g("span"),C=j(S),M=$(),A=g("td"),O=g("span"),E=j(D),P=$(),I=g("td"),V(R.$$.fragment),G=$(),U=g("td"),U.innerHTML='<i class="ri-arrow-right-line"></i>',z=$(),p(o,"class",s="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(c,"class","txt txt-ellipsis"),p(c,"title",h=e[21].url),p(f,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",x=e[21].referer),ne(y,"txt-hint",!e[21].referer),p(_,"class","col-type-text col-field-referer"),p(O,"class","label"),ne(O,"label-danger",e[21].status>=400),p(A,"class","col-type-number col-field-status"),p(I,"class","col-type-date col-field-created"),p(U,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,_e){w(ee,t,_e),m(t,i),m(i,o),m(o,l),m(t,a),m(t,f),m(f,c),m(c,d),m(f,b),te&&te.m(f,null),m(t,v),m(t,_),m(_,y),m(y,C),m(t,M),m(t,A),m(A,O),m(O,E),m(t,P),m(t,I),H(R,I,null),m(t,G),m(t,U),m(t,z),K=!0,Y||(W=[X(t,"click",ce),X(t,"keydown",ve)],Y=!0)},p(ee,_e){var ie,ye,Ne;e=ee,(!K||_e&8)&&r!==(r=((ie=e[21].method)==null?void 0:ie.toUpperCase())+"")&&ge(l,r),(!K||_e&8&&s!==(s="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(o,"class",s),(!K||_e&8)&&u!==(u=e[21].url+"")&&ge(d,u),(!K||_e&8&&h!==(h=e[21].url))&&p(c,"title",h),((ye=e[21].meta)==null?void 0:ye.errorMessage)||((Ne=e[21].meta)==null?void 0:Ne.errorData)?te||(te=Lu(),te.c(),te.m(f,null)):te&&(te.d(1),te=null),(!K||_e&8)&&S!==(S=(e[21].referer||"N/A")+"")&&ge(C,S),(!K||_e&8&&x!==(x=e[21].referer))&&p(y,"title",x),_e&8&&ne(y,"txt-hint",!e[21].referer),(!K||_e&8)&&D!==(D=e[21].status+"")&&ge(E,D),_e&8&&ne(O,"label-danger",e[21].status>=400);const fe={};_e&8&&(fe.date=e[21].created),R.$set(fe)},i(ee){K||(T(R.$$.fragment,ee),K=!0)},o(ee){F(R.$$.fragment,ee),K=!1},d(ee){ee&&k(t),te&&te.d(),q(R),Y=!1,rt(W)}}}function Ru(n){let e,t,i=n[3].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a&8&&i!==(i=s[3].length+"")&&ge(o,i),a&16&&ge(l,s[4])},d(s){s&&k(e)}}}function Nu(n){let e,t,i,o,r=n[4]-n[3].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[6]),ne(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[19]),a=!0)},p(c,u){u&24&&r!==(r=c[4]-c[3].length+"")&&ge(l,r),u&64&&ne(t,"btn-loading",c[6]),u&64&&ne(t,"btn-disabled",c[6])},d(c){c&&k(e),a=!1,f()}}}function ck(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O=[],D=new Map,E,P,I,R;function G(ie){n[11](ie)}let U={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[ik]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),r=new en({props:U}),he.push(()=>Fe(r,"sort",G));function z(ie){n[12](ie)}let K={disable:!0,class:"col-type-text col-field-url",name:"
|
||
|
* Chart.js v3.8.0
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/const T0=function(){return typeof window=="undefined"?function(n){return n()}:window.requestAnimationFrame}();function E0(n,e,t){const i=t||(l=>Array.prototype.slice.call(l));let o=!1,r=[];return function(...l){r=i(l),o||(o=!0,T0.call(window,()=>{o=!1,n.apply(e,r)}))}}function pk(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const hk=n=>n==="start"?"left":n==="end"?"right":"center",ju=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function mi(){}const mk=function(){let n=0;return function(){return n++}}();function xt(n){return n===null||typeof n=="undefined"}function Et(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function dt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Ht=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Ht(n)?n:e}function ht(n,e){return typeof n=="undefined"?e:n}const bk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,P0=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Ct(n,e,t,i){let o,r,l;if(Et(n))if(r=n.length,i)for(o=r-1;o>=0;o--)e.call(t,n[o],o);else for(o=0;o<r;o++)e.call(t,n[o],o);else if(dt(n))for(l=Object.keys(n),r=l.length,o=0;o<r;o++)e.call(t,n[l[o]],l[o])}function ls(n,e){let t,i,o,r;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(o=n[t],r=e[t],o.datasetIndex!==r.datasetIndex||o.index!==r.index)return!1;return!0}function ss(n){if(Et(n))return n.map(ss);if(dt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let o=0;for(;o<i;++o)e[t[o]]=ss(n[t[o]]);return e}return n}function F0(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function gk(n,e,t,i){if(!F0(n))return;const o=e[n],r=t[n];dt(o)&&dt(r)?Lr(o,r,i):e[n]=ss(r)}function Lr(n,e,t){const i=Et(e)?e:[e],o=i.length;if(!dt(n))return n;t=t||{};const r=t.merger||gk;for(let l=0;l<o;++l){if(e=i[l],!dt(e))continue;const s=Object.keys(e);for(let a=0,f=s.length;a<f;++a)r(s[a],n,e,t)}return n}function Mr(n,e){return Lr(n,e,{merger:_k})}function _k(n,e,t){if(!F0(n))return;const i=e[n],o=t[n];dt(i)&&dt(o)?Mr(i,o):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ss(o))}const vk="",yk=".";function zu(n,e){const t=n.indexOf(yk,e);return t===-1?n.length:t}function qi(n,e){if(e===vk)return n;let t=0,i=zu(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=zu(e,t);return n}function Vf(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Un=n=>typeof n!="undefined",Vi=n=>typeof n=="function",Hu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function kk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const jt=Math.PI,Tt=2*jt,wk=Tt+jt,as=Number.POSITIVE_INFINITY,Sk=jt/180,Nt=jt/2,fr=jt/4,qu=jt*2/3,zn=Math.log10,ai=Math.sign;function Vu(n){const e=Math.round(n);n=$r(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Ck(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((o,r)=>o-r).pop(),e}function Ir(n){return!isNaN(parseFloat(n))&&isFinite(n)}function $r(n,e,t){return Math.abs(n-e)<t}function xk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function L0(n,e,t){let i,o,r;for(i=0,o=n.length;i<o;i++)r=n[i][t],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function Xn(n){return n*(jt/180)}function Bf(n){return n*(180/jt)}function Bu(n){if(!Ht(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function I0(n,e){const t=e.x-n.x,i=e.y-n.y,o=Math.sqrt(t*t+i*i);let r=Math.atan2(i,t);return r<-.5*jt&&(r+=Tt),{angle:r,distance:o}}function Qa(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Mk(n,e){return(n-e+wk)%Tt-jt}function Cn(n){return(n%Tt+Tt)%Tt}function Rr(n,e,t,i){const o=Cn(n),r=Cn(e),l=Cn(t),s=Cn(r-o),a=Cn(l-o),f=Cn(o-r),c=Cn(o-l);return o===r||o===l||i&&r===l||s
|
||
|
* @kurkle/color v0.2.1
|
||
|
* https://github.com/kurkle/color#readme
|
||
|
* (c) 2022 Jukka Kurkela
|
||
|
* Released under the MIT License
|
||
|
*/function Jr(n){return n+.5|0}const Ni=(n,e,t)=>Math.max(Math.min(n,t),e);function yr(n){return Ni(Jr(n*2.55),0,255)}function Hi(n){return Ni(Jr(n*255),0,255)}function yi(n){return Ni(Jr(n/2.55)/100,0,1)}function Yu(n){return Ni(Jr(n*100),0,100)}const In={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ef=[..."0123456789ABCDEF"],Ak=n=>ef[n&15],Dk=n=>ef[(n&240)>>4]+ef[n&15],wl=n=>(n&240)>>4===(n&15),Ok=n=>wl(n.r)&&wl(n.g)&&wl(n.b)&&wl(n.a);function Tk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const Ek=(n,e)=>n<255?e(n):"";function Pk(n){var e=Ok(n)?Ak:Dk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Ek(n.a,e):void 0}const Fk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function R0(n,e,t){const i=e*Math.min(t,1-t),o=(r,l=(r+n/30)%12)=>t-i*Math.max(Math.min(l-3,9-l,1),-1);return[o(0),o(8),o(4)]}function Lk(n,e,t){const i=(o,r=(o+n/60)%6)=>t-t*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Ik(n,e,t){const i=R0(n,1,.5);let o;for(e+t>1&&(o=1/(e+t),e*=o,t*=o),o=0;o<3;o++)i[o]*=1-e-t,i[o]+=e;return i}function Rk(n,e,t,i,o){return n===o?(e-t)/i+(e<t?6:0):e===o?(t-n)/i+2:(n-e)/i+4}function Uf(n){const t=n.r/255,i=n.g/255,o=n.b/255,r=Math.max(t,i,o),l=Math.min(t,i,o),s=(r+l)/2;let a,f,c;return r!==l&&(c=r-l,f=s>.5?c/(2-r-l):c/(r+l),a=Rk(t,i,o,c,r),a=a*60+.5),[a|0,f||0,s]}function Wf(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Hi)}function Yf(n,e,t){return Wf(R0,n,e,t)}function Nk(n,e,t){return Wf(Ik,n,e,t)}function jk(n,e,t){return Wf(Lk,n,e,t)}function N0(n){return(n%360+360)%360}function zk(n){const e=Fk.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?yr(+e[5]):Hi(+e[5]));const o=N0(+e[2]),r=+e[3]/100,l=+e[4]/100;return e[1]==="hwb"?i=Nk(o,r,l):e[1]==="hsv"?i=jk(o,r,l):i=Yf(o,r,l),{r:i[0],g:i[1],b:i[2],a:t}}function Hk(n,e){var t=Uf(n);t[0]=N0(t[0]+e),t=Yf(t),n.r=t[0],n.g=t[1],n.b=t[2]}function qk(n){if(!n)return;const e=Uf(n),t=e[0],i=Yu(e[1]),o=Yu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${o}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${o}%)`}const Gu={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ku={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
|
||
|
* Chart.js v3.8.0
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/class Yw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,o){const r=t.listeners[o],l=t.duration;r.forEach(s=>s({chart:e,initial:t.initial,numSteps:l,currentStep:Math.min(i-t.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=T0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,o)=>{if(!i.running||!i.items.length)return;const r=i.items;let l=r.length-1,s=!1,a;for(;l>=0;--l)a=r[l],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),s=!0):(r[l]=r[r.length-1],r.pop());s&&(o.draw(),this._notify(o,i,e,"progress")),r.length||(i.running=!1,this._notify(o,i,e,"complete"),i.initial=!1),t+=r.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,o)=>Math.max(i,o._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let o=i.length-1;for(;o>=0;--o)i[o].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bi=new Yw;const ad="transparent",Gw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Zu(n||ad),o=i.valid&&Zu(e||ad);return o&&o.valid?o.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Kw{constructor(e,t,i,o){const r=t[i];o=xl([e.to,o,r,e.from]);const l=xl([e.from,r,o]);this._active=!0,this._fn=e.fn||Gw[e.type||typeof l],this._easing=Ar[e.easing]||Ar.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=l,this._to=o,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const o=this._target[this._prop],r=i-this._start,l=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=xl([e.to,t,o,e.from]),this._from=xl([e.from,o,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,o=this._prop,r=this._from,l=this._loop,s=this._to;let a;if(this._active=r!==s&&(l||t<i),!this._active){this._target[o]=s,this._notify(!0);return}if(t<0){this._target[o]=r;return}a=t/i%2,a=l&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[o]=this._fn(r,s,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let o=0;o<i.length;o++)i[o][t]()}}const Jw=["x","y","borderWidth","radius","tension"],Zw=["color","borderColor","backgroundColor"];mt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Xw=Object.keys(mt.animation);mt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});mt.set("animations",{colors:{type:"color",properties:Zw},numbers:{type:"number",properties:Jw}});mt.describe("animations",{_fallback:"animation"});mt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class t1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!dt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const o=e[i];if(!dt(o))return;const r={};for(co
|
||
|
`)>-1?n.split(`
|
||
|
`):n}function b4(n,e){const{element:t,datasetIndex:i,index:o}=e,r=n.getDatasetMeta(i).controller,{label:l,value:s}=r.getLabelAndValue(o);return{chart:n,label:l,parsed:r.getParsed(o),raw:n.data.datasets[i].data[o],formattedValue:s,dataset:r.getDataset(),dataIndex:o,datasetIndex:i,element:t}}function Nd(n,e){const t=n.chart.ctx,{body:i,footer:o,title:r}=n,{boxWidth:l,boxHeight:s}=e,a=Mn(e.bodyFont),f=Mn(e.titleFont),c=Mn(e.footerFont),u=r.length,d=o.length,h=i.length,b=Wn(e.padding);let v=b.height,_=0,y=i.reduce((x,M)=>x+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,u&&(v+=u*f.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),y){const x=e.displayColors?Math.max(s,a.lineHeight):a.lineHeight;v+=h*x+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(x){_=Math.max(_,t.measureText(x).width+S)};return t.save(),t.font=f.string,Ct(n.title,C),t.font=a.string,Ct(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?l+2+e.boxPadding:0,Ct(i,x=>{Ct(x.before,C),Ct(x.lines,C),Ct(x.after,C)}),S=0,t.font=c.string,Ct(n.footer,C),t.restore(),_+=b.width,{width:_,height:v}}function g4(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function _4(n,e,t,i){const{x:o,width:r}=i,l=t.caretSize+t.caretPadding;if(n==="left"&&o+r+l>e.width||n==="right"&&o-r-l<0)return!0}function v4(n,e,t,i){const{x:o,width:r}=t,{width:l,chartArea:{left:s,right:a}}=n;let f="center";return i==="center"?f=o<=(s+a)/2?"left":"right":o<=r/2?f="left":o>=l-r/2&&(f="right"),_4(f,n,e,t)&&(f="center"),f}function jd(n,e,t){const i=t.yAlign||e.yAlign||g4(n,t);return{xAlign:t.xAlign||e.xAlign||v4(n,e,t,i),yAlign:i}}function y4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function k4(n,e,t){let{y:i,height:o}=n;return e==="top"?i+=t:e==="bottom"?i-=o+t:i-=o/2,i}function zd(n,e,t,i){const{caretSize:o,caretPadding:r,cornerRadius:l}=n,{xAlign:s,yAlign:a}=t,f=o+r,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:h}=jo(l);let b=y4(e,s);const v=k4(e,a,f);return a==="center"?s==="left"?b+=f:s==="right"&&(b-=f):s==="left"?b-=Math.max(c,d)+o:s==="right"&&(b+=Math.max(u,h)+o),{x:sn(b,0,i.width-e.width),y:sn(v,0,i.height-e.height)}}function El(n,e,t){const i=Wn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Hd(n){return oi([],gi(n))}function w4(n,e,t){return Wi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function qd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class cf extends $i{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),o=i.enabled&&t.options.animation&&i.animations,r=new t1(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=w4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,o=i.beforeTitle.apply(this,[e]),r=i.title.apply(this,[e]),l=i.afterTitle.apply(this,[e]);let s=[];return s=oi(s,gi(o)),s=oi(s,gi(r)),s=oi(s,gi(l)),s}getBeforeBody(e,t){return Hd(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,o=[];return Ct(e,r=>{const l={before:[],lines:[],after:[]},s=qd(i,r);oi(l.before,gi(s.beforeLabel.call(this,r))
|
||
|
* chartjs-adapter-luxon v1.1.0
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2021 chartjs-adapter-luxon Contributors
|
||
|
* Released under the MIT license
|
||
|
*/const V4={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};r1._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},formats:function(){return V4},parse:function(n,e){const t=this.options;if(n===null||typeof n=="undefined")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Jd(n){let e,t,i;return{c(){e=g("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(o,r){w(o,e,r),i=!0},i(o){i||(Dt(()=>{t||(t=ct(e,Bn,{duration:150},!0)),t.run(1)}),i=!0)},o(o){t||(t=ct(e,Bn,{duration:150},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end()}}}function B4(n){let e,t,i=n[1]===1?"log":"logs",o;return{c(){e=j(n[1]),t=$(),o=j(i)},m(r,l){w(r,e,l),w(r,t,l),w(r,o,l)},p(r,l){l&2&&ge(e,r[1]),l&2&&i!==(i=r[1]===1?"log":"logs")&&ge(o,i)},d(r){r&&k(e),r&&k(t),r&&k(o)}}}function U4(n){let e;return{c(){e=j("Loading...")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function W4(n){let e,t,i,o,r,l,s=n[2]&&Jd();function a(u,d){return u[2]?U4:B4}let f=a(n),c=f(n);return{c(){e=g("div"),s&&s.c(),t=$(),i=g("canvas"),o=$(),r=g("div"),c.c(),p(i,"class","chart-canvas svelte-vh4sl8"),_c(i,"height","250px"),_c(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ne(e,"loading",n[2]),p(r,"class","txt-hint m-t-xs txt-right")},m(u,d){w(u,e,d),s&&s.m(e,null),m(e,t),m(e,i),n[8](i),w(u,o,d),w(u,r,d),c.m(r,null),l=!0},p(u,[d]){u[2]?s?d&4&&T(s,1):(s=Jd(),s.c(),T(s,1),s.m(e,t)):s&&(Ae(),F(s,1,1,()=>{s=null}),De()),d&4&&ne(e,"loading",u[2]),f===(f=a(u))&&c?c.p(u,d):(c.d(1),c=f(u),c&&(c.c(),c.m(r,null)))},i(u){l||(T(s),l=!0)},o(u){F(s),l=!1},d(u){u&&k(e),s&&s.d(),n[8](null),u&&k(o),u&&k(r),c.d()}}}function Y4(n,e,t){let{filter:i=""}=e,{presets:o=""}=e,r,l,s=[],a=0,f=!1;async function c(){return t(2,f=!0),Se.Logs.getRequestsStats({filter:[o,i].filter(Boolean).join("&&")}).then(h=>{u();for(let b of h)s.push({x:B.getDateTime(b.date).toLocal().toJSDate(),y:b.total}),t(1,a+=b.total);s.push({x:new Date,y:void 0})}).catch(h=>{h!==null&&(u(),console.warn(h),Se.errorResponseHandler(h,!1))}).finally(()=>{t(2,f=!1)})}function u(){t(1,a=0),t(7,s=[])}di(()=>(bs.register(Yi,Es,Qr,cc,tl,m4,S4),t(6,l=new bs(r,{type:"line",data:{datasets:[{label:"Total requests",data:s,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>l==null?void 0:l.destroy()));function d(h){he[h?"unshift":"push"](()=>{r=h,t(0,r)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,o=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i!="undefined"||typeof o!="undefined")&&c(),n.$$.dirty&192&&typeof s!="undefined"&&l&&(t(6,l.data.dataset
|
||
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
||
|
*
|
||
|
* @license MIT <https://opensource.org/licenses/MIT>
|
||
|
* @author Lea Verou <https://lea.verou.me>
|
||
|
* @namespace
|
||
|
* @public
|
||
|
*/var t=function(i){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,l={},s={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++r}),S.__id},clone:function S(C,x){x=x||{};var M,A;switch(s.util.type(C)){case"Object":if(A=s.util.objId(C),x[A])return x[A];M={},x[A]=M;for(var O in C)C.hasOwnProperty(O)&&(M[O]=S(C[O],x));return M;case"Array":return A=s.util.objId(C),x[A]?x[A]:(M=[],x[A]=M,C.forEach(function(D,E){M[E]=S(D,x)}),M);default:return C}},getLanguage:function(S){for(;S;){var C=o.exec(S.className);if(C)return C[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,C){S.className=S.className.replace(RegExp(o,"gi"),""),S.classList.add("language-"+C)},currentScript:function(){if(typeof document=="undefined")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var x in C)if(C[x].src==S)return C[x]}return null}},isActive:function(S,C,x){for(var M="no-"+C;S;){var A=S.classList;if(A.contains(C))return!0;if(A.contains(M))return!1;S=S.parentElement}return!!x}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(S,C){var x=s.util.clone(s.languages[S]);for(var M in C)x[M]=C[M];return x},insertBefore:function(S,C,x,M){M=M||s.languages;var A=M[S],O={};for(var D in A)if(A.hasOwnProperty(D)){if(D==C)for(var E in x)x.hasOwnProperty(E)&&(O[E]=x[E]);x.hasOwnProperty(D)||(O[D]=A[D])}var P=M[S];return M[S]=O,s.languages.DFS(s.languages,function(I,R){R===P&&I!=S&&(this[I]=O)}),O},DFS:function S(C,x,M,A){A=A||{};var O=s.util.objId;for(var D in C)if(C.hasOwnProperty(D)){x.call(C,D,C[D],M||D);var E=C[D],P=s.util.type(E);P==="Object"&&!A[O(E)]?(A[O(E)]=!0,S(E,x,null,A)):P==="Array"&&!A[O(E)]&&(A[O(E)]=!0,S(E,x,D,A))}}},plugins:{},highlightAll:function(S,C){s.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,x){var M={callback:x,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};s.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),s.hooks.run("before-all-elements-highlight",M);for(var A=0,O;O=M.elements[A++];)s.highlightElement(O,C===!0,M.callback)},highlightElement:function(S,C,x){var M=s.util.getLanguage(S),A=s.languages[M];s.util.setLanguage(S,M);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&s.util.setLanguage(O,M);var D=S.textContent,E={element:S,language:M,grammar:A,code:D};function P(R){E.highlightedCode=R,s.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,s.hooks.run("after-highlight",E),s.hooks.run("complete",E),x&&x.call(E.element)}if(s.hooks.run("before-sanity-check",E),O=E.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!E.code){s.hooks.run("complete",E),x&&x.call(E.element);return}if(s.hooks.run("before-highlight",E),!E.grammar){P(s.util.encode(E.code));return}if(C&&i.Worker){var I=new Worker(s.filename);I.onmessage=function(R){P(R.data)},I.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else P(s.highlight(E.code,E.grammar,E.language))},highlight:function(S,C,x){var M={code:S,grammar:C,language:x};if(s.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=s.tokenize(M.code,M.grammar),s.hooks.run("after-tokenize",M),a.stringify(s.util.encode(M.tokens),M.language)},tokenize:function(S,C){var x=C.rest;if(x){for(var M in x)C[M]=x[M];delete C.rest}var A=new u;return d(A,A.head,S),c(S,A,C,A.head,0),b(A)},hooks:{all:{},add
|
||
|
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(E+1))}y.textContent=A,t.highlightElement(y)},function(A){_.setAttribute(s,c),y.textContent=A})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(u),S=0,C;C=y[S++];)t.highlightElement(C)}};var b=!1;t.fileHighlight=function(){b||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),b=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(M1);var mr=M1.exports,K4={exports:{}};(function(n){(function(){if(typeof Prism=="undefined")return;var e=Object.assign||function(r,l){for(var s in l)l.hasOwnProperty(s)&&(r[s]=l[s]);return r};function t(r){this.defaults=e({},r)}function i(r){return r.replace(/-(\w)/g,function(l,s){return s.toUpperCase()})}function o(r){for(var l=0,s=0;s<r.length;++s)r.charCodeAt(s)==" ".charCodeAt(0)&&(l+=3);return r.length+l}t.prototype={setDefaults:function(r){this.defaults=e(this.defaults,r)},normalize:function(r,l){l=e(this.defaults,l);for(var s in l){var a=i(s);s!=="normalize"&&a!=="setDefaults"&&l[s]&&this[a]&&(r=this[a].call(this,r,l[s]))}return r},leftTrim:function(r){return r.replace(/^\s+/,"")},rightTrim:function(r){return r.replace(/\s+$/,"")},tabsToSpaces:function(r,l){return l=l|0||4,r.replace(/\t/g,new Array(++l).join(" "))},spacesToTabs:function(r,l){return l=l|0||4,r.replace(RegExp(" {"+l+"}","g")," ")},removeTrailing:function(r){return r.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(r){return r.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(r){var l=r.match(/^[^\S\n\r]*(?=\S)/gm);return!l||!l[0].length||(l.sort(function(s,a){return s.length-a.length}),!l[0].length)?r:r.replace(RegExp("^"+l[0],"gm"),"")},indent:function(r,l){return r.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++l).join(" ")+"$&")},breakLines:function(r,l){l=l===!0?80:l|0||80;for(var s=r.split(`
|
||
|
`),a=0;a<s.length;++a)if(!(o(s[a])<=l)){for(var f=s[a].split(/(\s+)/g),c=0,u=0;u<f.length;++u){var d=o(f[u]);c+=d,c>l&&(f[u]=`
|
||
|
`+f[u],c=d)}s[a]=f.join("")}return s.join(`
|
||
|
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(r){var l=Prism.plugins.NormalizeWhitespace;if(!(r.settings&&r.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(r.element,"whitespace-normalization",!0)){if((!r.element||!r.element.parentNode)&&r.code){r.code=l.normalize(r.code,r.settings);return}var s=r.element.parentNode;if(!(!r.code||!s||s.nodeName.toLowerCase()!=="pre")){for(var a=s.childNodes,f="",c="",u=!1,d=0;d<a.length;++d){var h=a[d];h==r.element?u=!0:h.nodeName==="#text"&&(u?c+=h.nodeValue:f+=h.nodeValue,s.removeChild(h),--d)}if(!r.element.children.length||!Prism.plugins.KeepMarkup)r.code=f+r.code+c,r.code=l.normalize(r.code,r.settings);else{var b=f+r.element.innerHTML+c;r.element.innerHTML=l.normalize(b,r.settings),r.code=r.element.textContent}}}})})()})(K4);function J4(n){let e,t;return{c(){e=g("div"),t=g("code"),p(t,"class","svelte-tv7jme"),p(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,o){w(i,e,o),m(e,t),t.innerHTML=n[0]},p(i,[o]){o&1&&(t.innerHTML=i[0])},i:le,o:le,d(i){i&&k(e)}}}function Z4(n,e,t){let{content:i=""}=e,{language:o="javascript"}=e,r="";function l(s){return s=typeof s=="string"?s:"",s=mr.plugins.NormalizeWhitespace.normalize(s,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),mr.highlight(s,mr.languages[o]||mr.languages.javascript,o)}return n.$$set=s=>{"content"in s&&t(1,i=s.content),"language"in s&&t(2,o=s.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof mr!="undefined"&&i&&t(0,r=l(i))},[r,i,o]}class tn extends Ie{constructor(e){super(),Le(this,e,Z4,J4,Ee,{content:1,language:2})}}const X4=n=>({}),Xd=n=>({}),Q4=n=>({}),Qd=n=>({});function ep(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C=n[4]&&!n[2]&&tp(n);const x=n[18].header,M=$n(x,n,n[17],Qd);let A=n[4]&&n[2]&&np(n);const O=n[18].default,D=$n(O,n,n[17],null),E=n[18].footer,P=$n(E,n,n[17],Xd);return{c(){e=g("div"),t=g("div"),o=$(),r=g("div"),l=g("div"),C&&C.c(),s=$(),M&&M.c(),a=$(),A&&A.c(),f=$(),c=g("div"),D&&D.c(),u=$(),d=g("div"),P&&P.c(),p(t,"class","overlay"),p(l,"class","overlay-panel-section panel-header"),p(c,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(r,"class",h="overlay-panel "+n[1]+" "+n[8]),ne(r,"popup",n[2]),p(e,"class","overlay-panel-container"),ne(e,"padded",n[2]),ne(e,"active",n[0])},m(I,R){w(I,e,R),m(e,t),m(e,o),m(e,r),m(r,l),C&&C.m(l,null),m(l,s),M&&M.m(l,null),m(l,a),A&&A.m(l,null),m(r,f),m(r,c),D&&D.m(c,null),n[20](c),m(r,u),m(r,d),P&&P.m(d,null),_=!0,y||(S=[X(t,"click",Gt(n[19])),X(c,"scroll",n[21])],y=!0)},p(I,R){n=I,n[4]&&!n[2]?C?C.p(n,R):(C=tp(n),C.c(),C.m(l,s)):C&&(C.d(1),C=null),M&&M.p&&(!_||R&131072)&&Dn(M,x,n,n[17],_?An(x,n[17],R,Q4):On(n[17]),Qd),n[4]&&n[2]?A?A.p(n,R):(A=np(n),A.c(),A.m(l,null)):A&&(A.d(1),A=null),D&&D.p&&(!_||R&131072)&&Dn(D,O,n,n[17],_?An(O,n[17],R,null):On(n[17]),null),P&&P.p&&(!_||R&131072)&&Dn(P,E,n,n[17],_?An(E,n[17],R,X4):On(n[17]),Xd),(!_||R&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(r,"class",h),R&262&&ne(r,"popup",n[2]),R&4&&ne(e,"padded",n[2]),R&1&&ne(e,"active",n[0])},i(I){_||(Dt(()=>{i||(i=ct(t,rs,{duration:Eo,opacity:0},!0)),i.run(1)}),T(M,I),T(D,I),T(P,I),Dt(()=>{v&&v.end(1),b=yf(r,ti,n[2]?{duration:Eo,y:-10}:{duration:Eo,x:50}),b.start()}),_=!0)},o(I){i||(i=ct(t,rs,{duration:Eo,opacity:0},!1)),i.run(0),F(M,I),F(D,I),F(P,I),b&&b.invalidate(),v=Kb(r,ti,n[2]?{duration:Eo,y:10}:{duration:Eo,x:50}),_=!1},d(I){I&&k(e),I&&i&&i.end(),C&&C.d(),M&&M.d(I),A&&A.d(),D&&D.d(I),n[20](null),P&&P.d(I),I&&v&&v.end(),y=!1,rt(S)}}}function tp(n){let e,t,i;return{c(){e=g("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(o,r){w(o,e,r),t||(i=X(e,"click",Gt(n[5])),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function np(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(o,r){w(o,e,r),t||(i=X(e,"click",Gt
|
||
|
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&16&&r!==(r=_[4]))&&p(e,"for",r);const S={};y&16&&(S.id=_[4]),y&1&&(S.disabled=!B.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function r5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[3](_)}let v={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Only domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[4]+".options.onlyDomains"),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Domains that are ONLY allowed as value.
|
||
|
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&16&&r!==(r=_[4]+".options.onlyDomains"))&&p(e,"for",r);const S={};y&16&&(S.id=_[4]+".options.onlyDomains"),y&1&&(S.disabled=!B.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function l5(n){let e,t,i,o,r,l,s;return i=new je({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[o5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[r5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(e,"class","grid")},m(a,f){w(a,e,f),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),s=!0},p(a,[f]){const c={};f&2&&(c.name="schema."+a[1]+".options.exceptDomains"),f&49&&(c.$$scope={dirty:f,ctx:a}),i.$set(c);const u={};f&2&&(u.name="schema."+a[1]+".options.onlyDomains"),f&49&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(T(i.$$.fragment,a),T(l.$$.fragment,a),s=!0)},o(a){F(i.$$.fragment,a),F(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(i),q(l)}}}function s5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){n.$$.not_equal(o.exceptDomains,s)&&(o.exceptDomains=s,t(0,o))}function l(s){n.$$.not_equal(o.onlyDomains,s)&&(o.onlyDomains=s,t(0,o))}return n.$$set=s=>{"key"in s&&t(1,i=s.key),"options"in s&&t(0,o=s.options)},[o,i,r,l]}class O1 extends Ie{constructor(e){super(),Le(this,e,s5,l5,Ee,{key:1,options:0})}}function a5(n){let e,t,i,o;function r(a){n[2](a)}function l(a){n[3](a)}let s={};return n[0]!==void 0&&(s.key=n[0]),n[1]!==void 0&&(s.options=n[1]),e=new O1({props:s}),he.push(()=>Fe(e,"key",r)),he.push(()=>Fe(e,"options",l)),{c(){V(e.$$.fragment)},m(a,f){H(e,a,f),o=!0},p(a,[f]){const c={};!t&&f&1&&(t=!0,c.key=a[0],Re(()=>t=!1)),!i&&f&2&&(i=!0,c.options=a[1],Re(()=>i=!1)),e.$set(c)},i(a){o||(T(e.$$.fragment,a),o=!0)},o(a){F(e.$$.fragment,a),o=!1},d(a){q(e,a)}}}function f5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){i=s,t(0,i)}function l(s){o=s,t(1,o)}return n.$$set=s=>{"key"in s&&t(0,i=s.key),"options"in s&&t(1,o=s.options)},[i,o,r,l]}class c5 extends Ie{constructor(e){super(),Le(this,e,f5,a5,Ee,{key:0,options:1})}}var Sa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],zo={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console!="undefined"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.o
|
||
|
<span class='flatpickr-weekday'>
|
||
|
`+N.join("</span><span class='flatpickr-weekday'>")+`
|
||
|
</span>
|
||
|
`}}function ce(){t.calendarContainer.classList.add("hasWeeks");var L=wt("div","flatpickr-weekwrapper");L.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var N=wt("div","flatpickr-weeks");return L.appendChild(N),{weekWrapper:L,weekNumbers:N}}function ve(L,N){N===void 0&&(N=!0);var Q=N?L:L-t.currentMonth;Q<0&&t._hidePrevMonthArrow===!0||Q>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=Q,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,ot("onYearChange"),G()),R(),ot("onMonthChange"),Ze())}function oe(L,N){if(L===void 0&&(L=!0),N===void 0&&(N=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,N===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var Q=$a(t.config),de=Q.hours,Te=Q.minutes,Ue=Q.seconds;h(de,Te,Ue)}t.redraw(),L&&ot("onChange")}function J(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),ot("onClose")}function $e(){t.config!==void 0&&ot("onDestroy");for(var L=t._handlers.length;L--;)t._handlers[L].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var N=t.calendarContainer.parentNode;if(N.lastChild&&N.removeChild(N.lastChild),N.parentNode){for(;N.firstChild;)N.parentNode.insertBefore(N.firstChild,N);N.parentNode.removeChild(N)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(Q){try{delete t[Q]}catch{}})}function ee(L){return t.calendarContainer.contains(L)}function _e(L){if(t.isOpen&&!t.config.inline){var N=wn(L),Q=ee(N),de=N===t.input||N===t.altInput||t.element.contains(N)||L.path&&L.path.indexOf&&(~L.path.indexOf(t.input)||~L.path.indexOf(t.altInput)),Te=!de&&!Q&&!ee(L.relatedTarget),Ue=!t.config.ignoredFocusElements.some(function(tt){return tt.contains(N)});Te&&Ue&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function fe(L){if(!(!L||t.config.minDate&&L<t.config.minDate.getFullYear()||t.config.maxDate&&L>t.config.maxDate.getFullYear())){var N=L,Q=t.currentYear!==N;t.currentYear=N||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),Q&&(t.redraw(),ot("onYearChange"),G())}}function ie(L,N){var Q;N===void 0&&(N=!0);var de=t.parseDate(L,void 0,N);if(t.config.minDate&&de&&Sn(de,t.config.minDate,N!==void 0?N:!t.minDateHasTime)<0||t.config.maxDate&&de&&Sn(de,t.config.maxDate,N!==void 0?N:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===vo
|
||
|
`),d=g("span"),h=g("span"),h.textContent="Choose presets",b=$(),V(v.$$.fragment),p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[9]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(c,"class","help-block")},m(M,A){w(M,e,A),m(e,t),m(e,i),m(e,o),w(M,l,A),H(s,M,A),w(M,f,A),w(M,c,A),m(c,u),m(c,d),m(d,h),m(d,b),H(v,d,null),_=!0,y||(S=Xe(St.call(null,o,{text:`Allow uploading files ONLY with the listed mime types.
|
||
|
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,A){(!_||A&512&&r!==(r=M[9]))&&p(e,"for",r);const O={};A&512&&(O.id=M[9]),!a&&A&1&&(a=!0,O.value=M[0].mimeTypes,Re(()=>a=!1)),s.$set(O);const D={};A&1025&&(D.$$scope={dirty:A,ctx:M}),v.$set(D)},i(M){_||(T(s.$$.fragment,M),T(v.$$.fragment,M),_=!0)},o(M){F(s.$$.fragment,M),F(v.$$.fragment,M),_=!1},d(M){M&&k(e),M&&k(l),q(s,M),M&&k(f),M&&k(c),q(v),y=!1,S()}}}function R5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[8](_)}let v={id:n[9],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Thumb sizes",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[9]),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(_,y){(!u||y&512&&r!==(r=_[9]))&&p(e,"for",r);const S={};y&512&&(S.id=_[9]),!a&&y&1&&(a=!0,S.value=_[0].thumbs,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function N5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;return i=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[P5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[F5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[I5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[R5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(a,"class","col-sm-12"),p(u,"class","col-sm-12"),p(e,"class","grid")},m(b,v){w(b,e,v),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),m(e,c),m(e,u),H(d,u,null),h=!0},p(b,[v]){const _={};v&2&&(_.name="schema."+b[1]+".options.maxSize"),v&1537&&(_.$$scope={dirty:v,ctx:b}),i.$set(_);const y={};v&2&&(y.name="schema."+b[1]+".options.maxSelect"),v&1537&&(y.$$scope={dirty:v,ctx:b}),l.$set(y);const S={};v&2&&(S.name="schema."+b[1]+".options.mimeTypes"),v&1537&&(S.$$scope={dirty:v,ctx:b}),f.$set(S);const C={};v&2&&(C.name="schema."+b[1]+".options.thumbs"),v&1537&&(C.$$scope={dirty:v,ctx:b}),d.$set(C)},i(b){h||(T(i.$$.fragment,b),T(l.$$.fragment,b),T(f.$$.fragment,b),T(d.$$.fragment,b),h=!0)},o(b){F(i.$$.fragment,b),F(l.$$.fragment,b),F(f.$$.fragment,b),F(d.$$.fragment,b),h=!1},d(b){b&&k(e),q(i),q(l),q(f),q(d)}}}function j5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(){o.maxSize=At(this.value),t(0,o)}function l(){o.maxSelect=At(this.value),t(0,o)}function s(d){n.$$.not_equal(o.mimeTypes,d)&&(o.mimeTypes=d,t(0,o))}const a=()=>{t(0,o.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],o)},f=()=>{t(0,o.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],o)},c=()=>{t(0,o.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],o)};function u(d){n.$$.not_equal(o.thumbs,d)&&(o.thumbs=d,t(0,o))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,o=d.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(o)&&t(0,o={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[o,i,r,l,s,a,f,c,u]}class z5 extends Ie{constructor
|
||
|
<code>@request.query.*</code>
|
||
|
<code>@request.data.*</code>
|
||
|
<code>@request.user.*</code>`,C=$(),x=g("hr"),M=$(),A=g("p"),A.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=$(),D=g("div"),D.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",E=$(),P=g("hr"),I=$(),R=g("p"),R.innerHTML=`Example rule:
|
||
|
<br/>
|
||
|
<code>@request.user.id!=null && created>"2022-01-01 00:00:00"</code>`,p(o,"class","m-b-0"),p(l,"class","inline-flex flex-gap-5"),p(b,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(x,"class","m-t-10 m-b-5"),p(A,"class","m-b-0"),p(D,"class","inline-flex flex-gap-5"),p(P,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(Y,W){w(Y,e,W),m(e,t),m(t,i),m(i,o),m(i,r),m(i,l),m(l,s),m(l,a),m(l,f),m(l,c),m(l,u),m(l,d);for(let te=0;te<K.length;te+=1)K[te].m(l,null);m(i,h),m(i,b),m(i,v),m(i,_),m(i,y),m(i,S),m(i,C),m(i,x),m(i,M),m(i,A),m(i,O),m(i,D),m(i,E),m(i,P),m(i,I),m(i,R),U=!0},p(Y,W){if(W&1){z=Y[0].schema;let te;for(te=0;te<z.length;te+=1){const ce=Bp(Y,z,te);K[te]?K[te].p(ce,W):(K[te]=Wp(ce),K[te].c(),K[te].m(l,null))}for(;te<K.length;te+=1)K[te].d(1);K.length=z.length}},i(Y){U||(Y&&Dt(()=>{G||(G=ct(e,fn,{duration:150},!0)),G.run(1)}),U=!0)},o(Y){Y&&(G||(G=ct(e,fn,{duration:150},!1)),G.run(0)),U=!1},d(Y){Y&&k(e),qn(K,Y),Y&&G&&G.end()}}}function kx(n){let e,t=n[19].name+"",i;return{c(){e=g("code"),i=j(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){r&1&&t!==(t=o[19].name+"")&&ge(i,t)},d(o){o&&k(e)}}}function wx(n){let e,t=n[19].name+"",i,o;return{c(){e=g("code"),i=j(t),o=j(".*")},m(r,l){w(r,e,l),m(e,i),m(e,o)},p(r,l){l&1&&t!==(t=r[19].name+"")&&ge(i,t)},d(r){r&&k(e)}}}function Wp(n){let e;function t(r,l){return r[19].type==="relation"||r[19].type==="user"?wx:kx}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function Sx(n){let e=[],t=new Map,i,o,r=Object.entries(n[6]);const l=s=>s[14];for(let s=0;s<r.length;s+=1){let a=Vp(n,r,s),f=l(a);t.set(f,e[s]=Yp(f,a))}return{c(){for(let s=0;s<e.length;s+=1)e[s].c();i=lt()},m(s,a){for(let f=0;f<e.length;f+=1)e[f].m(s,a);w(s,i,a),o=!0},p(s,a){a&262235&&(r=Object.entries(s[6]),Ae(),e=st(e,a,l,1,s,r,t,i.parentNode,Pt,Yp,i,Vp),De())},i(s){if(!o){for(let a=0;a<r.length;a+=1)T(e[a]);o=!0}},o(s){for(let a=0;a<e.length;a+=1)F(e[a]);o=!1},d(s){for(let a=0;a<e.length;a+=1)e[a].d(s);s&&k(i)}}}function Cx(n){let e;return{c(){e=g("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function xx(n){let e,t,i;function o(){return n[9](n[14])}return{c(){e=g("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Lock and set to Admins only")),X(e,"click",o)],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function Mx(n){let e,t,i;function o(){return n[8](n[14])}return{c(){e=g("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Unlock and set custom rule")),X(e,"click",o)],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function $x(n){let e;return{c(){e=j("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ax(n){let e;return{c(){e=j("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dx(n){let e,t=n[15]+"",i,o,r=Ii(n[0][n[14]])?"Admins only":"Custom rule",l,s,a,f,c=n[14],u,d,h,b,v,_,y;function S(){return n[10](n[14])}const C=()=>n[11](f,c),x=()=>n[11](null,c);function M(I){n[12](I,n[14])}var A=n[4];function O(I){let R={baseCollection:I[0],disabled:Ii(I[0][I[14]])};return I[0][I[14]]!==void 0&&(R.value=I[0][I[14]]),{props:R}}A&&(f=new A(O(n)),C(),he.push(()=>Fe(f,"value",M)));function D(I,R){return R&1&&(b=null),b==null&&(b=!!Ii(I[0][I[14]])),b?Ax:$x}let E=D(n,-1),P=E(n);return{c(){e=g("label"),i=j(t),o=j(" - "),l=j(r),a=$(),f&&V(f.$$.fragment),d=$(),h=g("div"),P.c(),p(e,"for",s=n[18]),p(h,"class","help-block")},m(I,R){w(I,e,R),m(e,i),m(e,o),m(e,l),w(I,a,R),f&&H(f,I,R),w(I,d,R),w(I,h,R),P.m(h,null),v=!0,_||(y=X(e,"click",S),_=!0)},p(I,R){n=I,(!v||R&1)&&r!==(r=
|
||
|
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||
|
</a>.`,o=$(),r=g("span"),s=j(l),a=$(),_&&_.c(),f=$(),u.c(),d=lt(),p(r,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m(x,M){w(x,e,M),m(e,t),m(t,i),m(t,o),m(t,r),m(r,s),m(e,a),_&&_.m(e,null),w(x,f,M),S[c].m(x,M),w(x,d,M),h=!0,b||(v=X(r,"click",n[7]),b=!0)},p(x,[M]){(!h||M&4)&&l!==(l=x[2]?"Hide available fields":"Show available fields")&&ge(s,l),x[2]?_?(_.p(x,M),M&4&&T(_,1)):(_=Up(x),_.c(),T(_,1),_.m(e,null)):_&&(Ae(),F(_,1,1,()=>{_=null}),De());let A=c;c=C(x),c===A?S[c].p(x,M):(Ae(),F(S[A],1,1,()=>{S[A]=null}),De(),u=S[c],u?u.p(x,M):(u=S[c]=y[c](x),u.c()),T(u,1),u.m(d.parentNode,d))},i(x){h||(T(_),T(u),h=!0)},o(x){F(_),F(u),h=!1},d(x){x&&k(e),_&&_.d(),x&&k(f),S[c].d(x),x&&k(d),b=!1,v()}}}function Ii(n){return n===null}function Tx(n,e,t){let{collection:i=new En}=e,o={},r=!1,l={},s,a=!1;const f={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function c(){t(5,a=!0);try{t(4,s=(await _i(()=>import("./FilterAutocompleteInput.15d21df7.js"),[])).default)}catch(y){console.warn(y),t(4,s=null)}t(5,a=!1)}di(()=>{c()});const u=()=>t(2,r=!r),d=async y=>{var S;t(0,i[y]=o[y]||"",i),await Bi(),(S=l[y])==null||S.focus()},h=y=>{t(1,o[y]=i[y],o),t(0,i[y]=null,i)},b=y=>{var S;return(S=l[y])==null?void 0:S.focus()};function v(y,S){he[y?"unshift":"push"](()=>{l[S]=y,t(3,l)})}function _(y,S){n.$$.not_equal(i[S],y)&&(i[S]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,o,r,l,s,a,f,u,d,h,b,v,_]}class Ex extends Ie{constructor(e){super(),Le(this,e,Tx,Ox,Ee,{collection:0})}}function Gp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Kp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jp(n){let e;return{c(){e=g("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zp(n){let e,t,i,o,r=n[1].originalName+"",l,s,a,f,c,u=n[1].name+"",d;return{c(){e=g("li"),t=g("div"),i=j(`Renamed collection
|
||
|
`),o=g("strong"),l=j(r),s=$(),a=g("i"),f=$(),c=g("strong"),d=j(u),p(o,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(c,"class","txt"),p(t,"class","inline-flex")},m(h,b){w(h,e,b),m(e,t),m(t,i),m(t,o),m(o,l),m(t,s),m(t,a),m(t,f),m(t,c),m(c,d)},p(h,b){b&2&&r!==(r=h[1].originalName+"")&&ge(l,r),b&2&&u!==(u=h[1].name+"")&&ge(d,u)},d(h){h&&k(e)}}}function Xp(n){let e,t,i,o,r=n[14].originalName+"",l,s,a,f,c,u=n[14].name+"",d;return{c(){e=g("li"),t=g("div"),i=j(`Renamed field
|
||
|
`),o=g("strong"),l=j(r),s=$(),a=g("i"),f=$(),c=g("strong"),d=j(u),p(o,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(c,"class","txt"),p(t,"class","inline-flex")},m(h,b){w(h,e,b),m(e,t),m(t,i),m(t,o),m(o,l),m(t,s),m(t,a),m(t,f),m(t,c),m(c,d)},p(h,b){b&16&&r!==(r=h[14].originalName+"")&&ge(l,r),b&16&&u!==(u=h[14].name+"")&&ge(d,u)},d(h){h&&k(e)}}}function Qp(n){let e,t,i,o=n[14].name+"",r,l;return{c(){e=g("li"),t=j("Removed field "),i=g("span"),r=j(o),l=$(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(s,a){w(s,e,a),m(e,t),m(e,i),m(i,r),m(e,l)},p(s,a){a&8&&o!==(o=s[14].name+"")&&ge(r,o)},d(s){s&&k(e)}}}function Px(n){let e,t,i,o,r,l,s,a,f,c,u,d,h=n[3].length&&Jp(),b=n[5]&&Zp(n),v=n[4],_=[];for(let C=0;C<v.length;C+=1)_[C]=Xp(Kp(n,v,C));let y=n[3],S=[];for(let C=0;C<y.length;C+=1)S[C]=Qp(Gp(n,y,C));return{c(){e=g("div"),t=g("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=$(),o=g("div"),r=g("p"),r.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
|
||
|
update it manually!`,l=$(),h&&h.c(),s=$(),a=g("h6"),a.textContent="Changes:",f=$(),c=g("ul"),b&&b.c(),u=$();for(let C=0;C<_.length;C+=1)_[C].c();d=$();for(let C=0;C<S.length;C+=1)S[C].c();p(t,"class","icon"),p(o,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(c,"class","changes-list svelte-1ghly2p")},m(C,x){w(C,e,x),m(e,t),m(e,i),m(e,o),m(o,r),m(o,l),h&&h.m(o,null),w(C,s,x),w(C,a,x),w(C,f,x),w(C,c,x),b&&b.m(c,null),m(c,u);for(let M=0;M<_.length;M+=1)_[M].m(c,null);m(c,d);for(let M=0;M<S.length;M+=1)S[M].m(c,null)},p(C,x){if(C[3].length?h||(h=Jp(),h.c(),h.m(o,null)):h&&(h.d(1),h=null),C[5]?b?b.p(C,x):(b=Zp(C),b.c(),b.m(c,u)):b&&(b.d(1),b=null),x&16){v=C[4];let M;for(M=0;M<v.length;M+=1){const A=Kp(C,v,M);_[M]?_[M].p(A,x):(_[M]=Xp(A),_[M].c(),_[M].m(c,d))}for(;M<_.length;M+=1)_[M].d(1);_.length=v.length}if(x&8){y=C[3];let M;for(M=0;M<y.length;M+=1){const A=Gp(C,y,M);S[M]?S[M].p(A,x):(S[M]=Qp(A),S[M].c(),S[M].m(c,null))}for(;M<S.length;M+=1)S[M].d(1);S.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(s),C&&k(a),C&&k(f),C&&k(c),b&&b.d(),qn(_,C),qn(S,C)}}}function Fx(n){let e;return{c(){e=g("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Lx(n){let e,t,i,o,r;return{c(){e=g("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),i=g("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),e.focus(),o||(r=[X(e,"click",n[8]),X(i,"click",n[9])],o=!0)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),o=!1,rt(r)}}}function Ix(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[Lx],header:[Fx],default:[Px]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&524346&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[10](null),q(e,o)}}}function Rx(n,e,t){let i,o,r;const l=yn();let s,a;async function f(y){t(1,a=y),await Bi(),!i&&!o.length&&!r.length?u():s==null||s.show()}function c(){s==null||s.hide()}function u(){c(),l("confirm")}const d=()=>c(),h=()=>u();function b(y){he[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){ft.call(this,n,y)}function _(y){ft.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,o=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,r=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[c,a,s,r,o,i,u,f,d,h,b,v,_]}class Nx extends Ie{constructor(e){super(),Le(this,e,Rx,Ix,Ee,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function eh(n){let e,t,i,o;function r(s){n[26](s)}let l={};return n[2]!==void 0&&(l.collection=n[2]),t=new Ex({props:l}),he.push(()=>Fe(t,"collection",r)),{c(){e=g("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(s,a){w(s,e,a),H(t,e,null),o=!0},p(s,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=s[2],Re(()=>i=!1)),t.$set(f)},i(s){o||(T(t.$$.fragment,s),o=!0)},o(s){F(t.$$.fragment,s),o=!1},d(s){s&&k(e),q(t)}}}function jx(n){let e,t,i,o,r,l;function s(c){n[25](c)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new yx({props:a}),he.push(()=>Fe(i,"collection",s));let f=n[9]===qr&&eh(n);return{c(){e=g("div"),t=g("div"),V(i.$$.fragment),r=$(),f&&f.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===ho),p(e,"class","tabs-content svelte-b10vi")},m(c,u){w(c,e,u),m(e,t),H(i,t,null),m(e,r),f&&f.m(e,null),l=!0},p(c,u){const d={};!o&&u[0]&4&&(o=!0,d.collection=c[2],Re(()=>o=!1)),i.$set(d),u[0]&512&&ne(t,"active",c[9]===ho),c[9]===qr?f?(f.p(c,u),u[0]&512&&T(f,1)):(f=eh(c),f.c(),T(f,1),f.m(e,null)):f&&(Ae(),F(f,1,1,()=>{f=null}),De())},i(c){l||(T(i.$$.fragment,c),T(f),l=!0)},o(c){F(i.$$.fragment,c),F(f),l=!1},d(c){c&&k(e),q(i),f&&f.d()}}}function th(n){let e,t,i,o,r,l,s;return l=new vo({props:{class:"dropdown dropdown-right m
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[20]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function nh(n){let e;return{c(){e=g("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Hx(n){let e,t,i,o,r,l,s,a,f,c,u,d,h=n[2].system&&nh();return{c(){e=g("label"),t=j("Name"),o=$(),r=g("input"),f=$(),h&&h.c(),c=lt(),p(e,"for",i=n[38]),p(r,"type","text"),p(r,"id",l=n[38]),r.required=!0,r.disabled=n[11],p(r,"spellcheck","false"),r.autofocus=s=n[2].isNew,p(r,"placeholder",'eg. "posts"'),r.value=a=n[2].name},m(b,v){w(b,e,v),m(e,t),w(b,o,v),w(b,r,v),w(b,f,v),h&&h.m(b,v),w(b,c,v),n[2].isNew&&r.focus(),u||(d=X(r,"input",n[21]),u=!0)},p(b,v){v[1]&128&&i!==(i=b[38])&&p(e,"for",i),v[1]&128&&l!==(l=b[38])&&p(r,"id",l),v[0]&2048&&(r.disabled=b[11]),v[0]&4&&s!==(s=b[2].isNew)&&(r.autofocus=s),v[0]&4&&a!==(a=b[2].name)&&r.value!==a&&(r.value=a),b[2].system?h||(h=nh(),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(f),h&&h.d(b),b&&k(c),u=!1,d()}}}function ih(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,n[12])),r=!0)},p(s,a){t&&Yn(t.update)&&a[0]&4096&&t.update.call(null,s[12])},i(s){o||(s&&Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){s&&(i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0)),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function oh(n){let e,t,i,o,r;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(l,s){w(l,e,s),i=!0,o||(r=Xe(St.call(null,e,"Has errors")),o=!0)},i(l){i||(l&&Dt(()=>{t||(t=ct(e,Bn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(l){l&&(t||(t=ct(e,Bn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end(),o=!1,r()}}}function qx(n){var I,R,G,U,z,K;let e,t=n[2].isNew?"New collection":"Edit collection",i,o,r,l,s,a,f,c,u,d,h,b,v=!B.isEmpty((I=n[4])==null?void 0:I.schema),_,y,S,C,x=!B.isEmpty((R=n[4])==null?void 0:R.listRule)||!B.isEmpty((G=n[4])==null?void 0:G.viewRule)||!B.isEmpty((U=n[4])==null?void 0:U.createRule)||!B.isEmpty((z=n[4])==null?void 0:z.updateRule)||!B.isEmpty((K=n[4])==null?void 0:K.deleteRule),M,A,O,D=!n[2].isNew&&!n[2].system&&th(n);s=new je({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[Hx,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let E=v&&ih(n),P=x&&oh();return{c(){e=g("h4"),i=j(t),o=$(),D&&D.c(),r=$(),l=g("form"),V(s.$$.fragment),a=$(),f=g("input"),c=$(),u=g("div"),d=g("button"),h=g("span"),h.textContent="Fields",b=$(),E&&E.c(),_=$(),y=g("button"),S=g("span"),S.textContent="API Rules",C=$(),P&&P.c(),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(l,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===ho),p(S,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ne(y,"active",n[9]===qr),p(u,"class","tabs-header stretched")},m(Y,W){w(Y,e,W),m(e,i),w(Y,o,W),D&&D.m(Y,W),w(Y,r,W),w(Y,l,W),H(s,l,null),m(l,a),m(l,f),w(Y,c,W),w(Y,u,W),m(u,d),m(d,h),m(d,b),E&&E.m(d,null),m(u,_),m(u,y),m(y,S),m(y,C),P&&P.m(y,null),M=!0,A||(O=[X(l,"submit",Gt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],A=!0)},p(Y,W){var ce,ve,oe,J,$e,ee;(!M||W[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&ge(i,t),!Y[2].isNew&&!Y[2].system?D?(D.p(Y,W),W[0]&4&&T(D,1)):(D=th(Y),D.c(),T(D,1),D.m(r.parentNode,r)):D&&(Ae(),F(D,1,1,()=>{D=null}),De());const te={};W[0]&2048&&(te.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),W[0]&2052|W[1]&384&&(te.$$scope={dirty:W,ctx:Y}),s.$set(te),W[0]&16&&(v=!B.isEmpty((ce=Y[4])==null?void 0:ce.schema)),v?E?(E.p(Y,W),W[0]&16&&T(E,1)):(E=ih(Y),E.c(),T(E,1),E.m(d,null)):E&&(Ae(),F(E,1,1,()=>{E=null}),De()),W[0]&512&&ne(d,"active",Y[9]===ho),W[0]&16&&(x=!B.isEmpty((ve=Y[4])==null?void 0:ve.listRule)||!B.isEmpty((oe=Y[4])==null?void 0:oe.viewRule)||!B.isEmpty((J=Y[4])==null?void 0:J.createRule)||
|
||
|
<span class="txt">New collection</span>`,y=$(),V(S.$$.fragment),p(r,"type","button"),p(r,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ne(r,"hidden",!n[4]),p(o,"class","form-field-addon"),p(s,"type","text"),p(s,"placeholder","Search collections..."),p(i,"class","form-field search"),ne(i,"active",n[4]),p(t,"class","sidebar-header"),p(f,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),p(_,"type","button"),p(_,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,o),m(o,r),m(i,l),m(i,s),Me(s,n[0]),m(e,a),m(e,f),m(e,c),m(e,u);for(let R=0;R<d.length;R+=1)d[R].m(u,null);D&&D.m(u,null),m(e,b),m(e,v),m(v,_),w(P,y,I),H(S,P,I),C=!0,x||(M=[X(r,"click",n[8]),X(s,"input",n[9]),X(_,"click",n[11])],x=!0)},p(P,[I]){I&16&&ne(r,"hidden",!P[4]),I&1&&s.value!==P[0]&&Me(s,P[0]),I&16&&ne(i,"active",P[4]),I&106&&(A=P[3],d=st(d,I,O,1,P,A,h,u,an,ah,null,rh),!A.length&&D?D.p(P,I):A.length?D&&(D.d(1),D=null):(D=lh(P),D.c(),D.m(u,null)));const R={};S.$set(R)},i(P){C||(T(S.$$.fragment,P),C=!0)},o(P){F(S.$$.fragment,P),C=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();D&&D.d(),P&&k(y),n[12](null),q(S,P),x=!1,rt(M)}}}function Kx(n,e,t){let i,o,r,l,s;pn(n,fi,_=>t(5,l=_)),pn(n,Go,_=>t(7,s=_));let a,f="";function c(_){jb(fi,l=_,l)}const u=()=>t(0,f="");function d(){f=this.value,t(0,f)}const h=_=>c(_),b=()=>a==null?void 0:a.show();function v(_){he[_?"unshift":"push"](()=>{a=_,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,o=f!==""),n.$$.dirty&131&&t(3,r=s.filter(_=>_.name!="profiles"&&(_.id==f||_.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,a,r,o,l,c,s,u,d,h,b,v]}class Jx extends Ie{constructor(e){super(),Le(this,e,Kx,Gx,Ee,{})}}function Zx(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He;return{c(){e=g("p"),e.innerHTML=`The syntax basically follows the format
|
||
|
<code><span class="txt-success">OPERAND</span>
|
||
|
<span class="txt-danger">OPERATOR</span>
|
||
|
<span class="txt-success">OPERAND</span></code>, where:`,t=$(),i=g("ul"),o=g("li"),o.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||
|
quoted), number, null, true, false`,r=$(),l=g("li"),s=g("code"),s.textContent="OPERATOR",a=j(` - is one of:
|
||
|
`),f=g("br"),c=$(),u=g("ul"),d=g("li"),h=g("code"),h.textContent="=",b=$(),v=g("span"),v.textContent="Equal",_=$(),y=g("li"),S=g("code"),S.textContent="!=",C=$(),x=g("span"),x.textContent="NOT equal",M=$(),A=g("li"),O=g("code"),O.textContent=">",D=$(),E=g("span"),E.textContent="Greater than",P=$(),I=g("li"),R=g("code"),R.textContent=">=",G=$(),U=g("span"),U.textContent="Greater than or equal",z=$(),K=g("li"),Y=g("code"),Y.textContent="<",W=$(),te=g("span"),te.textContent="Less than or equal",ce=$(),ve=g("li"),oe=g("code"),oe.textContent="<=",J=$(),$e=g("span"),$e.textContent="Less than or equal",ee=$(),_e=g("li"),fe=g("code"),fe.textContent="~",ie=$(),ye=g("span"),ye.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||
|
match)`,Ne=$(),Pe=g("li"),ze=g("code"),ze.textContent="!~",se=$(),re=g("span"),re.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||
|
wildcard match)`,ke=$(),He=g("p"),He.innerHTML=`To group and combine several expressions you could use brackets
|
||
|
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(s,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(S,"class","filter-op svelte-1w7s5nw"),p(x,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(E,"class","txt-hint"),p(R,"class","filter-op svelte-1w7s5nw"),p(U,"class","txt-hint"),p(Y,"class","filter-op svelte-1w7s5nw"),p(te,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p($e,"class","txt-hint"),p(fe,"class","filter-op svelte-1w7s5nw"),p(ye,"class","txt-hint"),p(ze,"class","filter-op svelte-1w7s5nw"),p(re,"class","txt-hint")},m(qe,Je){w(qe,e,Je),w(qe,t,Je),w(qe,i,Je),m(i,o),m(i,r),m(i,l),m(l,s),m(l,a),m(l,f),m(l,c),m(l,u),m(u,d),m(d,h),m(d,b),m(d,v),m(u,_),m(u,y),m(y,S),m(y,C),m(y,x),m(u,M),m(u,A),m(A,O),m(A,D),m(A,E),m(u,P),m(u,I),m(I,R),m(I,G),m(I,U),m(u,z),m(u,K),m(K,Y),m(K,W),m(K,te),m(u,ce),m(u,ve),m(ve,oe),m(ve,J),m(ve,$e),m(u,ee),m(u,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(u,Ne),m(u,Pe),m(Pe,ze),m(Pe,se),m(Pe,re),w(qe,ke,Je),w(qe,He,Je)},p:le,i:le,o:le,d(qe){qe&&k(e),qe&&k(t),qe&&k(i),qe&&k(ke),qe&&k(He)}}}class Xx extends Ie{constructor(e){super(),Le(this,e,null,Zx,Ee,{})}}function fh(n,e,t){const i=n.slice();return i[8]=e[t],i}function ch(n,e,t){const i=n.slice();return i[8]=e[t],i}function uh(n,e,t){const i=n.slice();return i[13]=e[t],i}function dh(n,e,t){const i=n.slice();return i[13]=e[t],i}function ph(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hh(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function mh(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function bh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("div"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function gh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function Qx(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y=n[0].name+"",S,C,x,M,A,O,D,E=[],P=new Map,I,R,G=[],U=new Map,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He,qe,Je,be,Oe,Z,ae,Ve,yt,it,bt,at,vt,qt,Mt,$t,me,Ce,Ye,ot,cn,ue,we,Ze,Kt,zt,ni,pe,L,N,Q,de,Te,Ue,tt,Ge,nt=[],Ke=new Map,et,gt,Ft=[],nn=new Map,Fn,Vt=n[1]&&ph(),wo=n[4];const So=xe=>xe[13].lang;for(let xe=0;xe<wo.length;xe+=1){let We=dh(n,wo,xe),Ot=So(We);P.set(Ot,E[xe]=hh(Ot,We))}let Gi=n[4];const nl=xe=>xe[13].lang;for(let xe=0;xe<Gi.length;xe+=1){let We=uh(n,Gi,xe),Ot=nl(We);U.set(Ot,G[xe]=mh(Ot,We))}be=new tn({props:{content:`
|
||
|
// DESC by created and ASC by id
|
||
|
?sort=-created,id
|
||
|
`}}),vt=new tn({props:{content:`
|
||
|
?filter=(id='abc' && created>'2022-01-01')
|
||
|
`}}),Mt=new Xx({}),Ze=new tn({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let Co=n[5];const il=xe=>xe[8].code;for(let xe=0;xe<Co.length;xe+=1){let We=ch(n,Co,xe),Ot=il(We);Ke.set(Ot,nt[xe]=bh(Ot,We))}let Ki=n[5];const ol=xe=>xe[8].code;for(let xe=0;xe<Ki.length;xe+=1){let We=fh(n,Ki,xe),Ot=ol(We);nn.set(Ot,Ft[xe]=gh(Ot,We))}return{c(){e=g("div"),t=g("strong"),t.textContent="GET",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records"),u=$(),Vt&&Vt.c(),d=$(),h=g("div"),b=g("p"),v=j("Fetch a paginated "),_=g("strong"),S=j(y),C=j(" records list."),x=$(),M=g("div"),M.textContent="Client SDKs example",A=$(),O=g("div"),D=g("div");for(let xe=0;xe<E.length;xe+=1)E[xe].c();I=$(),R=g("div");for(let xe=0;xe<G.length;xe+=1)G[xe].c();z=$(),K=g("div"),K.textContent="Query parameters",Y=$(),W=g("table"),te=g("thead"),te.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,ce=$(),ve=g("tbody"),oe=g("tr"),oe.innerHTML=`<td>page</td>
|
||
|
<td><span class="label">Number</span></td>
|
||
|
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,J=$(),$e=g("tr"),$e.innerHTML=`<td>perPage</td>
|
||
|
<td><span class="label">Number</span></td>
|
||
|
<td>Specify the max returned records per page (default to 30).</td>`,ee=$(),_e=g("tr"),fe=g("td"),fe.textContent="sort",ie=$(),ye=g("td"),ye.innerHTML='<span class="label">String</span>',Ne=$(),Pe=g("td"),ze=j("Specify the records order attribute(s). "),se=g("br"),re=j(`
|
||
|
Add `),ke=g("code"),ke.textContent="-",He=j(" / "),qe=g("code"),qe.textContent="+",Je=j(` (default) in front of the attribute for DESC / ASC order.
|
||
|
Ex.:
|
||
|
`),V(be.$$.fragment),Oe=$(),Z=g("tr"),ae=g("td"),ae.textContent="filter",Ve=$(),yt=g("td"),yt.innerHTML='<span class="label">String</span>',it=$(),bt=g("td"),at=j(`Filter the returned records. Ex.:
|
||
|
`),V(vt.$$.fragment),qt=$(),V(Mt.$$.fragment),$t=$(),me=g("tr"),Ce=g("td"),Ce.textContent="expand",Ye=$(),ot=g("td"),ot.innerHTML='<span class="label">String</span>',cn=$(),ue=g("td"),we=j(`Auto expand nested record relations. Ex.:
|
||
|
`),V(Ze.$$.fragment),Kt=j(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),zt=g("br"),ni=j(`
|
||
|
The expanded relations will be appended to each individual record under the
|
||
|
`),pe=g("code"),pe.textContent="@expand",L=j(" property (eg. "),N=g("code"),N.textContent='"@expand": {"rel1": {...}, ...}',Q=j(")."),de=$(),Te=g("div"),Te.textContent="Responses",Ue=$(),tt=g("div"),Ge=g("div");for(let xe=0;xe<nt.length;xe+=1)nt[xe].c();et=$(),gt=g("div");for(let xe=0;xe<Ft.length;xe+=1)Ft[xe].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(D,"class","tabs-header compact left"),p(R,"class","tabs-content"),p(O,"class","tabs m-b-lg"),p(K,"class","section-title"),p(W,"class","table-compact table-border m-b-lg"),p(Te,"class","section-title"),p(Ge,"class","tabs-header compact left"),p(gt,"class","tabs-content"),p(tt,"class","tabs")},m(xe,We){w(xe,e,We),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(e,u),Vt&&Vt.m(e,null),w(xe,d,We),w(xe,h,We),m(h,b),m(b,v),m(b,_),m(_,S),m(b,C),w(xe,x,We),w(xe,M,We),w(xe,A,We),w(xe,O,We),m(O,D);for(let Ot=0;Ot<E.length;Ot+=1)E[Ot].m(D,null);m(O,I),m(O,R);for(let Ot=0;Ot<G.length;Ot+=1)G[Ot].m(R,null);w(xe,z,We),w(xe,K,We),w(xe,Y,We),w(xe,W,We),m(W,te),m(W,ce),m(W,ve),m(ve,oe),m(ve,J),m(ve,$e),m(ve,ee),m(ve,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(_e,Ne),m(_e,Pe),m(Pe,ze),m(Pe,se),m(Pe,re),m(Pe,ke),m(Pe,He),m(Pe,qe),m(Pe,Je),H(be,Pe,null),m(ve,Oe),m(ve,Z),m(Z,ae),m(Z,Ve),m(Z,yt),m(Z,it),m(Z,bt),m(bt,at),H(vt,bt,null),m(bt,qt),H(Mt,bt,null),m(ve,$t),m(ve,me),m(me,Ce),m(me,Ye),m(me,ot),m(me,cn),m(me,ue),m(ue,we),H(Ze,ue,null),m(ue,Kt),m(ue,zt),m(ue,ni),m(ue,pe),m(ue,L),m(ue,N),m(ue,Q),w(xe,de,We),w(xe,Te,We),w(xe,Ue,We),w(xe,tt,We),m(tt,Ge);for(let Ot=0;Ot<nt.length;Ot+=1)nt[Ot].m(Ge,null);m(tt,et),m(tt,gt);for(let Ot=0;Ot<Ft.length;Ot+=1)Ft[Ot].m(gt,null);Fn=!0},p(xe,[We]){(!Fn||We&1)&&a!==(a=xe[0].name+"")&&ge(f,a),xe[1]?Vt||(Vt=ph(),Vt.c(),Vt.m(e,null)):Vt&&(Vt.d(1),Vt=null),(!Fn||We&1)&&y!==(y=xe[0].name+"")&&ge(S,y),We&24&&(wo=xe[4],E=st(E,We,So,1,xe,wo,P,D,an,hh,null,dh)),We&24&&(Gi=xe[4],Ae(),G=st(G,We,nl,1,xe,Gi,U,R,Pt,mh,null,uh),De()),We&36&&(Co=xe[5],nt=st(nt,We,il,1,xe,Co,Ke,Ge,an,bh,null,ch)),We&36&&(Ki=xe[5],Ae(),Ft=st(Ft,We,ol,1,xe,Ki,nn,gt,Pt,gh,null,fh),De())},i(xe){if(!Fn){for(let We=0;We<Gi.length;We+=1)T(G[We]);T(be.$$.fragment,xe),T(vt.$$.fragment,xe),T(Mt.$$.fragment,xe),T(Ze.$$.fragment,xe);for(let We=0;We<Ki.length;We+=1)T(Ft[We]);Fn=!0}},o(xe){for(let We=0;We<G.length;We+=1)F(G[We]);F(be.$$.fragment,xe),F(vt.$$.fragment,xe),F(Mt.$$.fragment,xe),F(Ze.$$.fragment,xe);for(let We=0;We<Ft.length;We+=1)F(Ft[We]);Fn=!1},d(xe){xe&&k(e),Vt&&Vt.d(),xe&&k(d),xe&&k(h),xe&&k(x),xe&&k(M),xe&&k(A),xe&&k(O);for(let We=0;We<E.length;We+=1)E[We].d();for(let We=0;We<G.length;We+=1)G[We].d();xe&&k(z),xe&&k(K),xe&&k(Y),xe&&k(W),q(be),q(vt),q(Mt),q(Ze),xe&&k(de),xe&&k(Te),xe&&k(Ue),xe&&k(tt);for(let We=0;We<nt.length;We+=1)nt[We].d();for(let We=0;We<Ft.length;We+=1)Ft[We].d()}}}function e6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.listRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[B.dummyCollectionRecord(o),B.dummyCollectionRecord(o)]},null,2)}),s.push({code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Something went wrong while processing your request. Invalid filter.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),i&&s.push({code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "Only admins can access this action.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),s.push({code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase("${Se.baseUrl}");
|
||
|
|
||
|
client.Records.getList("${o==null?void 0:o.name}", { page: 2 })
|
||
|
.then(function (list) {
|
||
|
// success...
|
||
|
}).catch(function (error) {
|
||
|
// error...
|
||
|
});
|
||
|
|
||
|
// alternatively you can also fetch all records at once via getFullList:
|
||
|
client.Records.getFullList("${o==null?void 0:o.name}", 200 /* batch size */);
|
||
|
.then(function (records) {
|
||
|
// success...
|
||
|
}).catch(function (error) {
|
||
|
// error...
|
||
|
});
|
||
|
`}])},[o,i,r,l,a,s,f,c]}class t6 extends Ie{constructor(e){super(),Le(this,e,e6,Qx,Ee,{collection:0})}}function _h(n,e,t){const i=n.slice();return i[8]=e[t],i}function vh(n,e,t){const i=n.slice();return i[8]=e[t],i}function yh(n,e,t){const i=n.slice();return i[13]=e[t],i}function kh(n,e,t){const i=n.slice();return i[13]=e[t],i}function wh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sh(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function Ch(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function xh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Mh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function n6(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P=[],I=new Map,R,G,U=[],z=new Map,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He,qe,Je,be,Oe,Z,ae,Ve,yt,it,bt,at=[],vt=new Map,qt,Mt,$t=[],me=new Map,Ce,Ye=n[1]&&wh(),ot=n[4];const cn=pe=>pe[13].lang;for(let pe=0;pe<ot.length;pe+=1){let L=kh(n,ot,pe),N=cn(L);I.set(N,P[pe]=Sh(N,L))}let ue=n[4];const we=pe=>pe[13].lang;for(let pe=0;pe<ue.length;pe+=1){let L=yh(n,ue,pe),N=we(L);z.set(N,U[pe]=Ch(N,L))}re=new tn({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let Ze=n[5];const Kt=pe=>pe[8].code;for(let pe=0;pe<Ze.length;pe+=1){let L=vh(n,Ze,pe),N=Kt(L);vt.set(N,at[pe]=xh(N,L))}let zt=n[5];const ni=pe=>pe[8].code;for(let pe=0;pe<zt.length;pe+=1){let L=_h(n,zt,pe),N=ni(L);me.set(N,$t[pe]=Mh(N,L))}return{c(){e=g("div"),t=g("strong"),t.textContent="GET",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),Ye&&Ye.c(),h=$(),b=g("div"),v=g("p"),_=j("Fetch a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("div"),A.textContent="Client SDKs example",O=$(),D=g("div"),E=g("div");for(let pe=0;pe<P.length;pe+=1)P[pe].c();R=$(),G=g("div");for(let pe=0;pe<U.length;pe+=1)U[pe].c();K=$(),Y=g("div"),Y.textContent="Path Parameters",W=$(),te=g("table"),te.innerHTML=`<thead><tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr></thead>
|
||
|
<tbody><tr><td>id</td>
|
||
|
<td><span class="label">String</span></td>
|
||
|
<td>ID of the record to view.</td></tr></tbody>`,ce=$(),ve=g("div"),ve.textContent="Query parameters",oe=$(),J=g("table"),$e=g("thead"),$e.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,ee=$(),_e=g("tbody"),fe=g("tr"),ie=g("td"),ie.textContent="expand",ye=$(),Ne=g("td"),Ne.innerHTML='<span class="label">String</span>',Pe=$(),ze=g("td"),se=j(`Auto expand nested record relations. Ex.:
|
||
|
`),V(re.$$.fragment),ke=j(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),He=g("br"),qe=j(`
|
||
|
The expanded relations will be appended to the record under the
|
||
|
`),Je=g("code"),Je.textContent="@expand",be=j(" property (eg. "),Oe=g("code"),Oe.textContent='"@expand": {"rel1": {...}, ...}',Z=j(")."),ae=$(),Ve=g("div"),Ve.textContent="Responses",yt=$(),it=g("div"),bt=g("div");for(let pe=0;pe<at.length;pe+=1)at[pe].c();qt=$(),Mt=g("div");for(let pe=0;pe<$t.length;pe+=1)$t[pe].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-info"),p(b,"class","content m-b-base"),p(A,"class","section-title"),p(E,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(Y,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(Ve,"class","section-title"),p(bt,"class","tabs-header compact left"),p(Mt,"class","tabs-content"),p(it,"class","tabs")},m(pe,L){w(pe,e,L),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),Ye&&Ye.m(e,null),w(pe,h,L),w(pe,b,L),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),w(pe,M,L),w(pe,A,L),w(pe,O,L),w(pe,D,L),m(D,E);for(let N=0;N<P.length;N+=1)P[N].m(E,null);m(D,R),m(D,G);for(let N=0;N<U.length;N+=1)U[N].m(G,null);w(pe,K,L),w(pe,Y,L),w(pe,W,L),w(pe,te,L),w(pe,ce,L),w(pe,ve,L),w(pe,oe,L),w(pe,J,L),m(J,$e),m(J,ee),m(J,_e),m(_e,fe),m(fe,ie),m(fe,ye),m(fe,Ne),m(fe,Pe),m(fe,ze),m(ze,se),H(re,ze,null),m(ze,ke),m(ze,He),m(ze,qe),m(ze,Je),m(ze,be),m(ze,Oe),m(ze,Z),w(pe,ae,L),w(pe,Ve,L),w(pe,yt,L),w(pe,it,L),m(it,bt);for(let N=0;N<at.length;N+=1)at[N].m(bt,null);m(it,qt),m(it,Mt);for(let N=0;N<$t.length;N+=1)$t[N].m(Mt,null);Ce=!0},p(pe,[L]){(!Ce||L&1)&&a!==(a=pe[0].name+"")&&ge(f,a),pe[1]?Ye||(Ye=wh(),Ye.c(),Ye.m(e,null)):Ye&&(Ye.d(1),Ye=null),(!Ce||L&1)&&S!==(S=pe[0].name+"")&&ge(C,S),L&24&&(ot=pe[4],P=st(P,L,cn,1,pe,ot,I,E,an,Sh,null,kh)),L&24&&(ue=pe[4],Ae(),U=st(U,L,we,1,pe,ue,z,G,Pt,Ch,null,yh),De()),L&36&&(Ze=pe[5],at=st(at,L,Kt,1,pe,Ze,vt,bt,an,xh,null,vh)),L&36&&(zt=pe[5],Ae(),$t=st($t,L,ni,1,pe,zt,me,Mt,Pt,Mh,null,_h),De())},i(pe){if(!Ce){for(let L=0;L<ue.length;L+=1)T(U[L]);T(re.$$.fragment,pe);for(let L=0;L<zt.length;L+=1)T($t[L]);Ce=!0}},o(pe){for(let L=0;L<U.length;L+=1)F(U[L]);F(re.$$.fragment,pe);for(let L=0;L<$t.length;L+=1)F($t[L]);Ce=!1},d(pe){pe&&k(e),Ye&&Ye.d(),pe&&k(h),pe&&k(b),pe&&k(M),pe&&k(A),pe&&k(O),pe&&k(D);for(let L=0;L<P.length;L+=1)P[L].d();for(let L=0;L<U.length;L+=1)U[L].d();pe&&k(K),pe&&k(Y),pe&&k(W),pe&&k(te),pe&&k(ce),pe&&k(ve),pe&&k(oe),pe&&k(J),q(re),pe&&k(ae),pe&&k(Ve),pe&&k(yt),pe&&k(it);for(let L=0;L<at.length;L+=1)at[L].d();for(let L=0;L<$t.length;L+=1)$t[L].d()}}}function i6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.viewRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)}),i&&s.push({code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "Only admins can access this action.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),s.push({code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase("${Se.baseUrl}");
|
||
|
|
||
|
client.Records.getOne("${o==null?void 0:o.name}", "RECORD_ID")
|
||
|
.then(function (record) {
|
||
|
// success...
|
||
|
}).catch(function (error) {
|
||
|
// error...
|
||
|
});
|
||
|
`}])},[o,i,r,l,a,s,f,c]}class o6 extends Ie{constructor(e){super(),Le(this,e,i6,n6,Ee,{collection:0})}}function $h(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[8]=e[t],i}function Dh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Th(n,e,t){const i=n.slice();return i[16]=e[t],i}function Eh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ph(n,e){let t,i=e[16].lang+"",o,r,l,s;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[16].lang+"")&&ge(o,i),c&20&&ne(t,"active",e[2]===e[16].lang)},d(f){f&&k(t),l=!1,s()}}}function Fh(n,e){let t,i,o,r;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[16].code),i.$set(a),s&20&&ne(t,"active",e[2]===e[16].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function r6(n){let e;return{c(){e=g("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function l6(n){let e;return{c(){e=g("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function s6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("User "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function a6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("Relation record "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function f6(n){let e,t,i,o,r;return{c(){e=j("FormData object."),t=g("br"),i=j(`
|
||
|
Set to `),o=g("code"),o.textContent="null",r=j(" to delete already uploaded file(s).")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),w(l,o,s),w(l,r,s)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),l&&k(o),l&&k(r)}}}function c6(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function u6(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function d6(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function p6(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function h6(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Lh(n,e){let t,i,o,r,l,s=e[13].name+"",a,f,c,u,d=B.getFieldValueType(e[13])+"",h,b,v,_;function y(O,D){return O[13].required?l6:r6}let S=y(e),C=S(e);function x(O,D){if(O[13].type==="text")return h6;if(O[13].type==="number")return p6;if(O[13].type==="json")return d6;if(O[13].type==="email")return u6;if(O[13].type==="url")return c6;if(O[13].type==="file")return f6;if(O[13].type==="relation")return a6;if(O[13].type==="user")return s6}let M=x(e),A=M&&M(e);return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),C.c(),r=$(),l=g("span"),a=j(s),f=$(),c=g("td"),u=g("span"),h=j(d),b=$(),v=g("td"),A&&A.c(),_=$(),p(o,"class","inline-flex"),p(u,"class","label"),this.first=t},m(O,D){w(O,t,D),m(t,i),m(i,o),C.m(o,null),m(o,r),m(o,l),m(l,a),m(t,f),m(t,c),m(c,u),m(u,h),m(t,b),m(t,v),A&&A.m(v,null),m(t,_)},p(O,D){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(o,r))),D&1&&s!==(s=e[13].name+"")&&ge(a,s),D&1&&d!==(d=B.getFieldValueType(e[13])+"")&&ge(h,d),M===(M=x(e))&&A?A.p(e,D):(A&&A.d(1),A=M&&M(e),A&&(A.c(),A.m(v,null)))},d(O){O&&k(t),C.d(),A&&A.d()}}}function Ih(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&8&&i!==(i=e[8].code+"")&&ge(o,i),c&10&&ne(t,"active",e[1]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Rh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&8&&(a.content=e[8].body),i.$set(a),s&10&&ne(t,"active",e[1]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function m6(n){var $t;let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y=n[0].name+"",S,C,x,M,A,O,D,E,P,I,R,G=[],U=new Map,z,K,Y=[],W=new Map,te,ce,ve,oe,J,$e,ee,_e=[],fe=new Map,ie,ye,Ne,Pe,ze,se=[],re=new Map,ke,He,qe=[],Je=new Map,be,Oe=n[5]&&Eh(),Z=n[4];const ae=me=>me[16].lang;for(let me=0;me<Z.length;me+=1){let Ce=Th(n,Z,me),Ye=ae(Ce);U.set(Ye,G[me]=Ph(Ye,Ce))}let Ve=n[4];const yt=me=>me[16].lang;for(let me=0;me<Ve.length;me+=1){let Ce=Oh(n,Ve,me),Ye=yt(Ce);W.set(Ye,Y[me]=Fh(Ye,Ce))}let it=($t=n[0])==null?void 0:$t.schema;const bt=me=>me[13].name;for(let me=0;me<it.length;me+=1){let Ce=Dh(n,it,me),Ye=bt(Ce);fe.set(Ye,_e[me]=Lh(Ye,Ce))}let at=n[3];const vt=me=>me[8].code;for(let me=0;me<at.length;me+=1){let Ce=Ah(n,at,me),Ye=vt(Ce);re.set(Ye,se[me]=Ih(Ye,Ce))}let qt=n[3];const Mt=me=>me[8].code;for(let me=0;me<qt.length;me+=1){let Ce=$h(n,qt,me),Ye=Mt(Ce);Je.set(Ye,qe[me]=Rh(Ye,Ce))}return{c(){e=g("div"),t=g("strong"),t.textContent="POST",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records"),u=$(),Oe&&Oe.c(),d=$(),h=g("div"),b=g("p"),v=j("Create a new "),_=g("strong"),S=j(y),C=j(" record."),x=$(),M=g("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||
|
<code>multipart/form-data</code>.`,A=$(),O=g("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",D=$(),E=g("div"),E.textContent="Client SDKs example",P=$(),I=g("div"),R=g("div");for(let me=0;me<G.length;me+=1)G[me].c();z=$(),K=g("div");for(let me=0;me<Y.length;me+=1)Y[me].c();te=$(),ce=g("div"),ce.textContent="Body Parameters",ve=$(),oe=g("table"),J=g("thead"),J.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="50%">Description</th></tr>`,$e=$(),ee=g("tbody");for(let me=0;me<_e.length;me+=1)_e[me].c();ie=$(),ye=g("div"),ye.textContent="Responses",Ne=$(),Pe=g("div"),ze=g("div");for(let me=0;me<se.length;me+=1)se[me].c();ke=$(),He=g("div");for(let me=0;me<qe.length;me+=1)qe[me].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(E,"class","section-title"),p(R,"class","tabs-header compact left"),p(K,"class","tabs-content"),p(I,"class","tabs m-b-lg"),p(ce,"class","section-title"),p(oe,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(ze,"class","tabs-header compact left"),p(He,"class","tabs-content"),p(Pe,"class","tabs")},m(me,Ce){w(me,e,Ce),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(e,u),Oe&&Oe.m(e,null),w(me,d,Ce),w(me,h,Ce),m(h,b),m(b,v),m(b,_),m(_,S),m(b,C),m(h,x),m(h,M),m(h,A),m(h,O),w(me,D,Ce),w(me,E,Ce),w(me,P,Ce),w(me,I,Ce),m(I,R);for(let Ye=0;Ye<G.length;Ye+=1)G[Ye].m(R,null);m(I,z),m(I,K);for(let Ye=0;Ye<Y.length;Ye+=1)Y[Ye].m(K,null);w(me,te,Ce),w(me,ce,Ce),w(me,ve,Ce),w(me,oe,Ce),m(oe,J),m(oe,$e),m(oe,ee);for(let Ye=0;Ye<_e.length;Ye+=1)_e[Ye].m(ee,null);w(me,ie,Ce),w(me,ye,Ce),w(me,Ne,Ce),w(me,Pe,Ce),m(Pe,ze);for(let Ye=0;Ye<se.length;Ye+=1)se[Ye].m(ze,null);m(Pe,ke),m(Pe,He);for(let Ye=0;Ye<qe.length;Ye+=1)qe[Ye].m(He,null);be=!0},p(me,[Ce]){var Ye;(!be||Ce&1)&&a!==(a=me[0].name+"")&&ge(f,a),me[5]?Oe||(Oe=Eh(),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null),(!be||Ce&1)&&y!==(y=me[0].name+"")&&ge(S,y),Ce&20&&(Z=me[4],G=st(G,Ce,ae,1,me,Z,U,R,an,Ph,null,Th)),Ce&20&&(Ve=me[4],Ae(),Y=st(Y,Ce,yt,1,me,Ve,W,K,Pt,Fh,null,Oh),De()),Ce&1&&(it=(Ye=me[0])==null?void 0:Ye.schema,_e=st(_e,Ce,bt,1,me,it,fe,ee,an,Lh,null,Dh)),Ce&10&&(at=me[3],se=st(se,Ce,vt,1,me,at,re,ze,an,Ih,null,Ah)),Ce&10&&(qt=me[3],Ae(),qe=st(qe,Ce,Mt,1,me,qt,Je,He,Pt,Rh,null,$h),De())},i(me){if(!be){for(let Ce=0;Ce<Ve.length;Ce+=1)T(Y[Ce]);for(let Ce=0;Ce<qt.length;Ce+=1)T(qe[Ce]);be=!0}},o(me){for(let Ce=0;Ce<Y.length;Ce+=1)F(Y[Ce]);for(let Ce=0;Ce<qe.length;Ce+=1)F(qe[Ce]);be=!1},d(me){me&&k(e),Oe&&Oe.d(),me&&k(d),me&&k(h),me&&k(D),me&&k(E),me&&k(P),me&&k(I);for(let Ce=0;Ce<G.length;Ce+=1)G[Ce].d();for(let Ce=0;Ce<Y.length;Ce+=1)Y[Ce].d();me&&k(te),me&&k(ce),me&&k(ve),me&&k(oe);for(let Ce=0;Ce<_e.length;Ce+=1)_e[Ce].d();me&&k(ie),me&&k(ye),me&&k(Ne),me&&k(Pe);for(let Ce=0;Ce<se.length;Ce+=1)se[Ce].d();for(let Ce=0;Ce<qe.length;Ce+=1)qe[Ce].d()}}}function b6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(2,l=u.lang),c=u=>t(1,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{var u,d;n.$$.dirty&1&&t(5,i=(o==null?void 0:o.createRule)===null),n.$$.dirty&1&&t(3,s=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)},{code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Failed to create record.",
|
||
|
"data": {
|
||
|
"${(d=(u=o==null?void 0:o.schema)==null?void 0:u[0])==null?void 0:d.name}": {
|
||
|
"code": "validation_required",
|
||
|
"message": "Missing required value."
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`},{code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "You are not allowed to perform this request.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase("${Se.baseUrl}");
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
client.Records.create("${o==null?void 0:o.name}", data)
|
||
|
.then(function (record) {
|
||
|
// success...
|
||
|
}).catch(function (error) {
|
||
|
// error...
|
||
|
});
|
||
|
`}])},[o,r,l,s,a,i,f,c]}class g6 extends Ie{constructor(e){super(),Le(this,e,b6,m6,Ee,{collection:0})}}function Nh(n,e,t){const i=n.slice();return i[8]=e[t],i}function jh(n,e,t){const i=n.slice();return i[8]=e[t],i}function zh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[16]=e[t],i}function qh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Vh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bh(n,e){let t,i=e[16].lang+"",o,r,l,s;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[16].lang+"")&&ge(o,i),c&20&&ne(t,"active",e[2]===e[16].lang)},d(f){f&&k(t),l=!1,s()}}}function Uh(n,e){let t,i,o,r;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[16].code),i.$set(a),s&20&&ne(t,"active",e[2]===e[16].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function _6(n){let e;return{c(){e=g("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function v6(n){let e;return{c(){e=g("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function y6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("User "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function k6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("Relation record "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function w6(n){let e,t,i,o,r;return{c(){e=j("FormData object."),t=g("br"),i=j(`
|
||
|
Set to `),o=g("code"),o.textContent="null",r=j(" to delete already uploaded file(s).")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),w(l,o,s),w(l,r,s)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),l&&k(o),l&&k(r)}}}function S6(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function C6(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function x6(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function M6(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function $6(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Wh(n,e){let t,i,o,r,l,s=e[13].name+"",a,f,c,u,d=B.getFieldValueType(e[13])+"",h,b,v,_;function y(O,D){return O[13].required?v6:_6}let S=y(e),C=S(e);function x(O,D){if(O[13].type==="text")return $6;if(O[13].type==="number")return M6;if(O[13].type==="json")return x6;if(O[13].type==="email")return C6;if(O[13].type==="url")return S6;if(O[13].type==="file")return w6;if(O[13].type==="relation")return k6;if(O[13].type==="user")return y6}let M=x(e),A=M&&M(e);return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),C.c(),r=$(),l=g("span"),a=j(s),f=$(),c=g("td"),u=g("span"),h=j(d),b=$(),v=g("td"),A&&A.c(),_=$(),p(o,"class","inline-flex"),p(u,"class","label"),this.first=t},m(O,D){w(O,t,D),m(t,i),m(i,o),C.m(o,null),m(o,r),m(o,l),m(l,a),m(t,f),m(t,c),m(c,u),m(u,h),m(t,b),m(t,v),A&&A.m(v,null),m(t,_)},p(O,D){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(o,r))),D&1&&s!==(s=e[13].name+"")&&ge(a,s),D&1&&d!==(d=B.getFieldValueType(e[13])+"")&&ge(h,d),M===(M=x(e))&&A?A.p(e,D):(A&&A.d(1),A=M&&M(e),A&&(A.c(),A.m(v,null)))},d(O){O&&k(t),C.d(),A&&A.d()}}}function Yh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&8&&i!==(i=e[8].code+"")&&ge(o,i),c&10&&ne(t,"active",e[1]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Gh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&8&&(a.content=e[8].body),i.$set(a),s&10&&ne(t,"active",e[1]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function A6(n){var cn;let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P,I,R,G,U=[],z=new Map,K,Y,W=[],te=new Map,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe=[],ze=new Map,se,re,ke,He,qe,Je=[],be=new Map,Oe,Z,ae=[],Ve=new Map,yt,it=n[5]&&Vh(),bt=n[4];const at=ue=>ue[16].lang;for(let ue=0;ue<bt.length;ue+=1){let we=qh(n,bt,ue),Ze=at(we);z.set(Ze,U[ue]=Bh(Ze,we))}let vt=n[4];const qt=ue=>ue[16].lang;for(let ue=0;ue<vt.length;ue+=1){let we=Hh(n,vt,ue),Ze=qt(we);te.set(Ze,W[ue]=Uh(Ze,we))}let Mt=(cn=n[0])==null?void 0:cn.schema;const $t=ue=>ue[13].name;for(let ue=0;ue<Mt.length;ue+=1){let we=zh(n,Mt,ue),Ze=$t(we);ze.set(Ze,Pe[ue]=Wh(Ze,we))}let me=n[3];const Ce=ue=>ue[8].code;for(let ue=0;ue<me.length;ue+=1){let we=jh(n,me,ue),Ze=Ce(we);be.set(Ze,Je[ue]=Yh(Ze,we))}let Ye=n[3];const ot=ue=>ue[8].code;for(let ue=0;ue<Ye.length;ue+=1){let we=Nh(n,Ye,ue),Ze=ot(we);Ve.set(Ze,ae[ue]=Gh(Ze,we))}return{c(){e=g("div"),t=g("strong"),t.textContent="PATCH",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),it&&it.c(),h=$(),b=g("div"),v=g("p"),_=j("Update a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("p"),A.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||
|
<code>multipart/form-data</code>.`,O=$(),D=g("p"),D.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=$(),P=g("div"),P.textContent="Client SDKs example",I=$(),R=g("div"),G=g("div");for(let ue=0;ue<U.length;ue+=1)U[ue].c();K=$(),Y=g("div");for(let ue=0;ue<W.length;ue+=1)W[ue].c();ce=$(),ve=g("div"),ve.textContent="Path parameters",oe=$(),J=g("table"),J.innerHTML=`<thead><tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr></thead>
|
||
|
<tbody><tr><td>id</td>
|
||
|
<td><span class="label">String</span></td>
|
||
|
<td>ID of the record to update.</td></tr></tbody>`,$e=$(),ee=g("div"),ee.textContent="Body Parameters",_e=$(),fe=g("table"),ie=g("thead"),ie.innerHTML=`<tr><th>Param</th>
|
||
|
<th width="60%">Type</th>
|
||
|
<th width="50%">Description</th></tr>`,ye=$(),Ne=g("tbody");for(let ue=0;ue<Pe.length;ue+=1)Pe[ue].c();se=$(),re=g("div"),re.textContent="Responses",ke=$(),He=g("div"),qe=g("div");for(let ue=0;ue<Je.length;ue+=1)Je[ue].c();Oe=$(),Z=g("div");for(let ue=0;ue<ae.length;ue+=1)ae[ue].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-warning"),p(b,"class","content m-b-base"),p(P,"class","section-title"),p(G,"class","tabs-header compact left"),p(Y,"class","tabs-content"),p(R,"class","tabs m-b-lg"),p(ve,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(fe,"class","table-compact table-border m-b-lg"),p(re,"class","section-title"),p(qe,"class","tabs-header compact left"),p(Z,"class","tabs-content"),p(He,"class","tabs")},m(ue,we){w(ue,e,we),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),it&&it.m(e,null),w(ue,h,we),w(ue,b,we),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),m(b,M),m(b,A),m(b,O),m(b,D),w(ue,E,we),w(ue,P,we),w(ue,I,we),w(ue,R,we),m(R,G);for(let Ze=0;Ze<U.length;Ze+=1)U[Ze].m(G,null);m(R,K),m(R,Y);for(let Ze=0;Ze<W.length;Ze+=1)W[Ze].m(Y,null);w(ue,ce,we),w(ue,ve,we),w(ue,oe,we),w(ue,J,we),w(ue,$e,we),w(ue,ee,we),w(ue,_e,we),w(ue,fe,we),m(fe,ie),m(fe,ye),m(fe,Ne);for(let Ze=0;Ze<Pe.length;Ze+=1)Pe[Ze].m(Ne,null);w(ue,se,we),w(ue,re,we),w(ue,ke,we),w(ue,He,we),m(He,qe);for(let Ze=0;Ze<Je.length;Ze+=1)Je[Ze].m(qe,null);m(He,Oe),m(He,Z);for(let Ze=0;Ze<ae.length;Ze+=1)ae[Ze].m(Z,null);yt=!0},p(ue,[we]){var Ze;(!yt||we&1)&&a!==(a=ue[0].name+"")&&ge(f,a),ue[5]?it||(it=Vh(),it.c(),it.m(e,null)):it&&(it.d(1),it=null),(!yt||we&1)&&S!==(S=ue[0].name+"")&&ge(C,S),we&20&&(bt=ue[4],U=st(U,we,at,1,ue,bt,z,G,an,Bh,null,qh)),we&20&&(vt=ue[4],Ae(),W=st(W,we,qt,1,ue,vt,te,Y,Pt,Uh,null,Hh),De()),we&1&&(Mt=(Ze=ue[0])==null?void 0:Ze.schema,Pe=st(Pe,we,$t,1,ue,Mt,ze,Ne,an,Wh,null,zh)),we&10&&(me=ue[3],Je=st(Je,we,Ce,1,ue,me,be,qe,an,Yh,null,jh)),we&10&&(Ye=ue[3],Ae(),ae=st(ae,we,ot,1,ue,Ye,Ve,Z,Pt,Gh,null,Nh),De())},i(ue){if(!yt){for(let we=0;we<vt.length;we+=1)T(W[we]);for(let we=0;we<Ye.length;we+=1)T(ae[we]);yt=!0}},o(ue){for(let we=0;we<W.length;we+=1)F(W[we]);for(let we=0;we<ae.length;we+=1)F(ae[we]);yt=!1},d(ue){ue&&k(e),it&&it.d(),ue&&k(h),ue&&k(b),ue&&k(E),ue&&k(P),ue&&k(I),ue&&k(R);for(let we=0;we<U.length;we+=1)U[we].d();for(let we=0;we<W.length;we+=1)W[we].d();ue&&k(ce),ue&&k(ve),ue&&k(oe),ue&&k(J),ue&&k($e),ue&&k(ee),ue&&k(_e),ue&&k(fe);for(let we=0;we<Pe.length;we+=1)Pe[we].d();ue&&k(se),ue&&k(re),ue&&k(ke),ue&&k(He);for(let we=0;we<Je.length;we+=1)Je[we].d();for(let we=0;we<ae.length;we+=1)ae[we].d()}}}function D6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(2,l=u.lang),c=u=>t(1,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{var u,d;n.$$.dirty&1&&t(5,i=(o==null?void 0:o.updateRule)===null),n.$$.dirty&1&&t(3,s=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)},{code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Failed to update record.",
|
||
|
"data": {
|
||
|
"${(d=(u=o==null?void 0:o.schema)==null?void 0:u[0])==null?void 0:d.name}": {
|
||
|
"code": "validation_required",
|
||
|
"message": "Missing required value."
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`},{code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "You are not allowed to perform this request.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`},{code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase("${Se.baseUrl}");
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
client.Records.update("${o==null?void 0:o.name}", "RECORD_ID", data)
|
||
|
.then(function (record) {
|
||
|
// success...
|
||
|
}).catch(function (error) {
|
||
|
// error...
|
||
|
});
|
||
|
`}])},[o,r,l,s,a,i,f,c]}class O6 extends Ie{constructor(e){super(),Le(this,e,D6,A6,Ee,{collection:0})}}function Kh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Qh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function em(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function tm(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function nm(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function im(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function T6(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P=[],I=new Map,R,G,U=[],z=new Map,K,Y,W,te,ce,ve,oe,J,$e,ee=[],_e=new Map,fe,ie,ye=[],Ne=new Map,Pe,ze=n[1]&&Qh(),se=n[4];const re=Z=>Z[13].lang;for(let Z=0;Z<se.length;Z+=1){let ae=Xh(n,se,Z),Ve=re(ae);I.set(Ve,P[Z]=em(Ve,ae))}let ke=n[4];const He=Z=>Z[13].lang;for(let Z=0;Z<ke.length;Z+=1){let ae=Zh(n,ke,Z),Ve=He(ae);z.set(Ve,U[Z]=tm(Ve,ae))}let qe=n[5];const Je=Z=>Z[8].code;for(let Z=0;Z<qe.length;Z+=1){let ae=Jh(n,qe,Z),Ve=Je(ae);_e.set(Ve,ee[Z]=nm(Ve,ae))}let be=n[5];const Oe=Z=>Z[8].code;for(let Z=0;Z<be.length;Z+=1){let ae=Kh(n,be,Z),Ve=Oe(ae);Ne.set(Ve,ye[Z]=im(Ve,ae))}return{c(){e=g("div"),t=g("strong"),t.textContent="DELETE",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),ze&&ze.c(),h=$(),b=g("div"),v=g("p"),_=j("Delete a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("div"),A.textContent="Client SDKs example",O=$(),D=g("div"),E=g("div");for(let Z=0;Z<P.length;Z+=1)P[Z].c();R=$(),G=g("div");for(let Z=0;Z<U.length;Z+=1)U[Z].c();K=$(),Y=g("div"),Y.textContent="Path parameters",W=$(),te=g("table"),te.innerHTML=`<thead><tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr></thead>
|
||
|
<tbody><tr><td>id</td>
|
||
|
<td><span class="label">String</span></td>
|
||
|
<td>ID of the record to delete.</td></tr></tbody>`,ce=$(),ve=g("div"),ve.textContent="Responses",oe=$(),J=g("div"),$e=g("div");for(let Z=0;Z<ee.length;Z+=1)ee[Z].c();fe=$(),ie=g("div");for(let Z=0;Z<ye.length;Z+=1)ye[Z].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-danger"),p(b,"class","content m-b-base"),p(A,"class","section-title"),p(E,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(Y,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p($e,"class","tabs-header compact left"),p(ie,"class","tabs-content"),p(J,"class","tabs")},m(Z,ae){w(Z,e,ae),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),ze&&ze.m(e,null),w(Z,h,ae),w(Z,b,ae),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),w(Z,M,ae),w(Z,A,ae),w(Z,O,ae),w(Z,D,ae),m(D,E);for(let Ve=0;Ve<P.length;Ve+=1)P[Ve].m(E,null);m(D,R),m(D,G);for(let Ve=0;Ve<U.length;Ve+=1)U[Ve].m(G,null);w(Z,K,ae),w(Z,Y,ae),w(Z,W,ae),w(Z,te,ae),w(Z,ce,ae),w(Z,ve,ae),w(Z,oe,ae),w(Z,J,ae),m(J,$e);for(let Ve=0;Ve<ee.length;Ve+=1)ee[Ve].m($e,null);m(J,fe),m(J,ie);for(let Ve=0;Ve<ye.length;Ve+=1)ye[Ve].m(ie,null);Pe=!0},p(Z,[ae]){(!Pe||ae&1)&&a!==(a=Z[0].name+"")&&ge(f,a),Z[1]?ze||(ze=Qh(),ze.c(),ze.m(e,null)):ze&&(ze.d(1),ze=null),(!Pe||ae&1)&&S!==(S=Z[0].name+"")&&ge(C,S),ae&24&&(se=Z[4],P=st(P,ae,re,1,Z,se,I,E,an,em,null,Xh)),ae&24&&(ke=Z[4],Ae(),U=st(U,ae,He,1,Z,ke,z,G,Pt,tm,null,Zh),De()),ae&36&&(qe=Z[5],ee=st(ee,ae,Je,1,Z,qe,_e,$e,an,nm,null,Jh)),ae&36&&(be=Z[5],Ae(),ye=st(ye,ae,Oe,1,Z,be,Ne,ie,Pt,im,null,Kh),De())},i(Z){if(!Pe){for(let ae=0;ae<ke.length;ae+=1)T(U[ae]);for(let ae=0;ae<be.length;ae+=1)T(ye[ae]);Pe=!0}},o(Z){for(let ae=0;ae<U.length;ae+=1)F(U[ae]);for(let ae=0;ae<ye.length;ae+=1)F(ye[ae]);Pe=!1},d(Z){Z&&k(e),ze&&ze.d(),Z&&k(h),Z&&k(b),Z&&k(M),Z&&k(A),Z&&k(O),Z&&k(D);for(let ae=0;ae<P.length;ae+=1)P[ae].d();for(let ae=0;ae<U.length;ae+=1)U[ae].d();Z&&k(K),Z&&k(Y),Z&&k(W),Z&&k(te),Z&&k(ce),Z&&k(ve),Z&&k(oe),Z&&k(J);for(let ae=0;ae<ee.length;ae+=1)ee[ae].d();for(let ae=0;ae<ye.length;ae+=1)ye[ae].d()}}}function E6(n,e,t){let i,{collection:o=new En}=e,r=204,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.deleteRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:204,body:`
|
||
|
null
|
||
|
`}),s.push({code:400,body:`
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),i&&s.push({code:403,body:`
|
||
|
{
|
||
|
"code": 403,
|
||
|
"message": "Only admins can access this action.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`}),s.push({code:404,body:`
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "The requested resource wasn't found.",
|
||
|
"data": {}
|
||
|
}
|
||
|
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase("${Se.baseUrl}");
|
||
|
|
||
|
client.Records.delete("${o==null?void 0:o.name}", "RECORD_ID")
|
||
|
.then(function () {
|
||
|
// success...
|
||
|
}).catch(function (error) {
|
||
|
// error...
|
||
|
});
|
||
|
`}])},[o,i,r,l,a,s,f,c]}class P6 extends Ie{constructor(e){super(),Le(this,e,E6,T6,Ee,{collection:0})}}function om(n,e,t){const i=n.slice();return i[4]=e[t],i}function rm(n,e,t){const i=n.slice();return i[4]=e[t],i}function lm(n,e){let t,i=e[4].lang+"",o,r,l,s;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&4&&i!==(i=e[4].lang+"")&&ge(o,i),c&6&&ne(t,"active",e[1]===e[4].lang)},d(f){f&&k(t),l=!1,s()}}}function sm(n,e){let t,i,o,r;return i=new tn({props:{content:e[4].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&4&&(a.content=e[4].code),i.$set(a),s&6&&ne(t,"active",e[1]===e[4].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function F6(n){let e,t,i,o,r,l,s,a,f=[],c=new Map,u,d,h=[],b=new Map,v,_,y,S,C,x=n[2];const M=D=>D[4].lang;for(let D=0;D<x.length;D+=1){let E=rm(n,x,D),P=M(E);c.set(P,f[D]=lm(P,E))}let A=n[2];const O=D=>D[4].lang;for(let D=0;D<A.length;D+=1){let E=om(n,A,D),P=O(E);b.set(P,h[D]=sm(P,E))}return S=new tn({props:{content:JSON.stringify({action:"create",record:B.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=g("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||
|
<div class="content"><p>/api/realtime</p></div>`,t=$(),i=g("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||
|
<p>Events are send for <strong>create</strong>, <strong>update</strong>
|
||
|
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||
|
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||
|
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||
|
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||
|
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||
|
the event message.</p>
|
||
|
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||
|
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||
|
the event message.</p></div></div>`,o=$(),r=g("div"),r.textContent="Client SDKs example",l=$(),s=g("div"),a=g("div");for(let D=0;D<f.length;D+=1)f[D].c();u=$(),d=g("div");for(let D=0;D<h.length;D+=1)h[D].c();v=$(),_=g("div"),_.textContent="Event data format",y=$(),V(S.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(r,"class","section-title"),p(a,"class","tabs-header compact left"),p(d,"class","tabs-content"),p(s,"class","tabs m-b-base"),p(_,"class","section-title")},m(D,E){w(D,e,E),w(D,t,E),w(D,i,E),w(D,o,E),w(D,r,E),w(D,l,E),w(D,s,E),m(s,a);for(let P=0;P<f.length;P+=1)f[P].m(a,null);m(s,u),m(s,d);for(let P=0;P<h.length;P+=1)h[P].m(d,null);w(D,v,E),w(D,_,E),w(D,y,E),H(S,D,E),C=!0},p(D,[E]){E&6&&(x=D[2],f=st(f,E,M,1,D,x,c,a,an,lm,null,rm)),E&6&&(A=D[2],Ae(),h=st(h,E,O,1,D,A,b,d,Pt,sm,null,om),De());const P={};E&1&&(P.content=JSON.stringify({action:"create",record:B.dummyCollectionRecord(D[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),S.$set(P)},i(D){if(!C){for(let E=0;E<A.length;E+=1)T(h[E]);T(S.$$.fragment,D),C=!0}},o(D){for(let E=0;E<h.length;E+=1)F(h[E]);F(S.$$.fragment,D),C=!1},d(D){D&&k(e),D&&k(t),D&&k(i),D&&k(o),D&&k(r),D&&k(l),D&&k(s);for(let E=0;E<f.length;E+=1)f[E].d();for(let E=0;E<h.length;E+=1)h[E].d();D&&k(v),D&&k(_),D&&k(y),q(S,D)}}}function L6(n,e,t){let{collection:i=new En}=e,o="JavaScript",r=[];const l=s=>t(1,o=s.lang);return n.$$set=s=>{"collection"in s&&t(0,i=s.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,r=[{lang:"JavaScript",code:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase("${Se.baseUrl}");
|
||
|
|
||
|
// (Optionally) authenticate
|
||
|
client.Users.authViaEmail("test@example.com", "123456");
|
||
|
|
||
|
// Subscribe to changes in any record from the collection
|
||
|
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
|
||
|
console.log(e.data);
|
||
|
});
|
||
|
|
||
|
// Subscribe to changes in a single record
|
||
|
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
|
||
|
console.log(e.data);
|
||
|
});
|
||
|
|
||
|
// Unsubscribe
|
||
|
client.Realtime.unsubscribe() // remove all subscriptions
|
||
|
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
|
||
|
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
|
||
|
`}])},[i,o,r,l]}class I6 extends Ie{constructor(e){super(),Le(this,e,L6,F6,Ee,{collection:0})}}function am(n,e,t){const i=n.slice();return i[14]=e[t],i}function fm(n,e,t){const i=n.slice();return i[14]=e[t],i}function cm(n){let e,t,i,o;var r=n[14].component;function l(s){return{props:{collection:s[3]}}}return r&&(t=new r(l(n))),{c(){e=g("div"),t&&V(t.$$.fragment),i=$(),p(e,"class","tab-item active")},m(s,a){w(s,e,a),t&&H(t,e,null),m(e,i),o=!0},p(s,a){const f={};if(a&8&&(f.collection=s[3]),r!==(r=s[14].component)){if(t){Ae();const c=t;F(c.$$.fragment,1,0,()=>{q(c,1)}),De()}r?(t=new r(l(s)),V(t.$$.fragment),T(t.$$.fragment,1),H(t,e,i)):t=null}else r&&t.$set(f)},i(s){o||(t&&T(t.$$.fragment,s),o=!0)},o(s){t&&F(t.$$.fragment,s),o=!1},d(s){s&&k(e),t&&q(t)}}}function um(n,e){let t,i,o,r=e[4]===e[14].id&&cm(e);return{key:n,first:null,c(){t=lt(),r&&r.c(),i=lt(),this.first=t},m(l,s){w(l,t,s),r&&r.m(l,s),w(l,i,s),o=!0},p(l,s){e=l,e[4]===e[14].id?r?(r.p(e,s),s&16&&T(r,1)):(r=cm(e),r.c(),T(r,1),r.m(i.parentNode,i)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){o||(T(r),o=!0)},o(l){F(r),o=!1},d(l){l&&k(t),r&&r.d(l),l&&k(i)}}}function R6(n){let e,t=[],i=new Map,o,r=n[5];const l=s=>s[14].id;for(let s=0;s<r.length;s+=1){let a=am(n,r,s),f=l(a);i.set(f,t[s]=um(f,a))}return{c(){e=g("div");for(let s=0;s<t.length;s+=1)t[s].c();p(e,"class","tabs-content")},m(s,a){w(s,e,a);for(let f=0;f<t.length;f+=1)t[f].m(e,null);o=!0},p(s,a){a&56&&(r=s[5],Ae(),t=st(t,a,l,1,s,r,i,e,Pt,um,null,am),De())},i(s){if(!o){for(let a=0;a<r.length;a+=1)T(t[a]);o=!0}},o(s){for(let a=0;a<t.length;a+=1)F(t[a]);o=!1},d(s){s&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function dm(n,e){let t,i,o=e[14].label+"",r,l,s,a;function f(){return e[9](e[14])}function c(...u){return e[10](e[14],...u)}return{key:n,first:null,c(){t=g("button"),i=g("span"),r=j(o),l=$(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ne(t,"active",e[4]===e[14].id),this.first=t},m(u,d){w(u,t,d),m(t,i),m(i,r),m(t,l),s||(a=[X(t,"click",f),X(t,"keydown",Vb(c))],s=!0)},p(u,d){e=u,d&48&&ne(t,"active",e[4]===e[14].id)},d(u){u&&k(t),s=!1,rt(a)}}}function N6(n){let e,t,i=n[3].name+"",o,r,l,s,a=[],f=new Map,c=n[5];const u=d=>d[14].id;for(let d=0;d<c.length;d+=1){let h=fm(n,c,d),b=u(h);f.set(b,a[d]=dm(b,h))}return{c(){e=g("h4"),t=g("strong"),o=j(i),r=j(" records API"),l=$(),s=g("div");for(let d=0;d<a.length;d+=1)a[d].c();p(s,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,o),m(e,r),w(d,l,h),w(d,s,h);for(let b=0;b<a.length;b+=1)a[b].m(s,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ge(o,i),h&114&&(c=d[5],a=st(a,h,u,1,d,c,f,s,an,dm,null,fm))},d(d){d&&k(e),d&&k(l),d&&k(s);for(let h=0;h<a.length;h+=1)a[h].d()}}}function j6(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[8]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function z6(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[j6],header:[N6],default:[R6]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&524312&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[11](null),q(e,o)}}}function H6(n,e,t){const i=[{id:"list",label:"List",component:t6},{id:"view",label:"View",component:o6},{id:"create",label:"Create",component:g6},{id:"update",label:"Update",component:O6},{id:"delete",label:"Delete",component:P6},{id:"realtime",label:"Realtime",component:I6}];let o,r=new En,l=i[0].id;function s(y){return t(3,r=y),f(i[0].id),o==null?void 0:o.show()}function a(){return o==null?void 0:o.hide()}function f(y){t(4,l=y)}function c(y,S){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),f(S))}const u=()=>a(),d=y=>f(y.id),h=(y,S)=>c(S,y.id);function b(y){he[y?"unshift":"push"](()=>{o=y,t(2,o)})}function v(y){ft.call(this,n,y)}function _(y){ft.call(this,n,y)}return[a,f,o,r,l,i,c,s,u,d,h,b,v,_]}class q6 extends Ie{constructor
|
||
|
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(o,"type","button"),p(o,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(s,a){w(s,e,a),m(e,t),n[18](t),m(e,i),m(e,o),r||(l=[X(t,"change",n[19]),X(o,"click",n[20])],r=!0)},p(s,a){a&32&&(t.multiple=s[5])},d(s){s&&k(e),n[18](null),r=!1,rt(l)}}}function zM(n){let e,t,i,o,r,l=n[3].name+"",s,a,f,c,u=[],d=new Map,h,b,v,_=n[4];const y=A=>A[28];for(let A=0;A<_.length;A+=1){let O=mm(n,_,A),D=y(O);d.set(D,u[A]=bm(D,O))}let S=n[0],C=[];for(let A=0;A<S.length;A+=1)C[A]=gm(hm(n,S,A));const x=A=>F(C[A],1,1,()=>{C[A]=null});let M=!n[9]&&_m(n);return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),c=g("div");for(let A=0;A<u.length;A+=1)u[A].c();h=$();for(let A=0;A<C.length;A+=1)C[A].c();b=$(),M&&M.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(r,"class","txt"),p(e,"for",a=n[24]),p(c,"class","files-list")},m(A,O){w(A,e,O),m(e,t),m(e,o),m(e,r),m(r,s),w(A,f,O),w(A,c,O);for(let D=0;D<u.length;D+=1)u[D].m(c,null);m(c,h);for(let D=0;D<C.length;D+=1)C[D].m(c,null);m(c,b),M&&M.m(c,null),n[21](c),v=!0},p(A,O){if((!v||O&8&&i!==(i=B.getFieldTypeIcon(A[3].type)))&&p(t,"class",i),(!v||O&8)&&l!==(l=A[3].name+"")&&ge(s,l),(!v||O&16777216&&a!==(a=A[24]))&&p(e,"for",a),O&3222&&(_=A[4],Ae(),u=st(u,O,y,1,A,_,d,c,Pt,bm,h,mm),De()),O&4097){S=A[0];let D;for(D=0;D<S.length;D+=1){const E=hm(A,S,D);C[D]?(C[D].p(E,O),T(C[D],1)):(C[D]=gm(E),C[D].c(),T(C[D],1),C[D].m(c,b))}for(Ae(),D=S.length;D<C.length;D+=1)x(D);De()}A[9]?M&&(M.d(1),M=null):M?M.p(A,O):(M=_m(A),M.c(),M.m(c,null))},i(A){if(!v){for(let O=0;O<_.length;O+=1)T(u[O]);for(let O=0;O<S.length;O+=1)T(C[O]);v=!0}},o(A){for(let O=0;O<u.length;O+=1)F(u[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)F(C[O]);v=!1},d(A){A&&k(e),A&&k(f),A&&k(c);for(let O=0;O<u.length;O+=1)u[O].d();qn(C,A),M&&M.d(),n[21](null)}}}function HM(n){let e,t,i,o;e=new je({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[zM,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}});let r={};return i=new PM({props:r}),n[22](i),{c(){V(e.$$.fragment),t=$(),V(i.$$.fragment)},m(l,s){H(e,l,s),w(l,t,s),H(i,l,s),o=!0},p(l,[s]){const a={};s&8&&(a.class="form-field form-field-file "+(l[3].required?"required":"")),s&8&&(a.name=l[3].name),s&1090520063&&(a.$$scope={dirty:s,ctx:l}),e.$set(a);const f={};i.$set(f)},i(l){o||(T(e.$$.fragment,l),T(i.$$.fragment,l),o=!0)},o(l){F(e.$$.fragment,l),F(i.$$.fragment,l),o=!1},d(l){q(e,l),l&&k(t),n[22](null),q(i,l)}}}function qM(n,e,t){let i,o,r,{record:l}=e,{value:s=null}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:f=[]}=e,{field:c=new kn}=e,u,d,h;function b(I){B.removeByValue(f,I),t(1,f)}function v(I){B.pushUnique(f,I),t(1,f)}function _(I){B.isEmpty(a[I])||a.splice(I,1),t(0,a)}function y(){h==null||h.dispatchEvent(new CustomEvent("change",{detail:{value:s,uploadedFiles:a,deletedFileIndexes:f},bubbles:!0}))}const S=I=>B.hasImageExtension(I)?d==null?void 0:d.show(Se.Records.getFileUrl(l,I)):!1,C=I=>b(I),x=I=>v(I),M=I=>_(I);function A(I){he[I?"unshift":"push"](()=>{u=I,t(6,u)})}const O=()=>{for(let I of u.files)a.push(I);t(0,a),t(6,u.value=null,u)},D=()=>u==null?void 0:u.click();function E(I){he[I?"unshift":"push"](()=>{h=I,t(8,h)})}function P(I){he[I?"unshift":"push"](()=>{d=I,t(7,d)})}return n.$$set=I=>{"record"in I&&t(2,l=I.record),"value"in I&&t(13,s=I.value),"uploadedFiles"in I&&t(0,a=I.uploadedFiles),"deletedFileIndexes"in I&&t(1,f=I.deletedFileIndexes),"field"in I&&t(3,c=I.field)},n.$$.update=()=>{var I,R;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(f)||t(1,f=B.toArray(f))),n.$$.dirty&8&&t(5,i=((I=c.options)==null?void 0:I.maxSelect)>1),n.$$.dirty&8224&&(typeof s=="undefined"||s===null)&&t(13,s=i?[]:null),n.$$.dirty&8192&&t(4,o=B.toArray(s)),n.$$.dirty&27&&t(9,r=(o.length||a.length)&&((R=c.options)==null?void 0:R.maxSelect)<=o.length+a.length-f.length),n.$$.dirty&3&&(a!==-1||f!==-1)&&y()},[a,f,l,c,o,i,u,d,h,r,b,v,_,s,S,C,x,M,A
|
||
|
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function d$(n){let e,t,i;function o(l){n[31](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new c$({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function p$(n){let e,t,i;function o(l){n[30](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new e$({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function h$(n){let e,t,i,o,r;function l(c){n[27](c,n[40])}function s(c){n[28](c,n[40])}function a(c){n[29](c,n[40])}let f={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(f.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(f.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(f.deletedFileIndexes=n[4][n[40].name]),e=new VM({props:f}),he.push(()=>Fe(e,"value",l)),he.push(()=>Fe(e,"uploadedFiles",s)),he.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(c,u){H(e,c,u),r=!0},p(c,u){n=c;const d={};u[0]&1&&(d.field=n[40]),u[0]&4&&(d.record=n[2]),!t&&u[0]&5&&(t=!0,d.value=n[2][n[40].name],Re(()=>t=!1)),!i&&u[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],Re(()=>i=!1)),!o&&u[0]&17&&(o=!0,d.deletedFileIndexes=n[4][n[40].name],Re(()=>o=!1)),e.$set(d)},i(c){r||(T(e.$$.fragment,c),r=!0)},o(c){F(e.$$.fragment,c),r=!1},d(c){q(e,c)}}}function m$(n){let e,t,i;function o(l){n[26](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new SM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function b$(n){let e,t,i;function o(l){n[25](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new vM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function g$(n){let e,t,i;function o(l){n[24](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new mM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function _$(n){let e,t,i;function o(l){n[23](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new uM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function v$(n){let e,t,i;function o(l){n[22](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new sM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function y$(n){let e,t,i;function o(l){n[21](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new iM({props:r}),he.push(()=>Fe(e,"value",
|
||
|
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function x$(n){let e,t=n[2].isNew?"New":"Edit",i,o,r=n[0].name+"",l,s,a,f,c,u=!n[2].isNew&&n[9]&&Am(n);return{c(){e=g("h4"),i=j(t),o=$(),l=j(r),s=j(" record"),a=$(),u&&u.c(),f=lt()},m(d,h){w(d,e,h),m(e,i),m(e,o),m(e,l),m(e,s),w(d,a,h),u&&u.m(d,h),w(d,f,h),c=!0},p(d,h){(!c||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ge(i,t),(!c||h[0]&1)&&r!==(r=d[0].name+"")&&ge(l,r),!d[2].isNew&&d[9]?u?(u.p(d,h),h[0]&516&&T(u,1)):(u=Am(d),u.c(),T(u,1),u.m(f.parentNode,f)):u&&(Ae(),F(u,1,1,()=>{u=null}),De())},i(d){c||(T(u),c=!0)},o(d){F(u),c=!1},d(d){d&&k(e),d&&k(a),u&&u.d(d),d&&k(f)}}}function M$(n){let e,t,i,o,r,l=n[2].isNew?"Create":"Save changes",s,a,f,c;return{c(){e=g("button"),t=g("span"),t.textContent="Cancel",i=$(),o=g("button"),r=g("span"),s=j(l),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[11]),p(o,"class","btn btn-expanded"),o.disabled=a=!n[10]||n[7],ne(o,"btn-loading",n[7])},m(u,d){w(u,e,d),m(e,t),w(u,i,d),w(u,o,d),m(o,r),m(r,s),f||(c=X(e,"click",n[17]),f=!0)},p(u,d){d[0]&128&&(e.disabled=u[7]),d[0]&4&&l!==(l=u[2].isNew?"Create":"Save changes")&&ge(s,l),d[0]&1152&&a!==(a=!u[10]||u[7])&&(o.disabled=a),d[0]&128&&ne(o,"btn-loading",u[7])},d(u){u&&k(e),u&&k(i),u&&k(o),f=!1,c()}}}function $$(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[M$],header:[x$],default:[S$]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&288&&(l.beforeHide=o[32]),r[0]&1693|r[1]&8192&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[33](null),q(e,o)}}}function Dm(n){return JSON.stringify(n)}function A$(n,e,t){let i,o,r,l;const s=yn(),a="record_"+B.randomString(5);let{collection:f}=e,c,u=null,d=new Ql,h=!1,b=!1,v={},_={},y="";function S(fe){return x(fe),t(8,b=!0),c==null?void 0:c.show()}function C(){return c==null?void 0:c.hide()}function x(fe){Ui({}),u=fe||{},t(2,d=fe!=null&&fe.clone?fe.clone():new Ql),t(3,v={}),t(4,_={}),t(15,y=Dm(d))}function M(){if(h||!o)return;t(7,h=!0);const fe=O();let ie;d.isNew?ie=Se.Records.create(f==null?void 0:f.id,fe):ie=Se.Records.update(f==null?void 0:f.id,d.id,fe),ie.then(async ye=>{hn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,b=!1),C(),s("save",ye)}).catch(ye=>{Se.errorResponseHandler(ye)}).finally(()=>{t(7,h=!1)})}function A(){!(u!=null&&u.id)||xi("Do you really want to delete the selected record?",()=>Se.Records.delete(u["@collectionId"],u.id).then(()=>{C(),hn("Successfully deleted record."),s("delete",u)}).catch(fe=>{Se.errorResponseHandler(fe)}))}function O(){const fe=(d==null?void 0:d.export())||{},ie=new FormData,ye={};for(const Ne of(f==null?void 0:f.schema)||[])ye[Ne.name]=Ne;for(const Ne in fe)!ye[Ne]||(typeof fe[Ne]=="undefined"&&(fe[Ne]=null),B.addValueToFormData(ie,Ne,fe[Ne]));for(const Ne in v){const Pe=B.toArray(v[Ne]);for(const ze of Pe)ie.append(Ne,ze)}for(const Ne in _){const Pe=B.toArray(_[Ne]);for(const ze of Pe)ie.append(Ne+"."+ze,"")}return ie}const D=()=>C(),E=()=>A();function P(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function I(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function R(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function G(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function U(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function z(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function K(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function Y(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function W(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function te(fe,ie){n.$$.not_equal(v[ie.name],fe)&&(v[ie.name]=fe,t(3,
|
||
|
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Hm(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[28]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function qm(n,e){let t,i,o;return i=new L1({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l[0]&8&&(s.record=e[35]),l[0]&2048&&(s.field=e[38]),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function Vm(n,e){let t,i,o,r,l,s,a,f,c,u,d,h,b,v=[],_=new Map,y,S,C,x,M,A,O,D,E,P,I,R;function G(){return e[25](e[35])}h=new Ls({props:{id:e[35].id}});let U=e[11];const z=W=>W[38].name;for(let W=0;W<U.length;W+=1){let te=Rm(e,U,W),ce=z(te);_.set(ce,v[W]=qm(ce,te))}C=new Ci({props:{date:e[35].created}}),A=new Ci({props:{date:e[35].updated}});function K(){return e[26](e[35])}function Y(...W){return e[27](e[35],...W)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),r=g("input"),a=$(),f=g("label"),u=$(),d=g("td"),V(h.$$.fragment),b=$();for(let W=0;W<v.length;W+=1)v[W].c();y=$(),S=g("td"),V(C.$$.fragment),x=$(),M=g("td"),V(A.$$.fragment),O=$(),D=g("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',E=$(),p(r,"type","checkbox"),p(r,"id",l="checkbox_"+e[35].id),r.checked=s=e[5][e[35].id],p(f,"for",c="checkbox_"+e[35].id),p(o,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(W,te){w(W,t,te),m(t,i),m(i,o),m(o,r),m(o,a),m(o,f),m(t,u),m(t,d),H(h,d,null),m(t,b);for(let ce=0;ce<v.length;ce+=1)v[ce].m(t,null);m(t,y),m(t,S),H(C,S,null),m(t,x),m(t,M),H(A,M,null),m(t,O),m(t,D),m(t,E),P=!0,I||(R=[X(r,"change",G),X(o,"click",Vn(e[19])),X(t,"click",K),X(t,"keydown",Y)],I=!0)},p(W,te){e=W,(!P||te[0]&8&&l!==(l="checkbox_"+e[35].id))&&p(r,"id",l),(!P||te[0]&40&&s!==(s=e[5][e[35].id]))&&(r.checked=s),(!P||te[0]&8&&c!==(c="checkbox_"+e[35].id))&&p(f,"for",c);const ce={};te[0]&8&&(ce.id=e[35].id),h.$set(ce),te[0]&2056&&(U=e[11],Ae(),v=st(v,te,z,1,e,U,_,t,Pt,qm,y,Rm),De());const ve={};te[0]&8&&(ve.date=e[35].created),C.$set(ve);const oe={};te[0]&8&&(oe.date=e[35].updated),A.$set(oe)},i(W){if(!P){T(h.$$.fragment,W);for(let te=0;te<U.length;te+=1)T(v[te]);T(C.$$.fragment,W),T(A.$$.fragment,W),P=!0}},o(W){F(h.$$.fragment,W);for(let te=0;te<v.length;te+=1)F(v[te]);F(C.$$.fragment,W),F(A.$$.fragment,W),P=!1},d(W){W&&k(t),q(h);for(let te=0;te<v.length;te+=1)v[te].d();q(C),q(A),I=!1,rt(R)}}}function Bm(n){let e,t,i=n[3].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a[0]&8&&i!==(i=s[3].length+"")&&ge(o,i),a[0]&16&&ge(l,s[4])},d(s){s&&k(e)}}}function Um(n){let e,t,i,o,r=n[4]-n[3].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[8]),ne(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[29]),a=!0)},p(c,u){u[0]&24&&r!==(r=c[4]-c[3].length+"")&&ge(l,r),u[0]&256&&ne(t,"btn-loading",c[8]),u[0]&256&&ne(t,"btn-disabled",c[8])},d(c){c&&k(e),a=!1,f()}}}function Wm(n){let e,t,i,o,r,l,s=n[6]===1?"record":"records",a,f,c,u,d,h,b,v,_,y,S;return{c(){e=g("div"),t=g("div"),i=j("Selected "),o=g("strong"),r=j(n[6]),l=$(),a=j(s),f=$(),c=g("button"),c.innerHTML='<span class="txt">Reset</span>',u=$(),d=g("div"),h=$(),b=g("button"),b.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(c,"type","button"),p(c,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ne(c,"btn
|
||
|
<span class="txt">API Preview</span>`,_=$(),y=g("button"),y.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">New record</span>`,S=$(),V(C.$$.fragment),x=$(),V(M.$$.fragment),p(l,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(r,"class","breadcrumbs"),p(d,"type","button"),p(d,"class","btn btn-secondary btn-circle"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(b,"class","btns-group"),p(o,"class","page-header"),p(i,"class","page-wrapper")},m(U,z){H(e,U,z),w(U,t,z),w(U,i,z),m(i,o),m(o,r),m(r,l),m(r,s),m(r,a),m(a,c),m(o,u),m(o,d),m(o,h),m(o,b),m(b,v),m(b,_),m(b,y),m(i,S),H(C,i,null),m(i,x),H(M,i,null),D=!0,E||(P=[Xe(St.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(v,"click",n[13]),X(y,"click",n[14])],E=!0)},p(U,z){(!D||z&4)&&f!==(f=U[2].name+"")&&ge(c,f);const K={};z&1&&(K.value=U[0]),z&4&&(K.autocompleteCollection=U[2]),C.$set(K);const Y={};z&4&&(Y.collection=U[2]),!A&&z&1&&(A=!0,Y.filter=U[0],Re(()=>A=!1)),!O&&z&2&&(O=!0,Y.sort=U[1],Re(()=>O=!1)),M.$set(Y)},i(U){D||(T(e.$$.fragment,U),T(C.$$.fragment,U),T(M.$$.fragment,U),D=!0)},o(U){F(e.$$.fragment,U),F(C.$$.fragment,U),F(M.$$.fragment,U),D=!1},d(U){q(e,U),U&&k(t),U&&k(i),q(C),n[16](null),q(M),E=!1,rt(P)}}}function eA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("div"),t=g("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=$(),o=g("h1"),o.textContent="Create your first collection to add records!",r=$(),l=g("button"),l.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">Create new collection</span>`,p(t,"class","icon"),p(o,"class","m-b-10"),p(l,"type","button"),p(l,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,o),m(e,r),m(e,l),s||(a=X(l,"click",n[11]),s=!0)},p:le,i:le,o:le,d(f){f&&k(e),s=!1,a()}}}function tA(n){let e;return{c(){e=g("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
|
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function nA(n){let e,t,i,o,r,l,s,a,f;const c=[tA,eA,Q$],u=[];function d(_,y){return _[8]?0:_[7].length?2:1}e=d(n),t=u[e]=c[e](n);let h={};o=new hc({props:h}),n[20](o);let b={};l=new q6({props:b}),n[21](l);let v={collection:n[2]};return a=new F1({props:v}),n[22](a),a.$on("save",n[23]),a.$on("delete",n[24]),{c(){t.c(),i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment)},m(_,y){u[e].m(_,y),w(_,i,y),H(o,_,y),w(_,r,y),H(l,_,y),w(_,s,y),H(a,_,y),f=!0},p(_,[y]){let S=e;e=d(_),e===S?u[e].p(_,y):(Ae(),F(u[S],1,1,()=>{u[S]=null}),De(),t=u[e],t?t.p(_,y):(t=u[e]=c[e](_),t.c()),T(t,1),t.m(i.parentNode,i));const C={};o.$set(C);const x={};l.$set(x);const M={};y&4&&(M.collection=_[2]),a.$set(M)},i(_){f||(T(t),T(o.$$.fragment,_),T(l.$$.fragment,_),T(a.$$.fragment,_),f=!0)},o(_){F(t),F(o.$$.fragment,_),F(l.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){u[e].d(_),_&&k(i),n[20](null),q(o,_),_&&k(r),n[21](null),q(l,_),_&&k(s),n[22](null),q(a,_)}}}function iA(n,e,t){var G;let i,o,r,l;pn(n,fi,U=>t(2,o=U)),pn(n,Go,U=>t(10,r=U)),pn(n,pf,U=>t(8,l=U));const s=B.getQueryParams((G=window.location)==null?void 0:G.href);let a,f,c,u,d=s.filter||"",h=s.sort||"-created",b=s.collectionId;B.setDocumentTitle("Collections"),_C(b);const v=()=>a==null?void 0:a.show(),_=()=>a==null?void 0:a.show(o),y=()=>f==null?void 0:f.show(o),S=()=>c==null?void 0:c.show(),C=U=>t(0,d=U.detail);function x(U){he[U?"unshift":"push"](()=>{u=U,t(6,u)})}function M(U){d=U,t(0,d),t(2,o),t(9,b)}function A(U){h=U,t(1,h),t(2,o),t(9,b)}const O=U=>c==null?void 0:c.show(U==null?void 0:U.detail);function D(U){he[U?"unshift":"push"](()=>{a=U,t(3,a)})}function E(U){he[U?"unshift":"push"](()=>{f=U,t(4,f)})}function P(U){he[U?"unshift":"push"](()=>{c=U,t(5,c)})}const I=()=>u==null?void 0:u.load(),R=()=>u==null?void 0:u.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=r.filter(U=>U.name!="profiles")),n.$$.dirty&516&&(o==null?void 0:o.id)&&b!=o.id&&(t(9,b=o.id),t(1,h="-created"),t(0,d="")),n.$$.dirty&7&&(h||d||(o==null?void 0:o.id))&&B.replaceClientQueryParams({collectionId:o==null?void 0:o.id,filter:d,sort:h})},[d,h,o,a,f,c,u,i,l,b,r,v,_,y,S,C,x,M,A,O,D,E,P,I,R]}class oA extends Ie{constructor(e){super(),Le(this,e,iA,nA,Ee,{})}}function Ym(n){let e,t;return e=new je({props:{class:"form-field disabled",name:"id",$$slots:{default:[rA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&2|o[1]&3&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function rA(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="ID",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"for",r=n[31]),p(s,"type","text"),p(s,"id",a=n[31]),s.value=f=n[1].id,s.disabled=!0},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),w(c,l,u),w(c,s,u)},p(c,u){u[1]&1&&r!==(r=c[31])&&p(e,"for",r),u[1]&1&&a!==(a=c[31])&&p(s,"id",a),u[0]&2&&f!==(f=c[1].id)&&s.value!==f&&(s.value=f)},d(c){c&&k(e),c&&k(l),c&&k(s)}}}function Gm(n){let e,t,i,o;return{c(){e=g("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(r,l){w(r,e,l),i||(o=Xe(t=St.call(null,e,"Verified")),i=!0)},d(r){r&&k(e),i=!1,o()}}}function lA(n){let e,t,i,o,r,l,s,a,f,c,u,d=n[1].verified&&Gm();return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Email",l=$(),d&&d.c(),s=$(),a=g("input"),p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"for",r=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",f=n[31]),a.required=!0},m(h,b){w(h,e,b),m(e,t),m(e,i),m(e,o),w(h,l,b),d&&d.m(h,b),w(h,s,b),w(h,a,b),Me(a,n[2]),c||(u=X(a,"input",n[19]),c=!0)},p(h,b){b[1]&1&&r!==(r=h[31])&&p(e,"for",r),h[1].verified?d||(d=Gm(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),b[1]&1&&f!==(f=h[31])&&p(a,"id",f),b[0]&4&&a.value!==h[2]&&Me(a,h[2])},d(h){h&&k(e),h&&k(l)
|
||
|
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[16]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function pA(n){let e,t,i,o,r=!n[1].verified&&Qm(n);return{c(){r&&r.c(),e=$(),t=g("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
|
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(l,s){r&&r.m(l,s),w(l,e,s),w(l,t,s),i||(o=X(t,"click",n[17]),i=!0)},p(l,s){l[1].verified?r&&(r.d(1),r=null):r?r.p(l,s):(r=Qm(l),r.c(),r.m(e.parentNode,e))},d(l){r&&r.d(l),l&&k(e),l&&k(t),i=!1,o()}}}function hA(n){let e,t,i,o,r,l,s=n[1].isNew?"Create":"Save changes",a,f,c,u,d,h=!n[1].isNew&&Xm(n);return{c(){h&&h.c(),e=$(),t=g("button"),i=g("span"),i.textContent="Cancel",o=$(),r=g("button"),l=g("span"),a=j(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(l,"class","txt"),p(r,"type","submit"),p(r,"form",n[11]),p(r,"class","btn btn-expanded"),r.disabled=f=!n[10]||n[5],ne(r,"btn-loading",n[5])},m(b,v){h&&h.m(b,v),w(b,e,v),w(b,t,v),m(t,i),w(b,o,v),w(b,r,v),m(r,l),m(l,a),c=!0,u||(d=X(t,"click",n[18]),u=!0)},p(b,v){b[1].isNew?h&&(Ae(),F(h,1,1,()=>{h=null}),De()):h?(h.p(b,v),v[0]&2&&T(h,1)):(h=Xm(b),h.c(),T(h,1),h.m(e.parentNode,e)),(!c||v[0]&32)&&(t.disabled=b[5]),(!c||v[0]&2)&&s!==(s=b[1].isNew?"Create":"Save changes")&&ge(a,s),(!c||v[0]&1056&&f!==(f=!b[10]||b[5]))&&(r.disabled=f),v[0]&32&&ne(r,"btn-loading",b[5])},i(b){c||(T(h),c=!0)},o(b){F(h),c=!1},d(b){h&&h.d(b),b&&k(e),b&&k(t),b&&k(o),b&&k(r),u=!1,d()}}}function mA(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[hA],header:[dA],default:[uA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&1088&&(l.beforeHide=o[24]),r[0]&1966|r[1]&2&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[25](null),q(e,o)}}}function bA(n,e,t){let i;const o=yn(),r="user_"+B.randomString(5);let l,s=new es,a=!1,f=!1,c="",u="",d="",h=!1,b=!0;function v(W){return y(W),t(6,f=!0),l==null?void 0:l.show()}function _(){return l==null?void 0:l.hide()}function y(W){Ui({}),t(1,s=W!=null&&W.clone?W.clone():new es),S()}function S(){t(3,h=!1),t(9,b=!0),t(2,c=(s==null?void 0:s.email)||""),t(7,u=""),t(8,d="")}function C(){if(a||!i)return;t(5,a=!0);const W={email:c};(s.isNew||h)&&(W.password=u,W.passwordConfirm=d);let te;s.isNew?te=Se.Users.create(W):te=Se.Users.update(s.id,W),te.then(async ce=>{b&&M(!1),t(6,f=!1),_(),hn(s.isNew?"Successfully created user.":"Successfully updated user."),o("save",ce)}).catch(ce=>{Se.errorResponseHandler(ce)}).finally(()=>{t(5,a=!1)})}function x(){!(s!=null&&s.id)||xi("Do you really want to delete the selected user?",()=>Se.Users.delete(s.id).then(()=>{t(6,f=!1),_(),hn("Successfully deleted user."),o("delete",s)}).catch(W=>{Se.errorResponseHandler(W)}))}function M(W=!0){return Se.Users.requestVerification(s.isNew?c:s.email).then(()=>{t(6,f=!1),_(),W&&hn(`Successfully sent verification email to ${s.email}.`)}).catch(te=>{Se.errorResponseHandler(te)})}const A=()=>M(),O=()=>x(),D=()=>_();function E(){c=this.value,t(2,c)}function P(){h=this.checked,t(3,h)}function I(){u=this.value,t(7,u)}function R(){d=this.value,t(8,d)}function G(){b=this.checked,t(9,b)}const U=()=>i&&f?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,f=!1),_()}),!1):!0;function z(W){he[W?"unshift":"push"](()=>{l=W,t(4,l)})}function K(W){ft.call(this,n,W)}function Y(W){ft.call(this,n,W)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=s.isNew&&c!=""||h||c!==s.email)},[_,s,c,h,l,a,f,u,d,b,i,r,C,x,M,v,A,O,D,E,P,I,R,G,U,z,K,Y]}class gA extends Ie{constructor(e){super(),Le(this,e,bA,mA,Ee,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function eb(n,e,t){const i=n.slice();return i[37]=e[t],i}function tb(n,e,t){const i=n.slice();return i[40]=e[t],i}function nb(n,e,t){const i=n.slice();return i[40]=e[t],i}function _A(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O=[],D=new Map,E,P,I,R,G,U,z,K,Y,W,te=[],ce=new Map,ve,oe,J,$e,ee;u=new Ds({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),u.$on("submit",n[17]);function _e(Z){n[18](Z)}le
|
||
|
<span class="txt">New user</span>`,c=$(),V(u.$$.fragment),d=$(),h=g("div"),b=g("table"),v=g("thead"),_=g("tr"),V(y.$$.fragment),C=$(),V(x.$$.fragment),A=$();for(let Z=0;Z<O.length;Z+=1)O[Z].c();E=$(),V(P.$$.fragment),R=$(),V(G.$$.fragment),z=$(),K=g("th"),Y=$(),W=g("tbody");for(let Z=0;Z<te.length;Z+=1)te[Z].c();Je&&Je.c(),ve=$(),be&&be.c(),oe=$(),Oe&&Oe.c(),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"class","btn btn-secondary btn-circle"),p(s,"class","flex-fill"),p(f,"type","button"),p(f,"class","btn btn-expanded"),p(t,"class","page-header"),p(K,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[10]),p(h,"class","table-wrapper"),p(e,"class","page-wrapper")},m(Z,ae){w(Z,e,ae),m(e,t),m(t,i),m(t,o),m(t,r),m(t,l),m(t,s),m(t,a),m(t,f),m(e,c),H(u,e,null),m(e,d),m(e,h),m(h,b),m(b,v),m(v,_),H(y,_,null),m(_,C),H(x,_,null),m(_,A);for(let Ve=0;Ve<O.length;Ve+=1)O[Ve].m(_,null);m(_,E),H(P,_,null),m(_,R),H(G,_,null),m(_,z),m(_,K),m(b,Y),m(b,W);for(let Ve=0;Ve<te.length;Ve+=1)te[Ve].m(W,null);Je&&Je.m(W,null),m(e,ve),be&&be.m(e,null),m(e,oe),Oe&&Oe.m(e,null),J=!0,$e||(ee=[Xe(St.call(null,r,{text:"Edit profile collection",position:"right"})),X(r,"click",n[15]),X(f,"click",n[16])],$e=!0)},p(Z,ae){const Ve={};ae[0]&8&&(Ve.value=Z[3]),u.$set(Ve);const yt={};ae[1]&16384&&(yt.$$scope={dirty:ae,ctx:Z}),!S&&ae[0]&16&&(S=!0,yt.sort=Z[4],Re(()=>S=!1)),y.$set(yt);const it={};ae[1]&16384&&(it.$$scope={dirty:ae,ctx:Z}),!M&&ae[0]&16&&(M=!0,it.sort=Z[4],Re(()=>M=!1)),x.$set(it),ae[0]&4096&&(Ne=Z[12],O=st(O,ae,Pe,1,Z,Ne,D,_,an,ib,E,nb));const bt={};ae[1]&16384&&(bt.$$scope={dirty:ae,ctx:Z}),!I&&ae[0]&16&&(I=!0,bt.sort=Z[4],Re(()=>I=!1)),P.$set(bt);const at={};ae[1]&16384&&(at.$$scope={dirty:ae,ctx:Z}),!U&&ae[0]&16&&(U=!0,at.sort=Z[4],Re(()=>U=!1)),G.$set(at),ae[0]&5450&&(He=Z[1],Ae(),te=st(te,ae,qe,1,Z,He,ce,W,Pt,sb,null,eb),De(),!He.length&&Je?Je.p(Z,ae):He.length?Je&&(Je.d(1),Je=null):(Je=ob(Z),Je.c(),Je.m(W,null))),ae[0]&1024&&ne(b,"table-loading",Z[10]),Z[1].length?be?be.p(Z,ae):(be=ab(Z),be.c(),be.m(e,oe)):be&&(be.d(1),be=null),Z[1].length&&Z[13]?Oe?Oe.p(Z,ae):(Oe=fb(Z),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null)},i(Z){if(!J){T(u.$$.fragment,Z),T(y.$$.fragment,Z),T(x.$$.fragment,Z),T(P.$$.fragment,Z),T(G.$$.fragment,Z);for(let ae=0;ae<He.length;ae+=1)T(te[ae]);J=!0}},o(Z){F(u.$$.fragment,Z),F(y.$$.fragment,Z),F(x.$$.fragment,Z),F(P.$$.fragment,Z),F(G.$$.fragment,Z);for(let ae=0;ae<te.length;ae+=1)F(te[ae]);J=!1},d(Z){Z&&k(e),q(u),q(y),q(x);for(let ae=0;ae<O.length;ae+=1)O[ae].d();q(P),q(G);for(let ae=0;ae<te.length;ae+=1)te[ae].d();Je&&Je.d(),be&&be.d(),Oe&&Oe.d(),$e=!1,rt(ee)}}}function vA(n){let e;return{c(){e=g("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
|
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function yA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function kA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function ib(n,e){let t,i,o,r,l,s,a,f=e[40].name+"",c,u,d;return{key:n,first:null,c(){t=g("th"),i=g("div"),o=g("i"),l=$(),s=g("span"),a=j("profile."),c=j(f),p(o,"class",r=B.getFieldTypeIcon(e[40].type)),p(s,"class","txt"),p(i,"class","col-header-content"),p(t,"class",u="col-type-"+e[40].type+" col-field-"+e[40].name),p(t,"name",d=e[40].name),this.first=t},m(h,b){w(h,t,b),m(t,i),m(i,o),m(i,l),m(i,s),m(s,a),m(s,c)},p(h,b){e=h,b[0]&4096&&r!==(r=B.getFieldTypeIcon(e[40].type))&&p(o,"class",r),b[0]&4096&&f!==(f=e[40].name+"")&&ge(c,f),b[0]&4096&&u!==(u="col-type-"+e[40].type+" col-field-"+e[40].name)&&p(t,"class",u),b[0]&4096&&d!==(d=e[40].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function wA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function SA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function ob(n){let e;function t(r,l){return r[10]?xA:CA}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function CA(n){var s;let e,t,i,o,r,l=((s=n[3])==null?void 0:s.length)&&rb(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No users found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[3])!=null&&c.length?l?l.p(a,f):(l=rb(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function xA(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
|
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function rb(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[24]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function lb(n,e){let t,i,o;return i=new L1({props:{field:e[40],record:e[37].profile||{}}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l[0]&4096&&(s.field=e[40]),l[0]&2&&(s.record=e[37].profile||{}),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function sb(n,e){let t,i,o,r,l,s,a,f=e[37].email+"",c,u,d,h,b=e[37].verified?"Verified":"Unverified",v,_,y=[],S=new Map,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y;o=new Ls({props:{id:e[37].id}});let W=e[12];const te=oe=>oe[40].name;for(let oe=0;oe<W.length;oe+=1){let J=tb(e,W,oe),$e=te(J);S.set($e,y[oe]=lb($e,J))}M=new Ci({props:{date:e[37].created}}),D=new Ci({props:{date:e[37].updated}});function ce(){return e[22](e[37])}function ve(){return e[23](e[37])}return{key:n,first:null,c(){t=g("tr"),i=g("td"),V(o.$$.fragment),r=$(),l=g("td"),s=g("div"),a=g("span"),c=j(f),d=$(),h=g("span"),v=j(b),_=$();for(let oe=0;oe<y.length;oe+=1)y[oe].c();C=$(),x=g("td"),V(M.$$.fragment),A=$(),O=g("td"),V(D.$$.fragment),E=$(),P=g("td"),I=g("button"),I.innerHTML=`<i class="ri-user-settings-line"></i>
|
||
|
<span class="txt">Edit user</span>`,R=$(),G=g("button"),G.innerHTML=`<i class="ri-profile-line"></i>
|
||
|
<span class="txt">Edit profile</span>`,U=$(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",u=e[37].email),p(h,"class","label"),ne(h,"label-success",e[37].verified),ne(h,"label-warning",!e[37].verified),p(s,"class","inline-flex"),p(l,"class","col-type-email col-field-email"),p(x,"class","col-type-date col-field-created"),p(O,"class","col-type-date col-field-updated"),p(I,"type","button"),p(I,"class","btn btn-sm btn-outline"),p(G,"type","button"),p(G,"class","btn btn-sm m-l-10"),p(P,"class","col-type-action min-width"),this.first=t},m(oe,J){w(oe,t,J),m(t,i),H(o,i,null),m(t,r),m(t,l),m(l,s),m(s,a),m(a,c),m(s,d),m(s,h),m(h,v),m(t,_);for(let $e=0;$e<y.length;$e+=1)y[$e].m(t,null);m(t,C),m(t,x),H(M,x,null),m(t,A),m(t,O),H(D,O,null),m(t,E),m(t,P),m(P,I),m(P,R),m(P,G),m(t,U),z=!0,K||(Y=[X(I,"click",Vn(ce)),X(G,"click",Vn(ve))],K=!0)},p(oe,J){e=oe;const $e={};J[0]&2&&($e.id=e[37].id),o.$set($e),(!z||J[0]&2)&&f!==(f=e[37].email+"")&&ge(c,f),(!z||J[0]&2&&u!==(u=e[37].email))&&p(a,"title",u),(!z||J[0]&2)&&b!==(b=e[37].verified?"Verified":"Unverified")&&ge(v,b),J[0]&2&&ne(h,"label-success",e[37].verified),J[0]&2&&ne(h,"label-warning",!e[37].verified),J[0]&4098&&(W=e[12],Ae(),y=st(y,J,te,1,e,W,S,t,Pt,lb,C,tb),De());const ee={};J[0]&2&&(ee.date=e[37].created),M.$set(ee);const _e={};J[0]&2&&(_e.date=e[37].updated),D.$set(_e)},i(oe){if(!z){T(o.$$.fragment,oe);for(let J=0;J<W.length;J+=1)T(y[J]);T(M.$$.fragment,oe),T(D.$$.fragment,oe),z=!0}},o(oe){F(o.$$.fragment,oe);for(let J=0;J<y.length;J+=1)F(y[J]);F(M.$$.fragment,oe),F(D.$$.fragment,oe),z=!1},d(oe){oe&&k(t),q(o);for(let J=0;J<y.length;J+=1)y[J].d();q(M),q(D),K=!1,rt(Y)}}}function ab(n){let e,t,i=n[1].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a[0]&2&&i!==(i=s[1].length+"")&&ge(o,i),a[0]&4&&ge(l,s[2])},d(s){s&&k(e)}}}function fb(n){let e,t,i,o,r=n[2]-n[1].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[10]),ne(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[25]),a=!0)},p(c,u){u[0]&6&&r!==(r=c[2]-c[1].length+"")&&ge(l,r),u[0]&1024&&ne(t,"btn-loading",c[10]),u[0]&1024&&ne(t,"btn-disabled",c[10])},d(c){c&&k(e),a=!1,f()}}}function MA(n){let e,t,i,o,r,l,s,a,f;const c=[vA,_A],u=[];function d(_,y){return _[11]?0:1}e=d(n),t=u[e]=c[e](n);let h={};o=new gA({props:h}),n[26](o),o.$on("save",n[27]),o.$on("delete",n[28]);let b={};l=new hc({props:b}),n[29](l),l.$on("save",n[30]);let v={collection:n[5]};return a=new F1({props:v}),n[31](a),a.$on("save",n[32]),{c(){t.c(),i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment)},m(_,y){u[e].m(_,y),w(_,i,y),H(o,_,y),w(_,r,y),H(l,_,y),w(_,s,y),H(a,_,y),f=!0},p(_,y){let S=e;e=d(_),e===S?u[e].p(_,y):(Ae(),F(u[S],1,1,()=>{u[S]=null}),De(),t=u[e],t?t.p(_,y):(t=u[e]=c[e](_),t.c()),T(t,1),t.m(i.parentNode,i));const C={};o.$set(C);const x={};l.$set(x);const M={};y[0]&32&&(M.collection=_[5]),a.$set(M)},i(_){f||(T(t),T(o.$$.fragment,_),T(l.$$.fragment,_),T(a.$$.fragment,_),f=!0)},o(_){F(t),F(o.$$.fragment,_),F(l.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){u[e].d(_),_&&k(i),n[26](null),q(o,_),_&&k(r),n[29](null),q(l,_),_&&k(s),n[31](null),q(a,_)}}}function $A(n,e,t){var $e;let i,o;const r=B.getQueryParams(($e=window.location)==null?void 0:$e.href),l=["id","userId","created","updated"];let s,a,f,c=[],u=1,d=0,h=!1,b=r.filter||"",v=r.sort||"-created",_=new En,y=!1;B.setDocumentTitle("Users"),M();async function S(ee=1){return t(10,h=!0),Se.Users.getList(ee,50,{sort:v||"-created",filter:b}).then(_e=>{ee<=1&&C(),t(10,h=!1),t(1,c=c.concat(_e.items)),t(9,u=_e.page),t(2,d=_e.totalItems)}).catch(_e=>{_e!==null&&(t(10,h=!1),console.warn(_e),C(),Se.errorResponseHandler(_e,!1))})}function C(){t(1,c=[]),t(9,u=1),t(
|
||
|
<span class="txt">Application</span>`,l=$(),s=g("a"),s.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||
|
<span class="txt">Mail settings</span>`,a=$(),f=g("a"),f.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||
|
<span class="txt">Files storage</span>`,c=$(),u=g("div"),u.textContent="Authentication",d=$(),h=g("a"),h.innerHTML=`<i class="ri-lock-password-line"></i>
|
||
|
<span class="txt">Auth providers</span>`,b=$(),v=g("a"),v.innerHTML=`<i class="ri-key-line"></i>
|
||
|
<span class="txt">Token options</span>`,_=$(),y=g("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
|
||
|
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(r,"href","/settings"),p(r,"class","sidebar-list-item"),p(s,"href","/settings/mail"),p(s,"class","sidebar-list-item"),p(f,"href","/settings/storage"),p(f,"class","sidebar-list-item"),p(u,"class","sidebar-title"),p(h,"href","/settings/auth-providers"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/tokens"),p(v,"class","sidebar-list-item"),p(y,"href","/settings/admins"),p(y,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(x,M){w(x,e,M),m(e,t),m(t,i),m(t,o),m(t,r),m(t,l),m(t,s),m(t,a),m(t,f),m(t,c),m(t,u),m(t,d),m(t,h),m(t,b),m(t,v),m(t,_),m(t,y),S||(C=[Xe(li.call(null,r,{path:"/settings"})),Xe(xn.call(null,r)),Xe(li.call(null,s,{path:"/settings/mail/?.*"})),Xe(xn.call(null,s)),Xe(li.call(null,f,{path:"/settings/storage/?.*"})),Xe(xn.call(null,f)),Xe(li.call(null,h,{path:"/settings/auth-providers/?.*"})),Xe(xn.call(null,h)),Xe(li.call(null,v,{path:"/settings/tokens/?.*"})),Xe(xn.call(null,v)),Xe(li.call(null,y,{path:"/settings/admins/?.*"})),Xe(xn.call(null,y))],S=!0)},p:le,i:le,o:le,d(x){x&&k(e),S=!1,rt(C)}}}class er extends Ie{constructor(e){super(),Le(this,e,null,DA,Ee,{})}}function cb(n,e,t){const i=n.slice();return i[31]=e[t],i}function ub(n){let e,t;return e=new je({props:{class:"form-field disabled",name:"id",$$slots:{default:[OA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&1073741826|o[1]&8&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function OA(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="ID",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","text"),p(s,"id",a=n[30]),s.value=f=n[1].id,s.disabled=!0},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),w(c,l,u),w(c,s,u)},p(c,u){u[0]&1073741824&&r!==(r=c[30])&&p(e,"for",r),u[0]&1073741824&&a!==(a=c[30])&&p(s,"id",a),u[0]&2&&f!==(f=c[1].id)&&s.value!==f&&(s.value=f)},d(c){c&&k(e),c&&k(l),c&&k(s)}}}function db(n){let e,t,i,o,r,l,s,a;function f(){return n[17](n[31])}function c(...u){return n[18](n[31],...u)}return{c(){e=g("figure"),t=g("img"),r=$(),Qn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt",o="Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(u,d){w(u,e,d),m(e,t),m(e,r),s||(a=[X(e,"click",f),X(e,"keydown",c)],s=!0)},p(u,d){n=u,d[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),s=!1,rt(a)}}}function TA(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Email",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",a=n[30]),s.required=!0},m(u,d){w(u,e,d),m(e,t),m(e,i),m(e,o),w(u,l,d),w(u,s,d),Me(s,n[3]),f||(c=X(s,"input",n[19]),f=!0)},p(u,d){d[0]&1073741824&&r!==(r=u[30])&&p(e,"for",r),d[0]&1073741824&&a!==(a=u[30])&&p(s,"id",a),d[0]&8&&s.value!==u[3]&&Me(s,u[3])},d(u){u&&k(e),u&&k(l),u&&k(s),f=!1,c()}}}function pb(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[EA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&1073741840|o[1]&8&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function EA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(o,"for",l=n[30])},m(f,c){w(f,e,c),e.checked=n[4],w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[20]),s=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&16&&(e.checked=f[4]),c[0]&1073741824&&l!==(l=f[30])&&p(o,"for",l)},d(f){f&&
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[15]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function NA(n){let e,t,i,o,r,l,s=n[1].isNew?"Create":"Save changes",a,f,c,u,d,h=!n[1].isNew&&mb(n);return{c(){h&&h.c(),e=$(),t=g("button"),i=g("span"),i.textContent="Cancel",o=$(),r=g("button"),l=g("span"),a=j(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(l,"class","txt"),p(r,"type","submit"),p(r,"form",n[11]),p(r,"class","btn btn-expanded"),r.disabled=f=!n[10]||n[6],ne(r,"btn-loading",n[6])},m(b,v){h&&h.m(b,v),w(b,e,v),w(b,t,v),m(t,i),w(b,o,v),w(b,r,v),m(r,l),m(l,a),c=!0,u||(d=X(t,"click",n[16]),u=!0)},p(b,v){b[1].isNew?h&&(Ae(),F(h,1,1,()=>{h=null}),De()):h?(h.p(b,v),v[0]&2&&T(h,1)):(h=mb(b),h.c(),T(h,1),h.m(e.parentNode,e)),(!c||v[0]&64)&&(t.disabled=b[6]),(!c||v[0]&2)&&s!==(s=b[1].isNew?"Create":"Save changes")&&ge(a,s),(!c||v[0]&1088&&f!==(f=!b[10]||b[6]))&&(r.disabled=f),v[0]&64&&ne(r,"btn-loading",b[6])},i(b){c||(T(h),c=!0)},o(b){F(h),c=!1},d(b){h&&h.d(b),b&&k(e),b&&k(t),b&&k(o),b&&k(r),u=!1,d()}}}function jA(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[NA],header:[IA],default:[LA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&1152&&(l.beforeHide=o[23]),r[0]&1886|r[1]&8&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[24](null),q(e,o)}}}function zA(n,e,t){let i;const o=yn(),r="admin_"+B.randomString(5);let l,s=new Bo,a=!1,f=!1,c=0,u="",d="",h="",b=!1;function v(Y){return y(Y),t(7,f=!0),l==null?void 0:l.show()}function _(){return l==null?void 0:l.hide()}function y(Y){Ui({}),t(1,s=Y!=null&&Y.clone?Y.clone():new Bo),S()}function S(){t(4,b=!1),t(3,u=(s==null?void 0:s.email)||""),t(2,c=(s==null?void 0:s.avatar)||0),t(8,d=""),t(9,h="")}function C(){if(a||!i)return;t(6,a=!0);const Y={email:u,avatar:c};(s.isNew||b)&&(Y.password=d,Y.passwordConfirm=h);let W;s.isNew?W=Se.Admins.create(Y):W=Se.Admins.update(s.id,Y),W.then(async te=>{var ce;t(7,f=!1),_(),hn(s.isNew?"Successfully created admin.":"Successfully updated admin."),o("save",te),((ce=Se.AuthStore.model)==null?void 0:ce.id)===te.id&&Se.AuthStore.save(Se.AuthStore.token,te)}).catch(te=>{Se.errorResponseHandler(te)}).finally(()=>{t(6,a=!1)})}function x(){!(s!=null&&s.id)||xi("Do you really want to delete the selected admin?",()=>Se.Admins.delete(s.id).then(()=>{t(7,f=!1),_(),hn("Successfully deleted admin."),o("delete",s)}).catch(Y=>{Se.errorResponseHandler(Y)}))}const M=()=>x(),A=()=>_(),O=Y=>t(2,c=Y),D=(Y,W)=>{(W.code==="Enter"||W.code==="Space")&&(W.preventDefault(),t(2,c=Y))};function E(){u=this.value,t(3,u)}function P(){b=this.checked,t(4,b)}function I(){d=this.value,t(8,d)}function R(){h=this.value,t(9,h)}const G=()=>i&&f?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,f=!1),_()}),!1):!0;function U(Y){he[Y?"unshift":"push"](()=>{l=Y,t(5,l)})}function z(Y){ft.call(this,n,Y)}function K(Y){ft.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=s.isNew&&u!=""||b||u!==s.email||c!==s.avatar)},[_,s,c,u,b,l,a,f,d,h,i,r,C,x,v,M,A,O,D,E,P,I,R,G,U,z,K]}class HA extends Ie{constructor(e){super(),Le(this,e,zA,jA,Ee,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function bb(n,e,t){const i=n.slice();return i[21]=e[t],i}function qA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function VA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function BA(n){let e,t,i,o;return{c(){
|
||
|
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function _b(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[15]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function vb(n){let e;return{c(){e=g("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yb(n,e){let t,i,o,r,l,s,a,f,c,u,d,h,b=e[21].email+"",v,_,y,S,C,x,M,A,O,D,E,P,I,R;f=new Ls({props:{id:e[21].id}});let G=e[21].id===e[6].id&&vb();C=new Ci({props:{date:e[21].created}}),A=new Ci({props:{date:e[21].updated}});function U(){return e[13](e[21])}function z(...K){return e[14](e[21],...K)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("figure"),r=g("img"),s=$(),a=g("td"),V(f.$$.fragment),c=$(),G&&G.c(),u=$(),d=g("td"),h=g("span"),v=j(b),y=$(),S=g("td"),V(C.$$.fragment),x=$(),M=g("td"),V(A.$$.fragment),O=$(),D=g("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',E=$(),Qn(r.src,l="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg")||p(r,"src",l),p(r,"alt","Admin avatar"),p(o,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",_=e[21].email),p(d,"class","col-type-email col-field-email"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,Y){w(K,t,Y),m(t,i),m(i,o),m(o,r),m(t,s),m(t,a),H(f,a,null),m(a,c),G&&G.m(a,null),m(t,u),m(t,d),m(d,h),m(h,v),m(t,y),m(t,S),H(C,S,null),m(t,x),m(t,M),H(A,M,null),m(t,O),m(t,D),m(t,E),P=!0,I||(R=[X(t,"click",U),X(t,"keydown",z)],I=!0)},p(K,Y){e=K,(!P||Y&16&&!Qn(r.src,l="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg"))&&p(r,"src",l);const W={};Y&16&&(W.id=e[21].id),f.$set(W),e[21].id===e[6].id?G||(G=vb(),G.c(),G.m(a,null)):G&&(G.d(1),G=null),(!P||Y&16)&&b!==(b=e[21].email+"")&&ge(v,b),(!P||Y&16&&_!==(_=e[21].email))&&p(h,"title",_);const te={};Y&16&&(te.date=e[21].created),C.$set(te);const ce={};Y&16&&(ce.date=e[21].updated),A.$set(ce)},i(K){P||(T(f.$$.fragment,K),T(C.$$.fragment,K),T(A.$$.fragment,K),P=!0)},o(K){F(f.$$.fragment,K),F(C.$$.fragment,K),F(A.$$.fragment,K),P=!1},d(K){K&&k(t),q(f),G&&G.d(),q(C),q(A),I=!1,rt(R)}}}function kb(n){let e,t,i=n[4].length+"",o,r,l=n[4].length+"",s;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),s=j(l),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,f){w(a,e,f),m(e,t),m(e,o),m(e,r),m(e,s)},p(a,f){f&16&&i!==(i=a[4].length+"")&&ge(o,i),f&16&&l!==(l=a[4].length+"")&&ge(s,l)},d(a){a&&k(e)}}}function GA(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y,W=[],te=new Map,ce,ve,oe,J,$e,ee;e=new er({}),u=new Ds({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),u.$on("submit",n[8]);function _e(be){n[9](be)}let fe={class:"col-type-text",name:"id",$$slots:{default:[qA]},$$scope:{ctx:n}};n[2]!==void 0&&(fe.sort=n[2]),C=new en({props:fe}),he.push(()=>Fe(C,"sort",_e));function ie(be){n[10](be)}let ye={class:"col-type-email col-field-email",name:"email",$$slots:{default:[VA]},$$scope:{ctx:n}};n[2]!==void 0&&(ye.sort=n[2]),A=new en({props:ye}),he.push(()=>Fe(A,"sort",ie));function Ne(be){n[11](be)}let Pe={class:"col-type-date col-field-created",name:"created",$$slots:{default:[BA]},$$scope:{ctx:n}};n[2]!==void 0&&(Pe.sort=n[2]),E=new en({props:Pe}),he.push(()=>Fe(E,"sort",Ne));function ze(be){n[12](be)}let se={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[UA]},$$scope:{ctx:n}};n[2]!==void 0&&(se.sort=n[2]),R=new en({props:se}),he.push(()=>Fe(R,"sort",ze));let re=n[4];const ke=be=>be[21].id;for(let be=0;be<re.length;be+=1){let Oe=bb(n,re,be),Z=ke(Oe);te.set(Z,W[be]=yb(Z,Oe))}let He=null;re.length||(He=gb(n));let qe=n[4].length&&kb(n),Je={};return oe=new HA({props:Je}),n[16](oe),oe.$on("save",n[17]),oe.$on("delete",n[18]),{c(){V(e.$$.fra
|
||
|
<div class="breadcrumb-item">Admins</div>`,l=$(),s=g("div"),a=$(),f=g("button"),f.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">New admin</span>`,c=$(),V(u.$$.fragment),d=$(),h=g("div"),b=g("table"),v=g("thead"),_=g("tr"),y=g("th"),S=$(),V(C.$$.fragment),M=$(),V(A.$$.fragment),D=$(),V(E.$$.fragment),I=$(),V(R.$$.fragment),U=$(),z=g("th"),K=$(),Y=g("tbody");for(let be=0;be<W.length;be+=1)W[be].c();He&&He.c(),ce=$(),qe&&qe.c(),ve=$(),V(oe.$$.fragment),p(r,"class","breadcrumbs"),p(s,"class","flex-fill"),p(f,"type","button"),p(f,"class","btn btn-expanded"),p(o,"class","page-header"),p(y,"class","min-width"),p(z,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[5]),p(h,"class","table-wrapper"),p(i,"class","page-wrapper")},m(be,Oe){H(e,be,Oe),w(be,t,Oe),w(be,i,Oe),m(i,o),m(o,r),m(o,l),m(o,s),m(o,a),m(o,f),m(i,c),H(u,i,null),m(i,d),m(i,h),m(h,b),m(b,v),m(v,_),m(_,y),m(_,S),H(C,_,null),m(_,M),H(A,_,null),m(_,D),H(E,_,null),m(_,I),H(R,_,null),m(_,U),m(_,z),m(b,K),m(b,Y);for(let Z=0;Z<W.length;Z+=1)W[Z].m(Y,null);He&&He.m(Y,null),m(i,ce),qe&&qe.m(i,null),w(be,ve,Oe),H(oe,be,Oe),J=!0,$e||(ee=X(f,"click",n[7]),$e=!0)},p(be,[Oe]){const Z={};Oe&2&&(Z.value=be[1]),u.$set(Z);const ae={};Oe&16777216&&(ae.$$scope={dirty:Oe,ctx:be}),!x&&Oe&4&&(x=!0,ae.sort=be[2],Re(()=>x=!1)),C.$set(ae);const Ve={};Oe&16777216&&(Ve.$$scope={dirty:Oe,ctx:be}),!O&&Oe&4&&(O=!0,Ve.sort=be[2],Re(()=>O=!1)),A.$set(Ve);const yt={};Oe&16777216&&(yt.$$scope={dirty:Oe,ctx:be}),!P&&Oe&4&&(P=!0,yt.sort=be[2],Re(()=>P=!1)),E.$set(yt);const it={};Oe&16777216&&(it.$$scope={dirty:Oe,ctx:be}),!G&&Oe&4&&(G=!0,it.sort=be[2],Re(()=>G=!1)),R.$set(it),Oe&122&&(re=be[4],Ae(),W=st(W,Oe,ke,1,be,re,te,Y,Pt,yb,null,bb),De(),!re.length&&He?He.p(be,Oe):re.length?He&&(He.d(1),He=null):(He=gb(be),He.c(),He.m(Y,null))),Oe&32&&ne(b,"table-loading",be[5]),be[4].length?qe?qe.p(be,Oe):(qe=kb(be),qe.c(),qe.m(i,null)):qe&&(qe.d(1),qe=null);const bt={};oe.$set(bt)},i(be){if(!J){T(e.$$.fragment,be),T(u.$$.fragment,be),T(C.$$.fragment,be),T(A.$$.fragment,be),T(E.$$.fragment,be),T(R.$$.fragment,be);for(let Oe=0;Oe<re.length;Oe+=1)T(W[Oe]);T(oe.$$.fragment,be),J=!0}},o(be){F(e.$$.fragment,be),F(u.$$.fragment,be),F(C.$$.fragment,be),F(A.$$.fragment,be),F(E.$$.fragment,be),F(R.$$.fragment,be);for(let Oe=0;Oe<W.length;Oe+=1)F(W[Oe]);F(oe.$$.fragment,be),J=!1},d(be){q(e,be),be&&k(t),be&&k(i),q(u),q(C),q(A),q(E),q(R);for(let Oe=0;Oe<W.length;Oe+=1)W[Oe].d();He&&He.d(),qe&&qe.d(),be&&k(ve),n[16](null),q(oe,be),$e=!1,ee()}}}function KA(n,e,t){var D;let i;pn(n,qf,E=>t(6,i=E));const o=B.getQueryParams((D=window.location)==null?void 0:D.href);let r,l=[],s=!1,a=o.filter||"",f=o.sort||"-created";B.setDocumentTitle("Admins");function c(){return t(5,s=!0),t(4,l=[]),Se.Admins.getFullList(100,{sort:f||"-created",filter:a}).then(E=>{t(4,l=E),t(5,s=!1)}).catch(E=>{E!==null&&(t(5,s=!1),console.warn(E),u(),Se.errorResponseHandler(E,!1))})}function u(){t(4,l=[])}const d=()=>r==null?void 0:r.show(),h=E=>t(1,a=E.detail);function b(E){f=E,t(2,f)}function v(E){f=E,t(2,f)}function _(E){f=E,t(2,f)}function y(E){f=E,t(2,f)}const S=E=>r==null?void 0:r.show(E),C=(E,P)=>{(P.code==="Enter"||P.code==="Space")&&(P.preventDefault(),r==null||r.show(E))},x=()=>t(1,a="");function M(E){he[E?"unshift":"push"](()=>{r=E,t(3,r)})}const A=()=>c(),O=()=>c();return n.$$.update=()=>{n.$$.dirty&6&&f!==-1&&a!==-1&&(B.replaceClientQueryParams({filter:a,sort:f}),c())},[c,a,f,r,l,s,i,d,h,b,v,_,y,S,C,x,M,A,O]}class JA extends Ie{constructor(e){super(),Le(this,e,KA,GA,Ee,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function wb(n){let e,t,i;return{c(){e=g("div"),e.innerHTML=`<figure class="logo"><img src="/_/images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
|
||
|
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=$(),i=g("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r)},d(o){o&&k(e),o&&k(t),o&&k(i)}}}function ZA(n){let e,t,i,o,r,l,s,a,f=!n[0]&&wb();const c=n[2].default,u=$n(c,n,n[1],null);return{c(){e=g("div"),t=g("div"),i=$(),o=g("div"),f&&f.c(),r=$(),u&&u.c(),l=$(),s=g("div"),p(t,"class","flex-fill"),p(o,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),p(s,"class","flex-fill"),p(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,o),f&&f.m(o,null),m(o,r),u&&u.m(o,null),m(e,l),m(e,s),a=!0},p(d,[h]){d[0]?f&&(f.d(1),f=null):f||(f=wb(),f.c(),f.m(o,r)),u&&u.p&&(!a||h&2)&&Dn(u,c,d,d[1],a?An(c,d[1],h,null):On(d[1]),null)},i(d){a||(T(u,d),a=!0)},o(d){F(u,d),a=!1},d(d){d&&k(e),f&&f.d(),u&&u.d(d)}}}function XA(n,e,t){let{$$slots:i={},$$scope:o}=e,{nobranding:r=!1}=e;return n.$$set=l=>{"nobranding"in l&&t(0,r=l.nobranding),"$$scope"in l&&t(1,o=l.$$scope)},[r,o,i]}class QA extends Ie{constructor(e){super(),Le(this,e,XA,ZA,Ee,{nobranding:0})}}function eD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Email"),o=$(),r=g("input"),p(e,"for",i=n[7]),p(r,"type","email"),p(r,"id",l=n[7]),r.required=!0,r.autofocus=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0]),r.focus(),s||(a=X(r,"input",n[4]),s=!0)},p(f,c){c&128&&i!==(i=f[7])&&p(e,"for",i),c&128&&l!==(l=f[7])&&p(r,"id",l),c&1&&r.value!==f[0]&&Me(r,f[0])},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function tD(n){let e,t,i,o,r,l,s,a,f,c,u;return{c(){e=g("label"),t=j("Password"),o=$(),r=g("input"),s=$(),a=g("div"),f=g("a"),f.textContent="Forgotten password?",p(e,"for",i=n[7]),p(r,"type","password"),p(r,"id",l=n[7]),r.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,o,h),w(d,r,h),Me(r,n[1]),w(d,s,h),w(d,a,h),m(a,f),c||(u=[X(r,"input",n[5]),Xe(xn.call(null,f))],c=!0)},p(d,h){h&128&&i!==(i=d[7])&&p(e,"for",i),h&128&&l!==(l=d[7])&&p(r,"id",l),h&2&&r.value!==d[1]&&Me(r,d[1])},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(s),d&&k(a),c=!1,rt(u)}}}function nD(n){let e,t,i,o,r,l,s,a,f,c,u;return o=new je({props:{class:"form-field required",name:"email",$$slots:{default:[eD,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"password",$$slots:{default:[tD,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=g("form"),t=g("div"),t.innerHTML="<h4>Admin sign in</h4>",i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),a=g("button"),a.innerHTML=`<span class="txt">Login</span>
|
||
|
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ne(a,"btn-disabled",n[2]),ne(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(o,e,null),m(e,r),H(l,e,null),m(e,s),m(e,a),f=!0,c||(u=X(e,"submit",Gt(n[3])),c=!0)},p(d,h){const b={};h&385&&(b.$$scope={dirty:h,ctx:d}),o.$set(b);const v={};h&386&&(v.$$scope={dirty:h,ctx:d}),l.$set(v),h&4&&ne(a,"btn-disabled",d[2]),h&4&&ne(a,"btn-loading",d[2])},i(d){f||(T(o.$$.fragment,d),T(l.$$.fragment,d),f=!0)},o(d){F(o.$$.fragment,d),F(l.$$.fragment,d),f=!1},d(d){d&&k(e),q(o),q(l),c=!1,u()}}}function iD(n){let e,t;return e=new QA({props:{$$slots:{default:[nD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&263&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oD(n,e,t){var c;const i=B.getQueryParams((c=window.location)==null?void 0:c.href);let o=i.demoEmail||"",r=i.demoPassword||"",l=!1;function s(){if(!l)return t(2,l=!0),Se.Admins.authViaEmail(o,r).then(()=>{Ss("/")}).catch(()=>{M0("Invalid login credentials.")}).finally(()=>{t(2,l=!1)})}function a(){o=this.value,t(0,o)}function f(){r=this.value,t(1,r)}return[o,r,l,s,a,f]}class rD extends Ie{constructor(e){super(),Le(this,e,oD,iD,Ee,{})}}function lD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S;return i=new je({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[aD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[fD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[cD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),V(a.$$.fragment),f=$(),c=g("div"),u=g("div"),d=$(),h=g("button"),b=g("span"),b.textContent="Save changes",p(t,"class","col-lg-6"),p(r,"class","col-lg-6"),p(u,"class","flex-fill"),p(b,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=v=!n[3]||n[2],ne(h,"btn-loading",n[2]),p(c,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,x){w(C,e,x),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),H(a,e,null),m(e,f),m(e,c),m(c,u),m(c,d),m(c,h),m(h,b),_=!0,y||(S=X(h,"click",n[9]),y=!0)},p(C,x){const M={};x&12289&&(M.$$scope={dirty:x,ctx:C}),i.$set(M);const A={};x&12289&&(A.$$scope={dirty:x,ctx:C}),l.$set(A);const O={};x&12289&&(O.$$scope={dirty:x,ctx:C}),a.$set(O),(!_||x&12&&v!==(v=!C[3]||C[2]))&&(h.disabled=v),x&4&&ne(h,"btn-loading",C[2])},i(C){_||(T(i.$$.fragment,C),T(l.$$.fragment,C),T(a.$$.fragment,C),_=!0)},o(C){F(i.$$.fragment,C),F(l.$$.fragment,C),F(a.$$.fragment,C),_=!1},d(C){C&&k(e),q(i),q(l),q(a),y=!1,S()}}}function sD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function aD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Application name"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","text"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.appName),s||(a=X(r,"input",n[6]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&r.value!==f[0].meta.appName&&Me(r,f[0].meta.appName)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function fD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Application url"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","text"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.appUrl),s||(a=X(r,"input",n[7]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&r.value!==f[0].meta.appUrl&&Me(r,f[0].meta.appUrl)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function cD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Logs max days retention"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type
|
||
|
<div class="breadcrumb-item">Application</div></nav>`,r=$(),l=g("div"),s=g("form"),f.c(),p(o,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(_,y){H(e,_,y),w(_,t,y),w(_,i,y),m(i,o),m(i,r),m(i,l),m(l,s),b[a].m(s,null),c=!0,u||(d=X(s,"submit",Gt(n[4])),u=!0)},p(_,[y]){let S=a;a=v(_),a===S?b[a].p(_,y):(Ae(),F(b[S],1,1,()=>{b[S]=null}),De(),f=b[a],f?f.p(_,y):(f=b[a]=h[a](_),f.c()),T(f,1),f.m(s,null))},i(_){c||(T(e.$$.fragment,_),T(f),c=!0)},o(_){F(e.$$.fragment,_),F(f),c=!1},d(_){q(e,_),_&&k(t),_&&k(i),b[a].d(),u=!1,d()}}}function dD(n,e,t){let i,o={},r=!1,l=!1,s="";B.setDocumentTitle("Application settings"),a();async function a(){t(1,r=!0);try{const v=await Se.Settings.getAll()||{};c(v)}catch(v){Se.errorResponseHandler(v)}t(1,r=!1)}async function f(){if(!(l||!i)){t(2,l=!0);try{const v=await Se.Settings.update(B.filterRedactedProps(o));c(v),hn("Successfully saved application settings.")}catch(v){Se.errorResponseHandler(v)}t(2,l=!1)}}function c(v={}){t(0,o={meta:(v==null?void 0:v.meta)||{},logs:(v==null?void 0:v.logs)||{}}),t(5,s=JSON.stringify(o))}function u(){o.meta.appName=this.value,t(0,o)}function d(){o.meta.appUrl=this.value,t(0,o)}function h(){o.logs.maxDays=At(this.value),t(0,o)}const b=()=>f();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=s!=JSON.stringify(o))},[o,r,l,i,f,s,u,d,h,b]}class pD extends Ie{constructor(e){super(),Le(this,e,dD,uD,Ee,{})}}function hD(n){let e,t,i,o=[{type:"password"},{autocomplete:"new-password"},n[5]],r={};for(let l=0;l<o.length;l+=1)r=ut(r,o[l]);return{c(){e=g("input"),ci(e,r)},m(l,s){w(l,e,s),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(l,s){ci(e,r=bn(o,[{type:"password"},{autocomplete:"new-password"},s&32&&l[5]])),s&1&&e.value!==l[0]&&Me(e,l[0])},d(l){l&&k(e),n[7](null),t=!1,i()}}}function mD(n){let e,t,i,o,r,l,s=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let f=0;f<s.length;f+=1)a=ut(a,s[f]);return{c(){e=g("div"),t=g("button"),t.innerHTML='<i class="ri-key-line"></i>',i=$(),o=g("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),ci(o,a)},m(f,c){w(f,e,c),m(e,t),w(f,i,c),w(f,o,c),o.autofocus&&o.focus(),r||(l=[Xe(St.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],r=!0)},p(f,c){ci(o,a=bn(s,[{readOnly:!0},{type:"text"},c&2&&{placeholder:f[1]},c&32&&f[5]]))},d(f){f&&k(e),f&&k(i),f&&k(o),r=!1,rt(l)}}}function bD(n){let e;function t(r,l){return r[3]?mD:hD}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,[l]){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},i:le,o:le,d(r){o.d(r),r&&k(e)}}}function gD(n,e,t){const i=["value","mask"];let o=Wt(e,i),{value:r=""}=e,{mask:l="******"}=e,s,a=!1;async function f(){t(0,r=""),t(3,a=!1),await Bi(),s==null||s.focus()}const c=()=>f();function u(h){he[h?"unshift":"push"](()=>{s=h,t(2,s)})}function d(){r=this.value,t(0,r)}return n.$$set=h=>{e=ut(ut({},e),ui(h)),t(5,o=Wt(e,i)),"value"in h&&t(0,r=h.value),"mask"in h&&t(1,l=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&r===l&&t(3,a=!0)},[r,l,s,a,f,o,c,u,d]}class mc extends Ie{constructor(e){super(),Le(this,e,gD,bD,Ee,{value:0,mask:1})}}function _D(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G;i=new je({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[kD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[wD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),c=new je({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[SD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:
|
||
|
<br/>
|
||
|
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||
|
below.</strong></p>`,y=$(),V(S.$$.fragment),C=$(),U&&U.c(),x=$(),M=g("div"),A=g("div"),O=$(),D=g("button"),E=g("span"),E.textContent="Save changes",p(t,"class","col-lg-6"),p(r,"class","col-lg-6"),p(e,"class","grid"),p(_,"class","content m-b-sm"),p(A,"class","flex-fill"),p(E,"class","txt"),p(D,"type","submit"),p(D,"class","btn btn-expanded"),D.disabled=P=!n[3]||n[2],ne(D,"btn-loading",n[2]),p(M,"class","flex")},m(z,K){w(z,e,K),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),H(a,e,null),m(e,f),H(c,e,null),m(e,u),H(d,e,null),w(z,h,K),w(z,b,K),w(z,v,K),w(z,_,K),w(z,y,K),H(S,z,K),w(z,C,K),U&&U.m(z,K),w(z,x,K),w(z,M,K),m(M,A),m(M,O),m(M,D),m(D,E),I=!0,R||(G=X(D,"click",n[18]),R=!0)},p(z,K){const Y={};K&12582913&&(Y.$$scope={dirty:K,ctx:z}),i.$set(Y);const W={};K&12582913&&(W.$$scope={dirty:K,ctx:z}),l.$set(W);const te={};K&12582913&&(te.$$scope={dirty:K,ctx:z}),a.$set(te);const ce={};K&12582913&&(ce.$$scope={dirty:K,ctx:z}),c.$set(ce);const ve={};K&12582913&&(ve.$$scope={dirty:K,ctx:z}),d.$set(ve);const oe={};K&12582913&&(oe.$$scope={dirty:K,ctx:z}),S.$set(oe),z[0].smtp.enabled?U?(U.p(z,K),K&1&&T(U,1)):(U=Sb(z),U.c(),T(U,1),U.m(x.parentNode,x)):U&&(Ae(),F(U,1,1,()=>{U=null}),De()),(!I||K&12&&P!==(P=!z[3]||z[2]))&&(D.disabled=P),K&4&&ne(D,"btn-loading",z[2])},i(z){I||(T(i.$$.fragment,z),T(l.$$.fragment,z),T(a.$$.fragment,z),T(c.$$.fragment,z),T(d.$$.fragment,z),T(S.$$.fragment,z),T(U),I=!0)},o(z){F(i.$$.fragment,z),F(l.$$.fragment,z),F(a.$$.fragment,z),F(c.$$.fragment,z),F(d.$$.fragment,z),F(S.$$.fragment,z),F(U),I=!1},d(z){z&&k(e),q(i),q(l),q(a),q(c),q(d),z&&k(h),z&&k(b),z&&k(v),z&&k(_),z&&k(y),q(S,z),z&&k(C),U&&U.d(z),z&&k(x),z&&k(M),R=!1,G()}}}function vD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function yD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Sender name"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.senderName),s||(a=X(r,"input",n[7]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].meta.senderName&&Me(r,f[0].meta.senderName)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function kD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Sender address"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","email"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.senderAddress),s||(a=X(r,"input",n[8]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].meta.senderAddress&&Me(r,f[0].meta.senderAddress)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function wD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User verification page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
|
||
|
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userVerificationUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[9]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userVerificationUrl&&Me(r,u[0].meta.userVerificationUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function SD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User reset password page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
|
||
|
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userResetPasswordUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[10]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userResetPasswordUrl&&Me(r,u[0].meta.userResetPasswordUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function CD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User confirm email change page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
|
||
|
parameters:
|
||
|
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userConfirmEmailChangeUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[11]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userConfirmEmailChangeUrl&&Me(r,u[0].meta.userConfirmEmailChangeUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function xD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[22]),e.required=!0,p(o,"for",l=n[22])},m(f,c){w(f,e,c),e.checked=n[0].smtp.enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[12]),s=!0)},p(f,c){c&4194304&&t!==(t=f[22])&&p(e,"id",t),c&1&&(e.checked=f[0].smtp.enabled),c&4194304&&l!==(l=f[22])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Sb(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C;return i=new je({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[MD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$D,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[AD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field",name:"smtp.username",$$slots:{default:[DD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),v=new je({props:{class:"form-field",name:"smtp.password",$$slots:{default:[OD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),h=$(),b=g("div"),V(v.$$.fragment),_=$(),y=g("div"),p(t,"class","col-lg-6"),p(r,"class","col-lg-3"),p(a,"class","col-lg-3"),p(u,"class","col-lg-6"),p(b,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m(x,M){w(x,e,M),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),m(e,c),m(e,u),H(d,u,null),m(e,h),m(e,b),H(v,b,null),m(e,_),m(e,y),C=!0},p(x,M){const A={};M&12582913&&(A.$$scope={dirty:M,ctx:x}),i.$set(A);const O={};M&12582913&&(O.$$scope={dirty:M,ctx:x}),l.$set(O);const D={};M&12582913&&(D.$$scope={dirty:M,ctx:x}),f.$set(D);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:x}),d.$set(E);const P={};M&12582913&&(P.$$scope={dirty:M,ctx:x}),v.$set(P)},i(x){C||(T(i.$$.fragment,x),T(l.$$.fragment,x),T(f.$$.fragment,x),T(d.$$.fragment,x),T(v.$$.fragment,x),x&&Dt(()=>{S||(S=ct(e,fn,{duration:150},!0)),S.run(1)}),C=!0)},o(x){F(i.$$.fragment,x),F(l.$$.fragment,x),F(f.$$.fragment,x),F(d.$$.fragment,x),F(v.$$.fragment,x),x&&(S||(S=ct(e,fn,{duration:150},!1)),S.run(0)),C=!1},d(x){x&&k(e),q(i),q(l),q(f),q(d),q(v),x&&S&&S.end()}}}function MD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("SMTP server host"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.host),s||(a=X(r,"input",n[13]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].smtp.host&&Me(r,f[0].smtp.host)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function $D(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Port"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","number"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.port),s||(a=X(r,"input",n[14]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&At(r.value)!==f[0].smtp.port&&Me(r,f[0].smtp.port)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function AD(n){let e,t,i,o,r,l,s;function a(c){n[15](c)}let f={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),r=new yo({props:f}),he.push(()=>Fe(
|
||
|
<div class="breadcrumb-item">Mail settings</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[19])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function ED(n,e,t){let i;const o=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let r={},l=!1,s=!1,a="";B.setDocumentTitle("Mail settings"),f();async function f(){t(1,l=!0);try{const E=await Se.Settings.getAll()||{};u(E)}catch(E){Se.errorResponseHandler(E)}t(1,l=!1)}async function c(){if(!(s||!i)){t(2,s=!0);try{const E=await Se.Settings.update(B.filterRedactedProps(r));u(E),hn("Successfully saved mail settings.")}catch(E){Se.errorResponseHandler(E)}t(2,s=!1)}}function u(E={}){t(0,r={meta:(E==null?void 0:E.meta)||{},smtp:(E==null?void 0:E.smtp)||{}}),t(6,a=JSON.stringify(r))}function d(){r.meta.senderName=this.value,t(0,r)}function h(){r.meta.senderAddress=this.value,t(0,r)}function b(){r.meta.userVerificationUrl=this.value,t(0,r)}function v(){r.meta.userResetPasswordUrl=this.value,t(0,r)}function _(){r.meta.userConfirmEmailChangeUrl=this.value,t(0,r)}function y(){r.smtp.enabled=this.checked,t(0,r)}function S(){r.smtp.host=this.value,t(0,r)}function C(){r.smtp.port=At(this.value),t(0,r)}function x(E){n.$$.not_equal(r.smtp.tls,E)&&(r.smtp.tls=E,t(0,r))}function M(){r.smtp.username=this.value,t(0,r)}function A(E){n.$$.not_equal(r.smtp.password,E)&&(r.smtp.password=E,t(0,r))}const O=()=>c(),D=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(r))},[r,l,s,i,o,c,a,d,h,b,v,_,y,S,C,x,M,A,O,D]}class PD extends Ie{constructor(e){super(),Le(this,e,ED,TD,Ee,{})}}function FD(n){let e,t,i,o,r,l,s,a,f,c,u,d;e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[ID,({uniqueId:b})=>({15:b}),({uniqueId:b})=>b?32768:0]},$$scope:{ctx:n}}});let h=n[0].enabled&&Cb(n);return{c(){V(e.$$.fragment),t=$(),h&&h.c(),i=$(),o=g("div"),r=g("div"),l=$(),s=g("button"),a=g("span"),a.textContent="Save changes",p(r,"class","flex-fill"),p(a,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=f=!n[3]||n[2],ne(s,"btn-loading",n[2]),p(o,"class","flex")},m(b,v){H(e,b,v),w(b,t,v),h&&h.m(b,v),w(b,i,v),w(b,o,v),m(o,r),m(o,l),m(o,s),m(s,a),c=!0,u||(d=X(s,"click",n[12]),u=!0)},p(b,v){const _={};v&98305&&(_.$$scope={dirty:v,ctx:b}),e.$set(_),b[0].enabled?h?(h.p(b,v),v&1&&T(h,1)):(h=Cb(b),h.c(),T(h,1),h.m(i.parentNode,i)):h&&(Ae(),F(h,1,1,()=>{h=null}),De()),(!c||v&12&&f!==(f=!b[3]||b[2]))&&(s.disabled=f),v&4&&ne(s,"btn-loading",b[2])},i(b){c||(T(e.$$.fragment,b),T(h),c=!0)},o(b){F(e.$$.fragment,b),F(h),c=!1},d(b){q(e,b),b&&k(t),h&&h.d(b),b&&k(i),b&&k(o),u=!1,d()}}}function LD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function ID(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[15]),e.required=!0,p(o,"for",l=n[15])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[6]),s=!0)},p(f,c){c&32768&&t!==(t=f[15])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&32768&&l!==(l=f[15])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Cb(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C;return i=new je({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[RD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[ND,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{
|
||
|
<div class="breadcrumb-item">Files storage</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
|
||
|
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[4])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function VD(n,e,t){let i,o={},r=!1,l=!1,s="";B.setDocumentTitle("Files storage"),a();async function a(){t(1,r=!0);try{const S=await Se.Settings.getAll()||{};c(S)}catch(S){Se.errorResponseHandler(S)}t(1,r=!1)}async function f(){if(!(l||!i)){t(2,l=!0);try{const S=await Se.Settings.update(B.filterRedactedProps({s3:o}));c(S),Ui({}),hn("Successfully saved Files storage settings.")}catch(S){Se.errorResponseHandler(S)}t(2,l=!1)}}function c(S={}){t(0,o=(S==null?void 0:S.s3)||{}),t(5,s=JSON.stringify(o))}function u(){o.enabled=this.checked,t(0,o)}function d(){o.endpoint=this.value,t(0,o)}function h(){o.bucket=this.value,t(0,o)}function b(){o.region=this.value,t(0,o)}function v(){o.accessKey=this.value,t(0,o)}function _(S){n.$$.not_equal(o.secret,S)&&(o.secret=S,t(0,o))}const y=()=>f();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=s!=JSON.stringify(o))},[o,r,l,i,f,s,u,d,h,b,v,_,y]}class BD extends Ie{constructor(e){super(),Le(this,e,VD,qD,Ee,{})}}function UD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(o,"for",l=n[16])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[8]),s=!0)},p(f,c){c&65536&&t!==(t=f[16])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&65536&&l!==(l=f[16])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function xb(n){let e,t,i,o,r,l,s,a,f,c,u;return i=new je({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[WD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field "+(B.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[YD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field "+(B.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[GD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(r,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),u=!0},p(d,h){const b={};h&196609&&(b.$$scope={dirty:h,ctx:d}),i.$set(b);const v={};h&1&&(v.class="form-field "+(B.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),l.$set(v);const _={};h&1&&(_.class="form-field "+(B.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(_.$$scope={dirty:h,ctx:d}),f.$set(_)},i(d){u||(T(i.$$.fragment,d),T(l.$$.fragment,d),T(f.$$.fragment,d),d&&Dt(()=>{c||(c=ct(e,fn,{duration:150},!0)),c.run(1)}),u=!0)},o(d){F(i.$$.fragment,d),F(l.$$.fragment,d),F(f.$$.fragment,d),d&&(c||(c=ct(e,fn,{duration:150},!1)),c.run(0)),u=!1},d(d){d&&k(e),q(i),q(l),q(f),d&&c&&c.end()}}}function WD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Minimum password length"),o=$(),r=g("input"),p(e,"for",i=n[16]),p(r,"type","number"),p(r,"id",l=n[16]),r.required=!0,p(r,"min","5"),p(r,"max","200")},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].minPasswordLength),s||(a=X(r,"input",n[9]),s=!0)},p(f,c){c&65536&&i!==(i=f[16])&&p(e,"for",i),c&65536&&l!==(l=f[16])&&p(r,"id",l),c&1&&At(r.value)!==f[0].minPasswordLength&&Me(r,f[0].minPasswordLength)},d(f){f&&k(e),f&&k(
|
||
|
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&65536&&r!==(r=_[16]))&&p(e,"for",r);const S={};y&65536&&(S.id=_[16]),y&1&&(S.disabled=!B.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function GD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[11](_)}let v={id:n[16]+".config.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Only domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[16]+".config.onlyDomains"),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Email domains that are ONLY allowed to sign up.
|
||
|
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&65536&&r!==(r=_[16]+".config.onlyDomains"))&&p(e,"for",r);const S={};y&65536&&(S.id=_[16]+".config.onlyDomains"),y&1&&(S.disabled=!B.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function KD(n){let e,t,i,o;e=new je({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[UD,({uniqueId:l})=>({16:l}),({uniqueId:l})=>l?65536:0]},$$scope:{ctx:n}}});let r=n[0].enabled&&xb(n);return{c(){V(e.$$.fragment),t=$(),r&&r.c(),i=lt()},m(l,s){H(e,l,s),w(l,t,s),r&&r.m(l,s),w(l,i,s),o=!0},p(l,s){const a={};s&196609&&(a.$$scope={dirty:s,ctx:l}),e.$set(a),l[0].enabled?r?(r.p(l,s),s&1&&T(r,1)):(r=xb(l),r.c(),T(r,1),r.m(i.parentNode,i)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){o||(T(e.$$.fragment,l),T(r),o=!0)},o(l){F(e.$$.fragment,l),F(r),o=!1},d(l){q(e,l),l&&k(t),r&&r.d(l),l&&k(i)}}}function JD(n){let e;return{c(){e=g("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ZD(n){let e;return{c(){e=g("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mb(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),r=!0)},i(s){o||(Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function XD(n){let e,t,i,o,r,l,s;function a(d,h){return d[0].enabled?ZD:JD}let f=a(n),c=f(n),u=n[2]&&Mb();return{c(){e=g("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||
|
<span class="txt">Email/Password</span>`,t=$(),c.c(),i=$(),o=g("div"),r=$(),u&&u.c(),l=lt(),p(e,"class","inline-flex"),p(o,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),c.m(d,h),w(d,i,h),w(d,o,h),w(d,r,h),u&&u.m(d,h),w(d,l,h),s=!0},p(d,h){f!==(f=a(d))&&(c.d(1),c=f(d),c&&(c.c(),c.m(i.parentNode,i))),d[2]?u?h&4&&T(u,1):(u=Mb(),u.c(),T(u,1),u.m(l.parentNode,l)):u&&(Ae(),F(u,1,1,()=>{u=null}),De())},i(d){s||(T(u),s=!0)},o(d){F(u),s=!1},d(d){d&&k(e),d&&k(t),c.d(d),d&&k(i),d&&k(o),d&&k(r),u&&u.d(d),d&&k(l)}}}function QD(n){let e,t;const i=[n[3]];let o={$$slots:{header:[XD],default:[KD]},$$scope:{ctx:n}};for(let r=0;r<i.length;r+=1)o=ut(o,i[r]);return e=new dc({props:o}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){V(e.$$.fragment)},m(r,l){H(e,r,l),t=!0},p(r,[l]){const s=l&8?bn(i,[pi(r[3])]):{};l&131077&&(s.$$scope={dirty:l,ctx:r}),e.$set(s)},i(r){t||(T(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){n[12](null),q(e,r)}}}function eO(n,e,t){let i;const o=["config","expand","collapse","collapseSiblings"];let r=Wt(e,o),l;pn(n,go,x=>t(7,l=x));let{config:s={}}=e,a;function f(){a==null||a.expand()}function c(){a==null||a.collapse()}function u(){a==null||a.collapseSiblings()}function d(){s.enabled=this.checked,t(0,s)}function h(){s.minPasswordLength=At(this.value),t(0,s)}function b(x){n.$$.not_equal(s.exceptDomains,x)&&(s.exceptDomains=x,t(0,s))}function v(x){n.$$.not_equal(s.onlyDomains,x)&&(s.onlyDomains=x,t(0,s))}function _(x){he[x?"unshift":"push"](()=>{a=x,t(1,a)})}function y(x){ft.call(this,n,x)}function S(x){ft.call(this,n,x)}function C(x){ft.call(this,n,x)}return n.$$set=x=>{e=ut(ut({},e),ui(x)),t(3,r=Wt(e,o)),"config"in x&&t(0,s=x.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!B.isEmpty(l==null?void 0:l.emailPassword))},[s,a,i,r,f,c,u,l,d,h,b,v,_,y,S,C]}class tO extends Ie{constructor(e){super(),Le(this,e,eO,QD,Ee,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function nO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(o,"for",l=n[22])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[11]),s=!0)},p(f,c){c&4194304&&t!==(t=f[22])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&4194304&&l!==(l=f[22])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function $b(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;r=new je({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[iO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[oO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),u=new je({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[rO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Ab(n);return{c(){e=g("div"),t=g("div"),i=$(),o=g("div"),V(r.$$.fragment),l=$(),s=g("div"),V(a.$$.fragment),f=$(),c=g("div"),V(u.$$.fragment),d=$(),v&&v.c(),p(t,"class","col-12 spacing"),p(o,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),H(r,o,null),m(e,l),m(e,s),H(a,s,null),m(e,f),m(e,c),H(u,c,null),m(e,d),v&&v.m(e,null),b=!0},p(_,y){const S={};y&2&&(S.name=_[1]+".clientId"),y&12582913&&(S.$$scope={dirty:y,ctx:_}),r.$set(S);const C={};y&2&&(C.name=_[1]+".clientSecret"),y&12582913&&(C.$$scope={dirty:y,ctx:_}),a.$set(C);const x={};y&2&&(x.name=_[1]+".allowRegistrations"),y&12582913&&(x.$$scope={dirty:y,ctx:_}),u.$set(x),_[4]?v?(v.p(_,y),y&16&&T(v,1)):(v=Ab(_),v.c(),T(v,1),v.m(e,null)):v&&(Ae(),F(v,1,1,()=>{v=null}),De())},i(_){b||(T(r.$$.fragment,_),T(a.$$.fragment,_),T(u.$$.fragment,_),T(v),_&&Dt(()=>{h||(h=ct(e,fn,{duration:200},!0)),h.run(1)}),b=!0)},o(_){F(r.$$.fragment,_),F(a.$$.fragment,_),F(u.$$.fragment,_),F(v),_&&(h||(h=ct(e,fn,{duration:200},!1)),h.run(0)),b=!1},d(
|
||
|
<div class="breadcrumb-item">Auth providers</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[5])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function _O(n,e,t){let i,o,r={},l=!1,s=!1,a="";B.setDocumentTitle("Auth providers"),f();async function f(){t(2,l=!0);try{const C=await Se.Settings.getAll()||{};u(C)}catch(C){Se.errorResponseHandler(C)}t(2,l=!1)}async function c(){if(!(s||!i)){t(3,s=!0);try{const C=await Se.Settings.update(B.filterRedactedProps(r));u(C),Ui({}),o==null||o.collapseSiblings(),hn("Successfully updated auth providers.")}catch(C){Se.errorResponseHandler(C)}t(3,s=!1)}}function u(C){C=C||{},t(0,r={}),t(0,r.emailAuth=Object.assign({enabled:!0},C.emailAuth),r);const x=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of x)t(0,r[M]=Object.assign({enabled:!1,allowRegistrations:!0},C[M]),r);t(6,a=JSON.stringify(r))}function d(C){he[C?"unshift":"push"](()=>{o=C,t(1,o)})}function h(C){n.$$.not_equal(r.emailAuth,C)&&(r.emailAuth=C,t(0,r))}function b(C){n.$$.not_equal(r.googleAuth,C)&&(r.googleAuth=C,t(0,r))}function v(C){n.$$.not_equal(r.facebookAuth,C)&&(r.facebookAuth=C,t(0,r))}function _(C){n.$$.not_equal(r.githubAuth,C)&&(r.githubAuth=C,t(0,r))}function y(C){n.$$.not_equal(r.gitlabAuth,C)&&(r.gitlabAuth=C,t(0,r))}const S=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(r))},[r,o,l,s,i,c,a,d,h,b,v,_,y,S]}class vO extends Ie{constructor(e){super(),Le(this,e,_O,gO,Ee,{})}}function Tb(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function yO(n){let e=[],t=new Map,i,o,r,l,s,a,f,c,u,d,h=n[4];const b=v=>v[12].key;for(let v=0;v<h.length;v+=1){let _=Tb(n,h,v),y=b(_);t.set(y,e[v]=Eb(y,_))}return{c(){for(let v=0;v<e.length;v+=1)e[v].c();i=$(),o=g("div"),r=g("div"),l=$(),s=g("button"),a=g("span"),a.textContent="Save changes",p(r,"class","flex-fill"),p(a,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=f=!n[3]||n[2],ne(s,"btn-loading",n[2]),p(o,"class","flex")},m(v,_){for(let y=0;y<e.length;y+=1)e[y].m(v,_);w(v,i,_),w(v,o,_),m(o,r),m(o,l),m(o,s),m(s,a),c=!0,u||(d=X(s,"click",n[9]),u=!0)},p(v,_){_&32785&&(h=v[4],Ae(),e=st(e,_,b,1,v,h,t,i.parentNode,Pt,Eb,i,Tb),De()),(!c||_&12&&f!==(f=!v[3]||v[2]))&&(s.disabled=f),_&4&&ne(s,"btn-loading",v[2])},i(v){if(!c){for(let _=0;_<h.length;_+=1)T(e[_]);c=!0}},o(v){for(let _=0;_<e.length;_+=1)F(e[_]);c=!1},d(v){for(let _=0;_<e.length;_+=1)e[_].d(v);v&&k(i),v&&k(o),u=!1,d()}}}function kO(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function wO(n){let e,t=n[12].label+"",i,o,r,l,s,a,f,c,u,d,h;function b(){n[7].call(s,n[12])}function v(){return n[8](n[12])}return{c(){e=g("label"),i=j(t),o=j(" duration (in seconds)"),l=$(),s=g("input"),f=$(),c=g("div"),u=g("span"),u.textContent="Invalidate all previosly issued tokens",p(e,"for",r=n[15]),p(s,"type","number"),p(s,"id",a=n[15]),s.required=!0,p(u,"class","link-primary"),ne(u,"txt-success",n[0][n[12].key].secret),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,i),m(e,o),w(_,l,y),w(_,s,y),Me(s,n[0][n[12].key].duration),w(_,f,y),w(_,c,y),m(c,u),d||(h=[X(s,"input",b),X(u,"click",v)],d=!0)},p(_,y){n=_,y&32768&&r!==(r=n[15])&&p(e,"for",r),y&32768&&a!==(a=n[15])&&p(s,"id",a),y&17&&At(s.value)!==n[0][n[12].key].duration&&Me(s,n[0][n[12].key].duration),y&17&&ne(u,"txt-success",n[0][n[12].key].secret)},d(_){_&&k(e),_&&k(l),_&&k(s),_&&k(f),_&&k(c),d=!1,rt(h)}}}function Eb(n,e){let t,i,o;return i=new je({props:{class:"form-field required",
|
||
|
<div class="breadcrumb-item">Token options</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML="<p>Adjust common token options.</p>",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content m-b-sm txt-xl"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[5])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function CO(n,e,t){let i;const o=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];let r={},l=!1,s=!1,a="";B.setDocumentTitle("Token options"),f();async function f(){t(1,l=!0);try{const v=await Se.Settings.getAll()||{};u(v)}catch(v){Se.errorResponseHandler(v)}t(1,l=!1)}async function c(){if(!(s||!i)){t(2,s=!0);try{const v=await Se.Settings.update(B.filterRedactedProps(r));u(v),hn("Successfully saved tokens options.")}catch(v){Se.errorResponseHandler(v)}t(2,s=!1)}}function u(v){var _;v=v||{},t(0,r={});for(const y of o)t(0,r[y.key]={duration:((_=v[y.key])==null?void 0:_.duration)||0},r);t(6,a=JSON.stringify(r))}function d(v){r[v.key].duration=At(this.value),t(0,r)}const h=v=>{r[v.key].secret?(delete r[v.key].secret,t(0,r)):t(0,r[v.key].secret=B.randomString(50),r)},b=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(r))},[r,l,s,i,o,c,a,d,h,b]}class xO extends Ie{constructor(e){super(),Le(this,e,CO,SO,Ee,{})}}const MO={"/_elements":Zt({asyncComponent:()=>_i(()=>import("./Elements.c2e07307.js"),[])}),"/login":Zt({component:rD,conditions:[n=>!Se.AuthStore.isValid]}),"/request-password-reset":Zt({asyncComponent:()=>_i(()=>import("./PageAdminRequestPasswordReset.f5bd52f0.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>_i(()=>import("./PageAdminConfirmPasswordReset.a49a8974.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/collections":Zt({component:oA,conditions:[n=>Se.AuthStore.isValid]}),"/logs":Zt({component:mC,conditions:[n=>Se.AuthStore.isValid]}),"/users":Zt({component:AA,conditions:[n=>Se.AuthStore.isValid]}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmPasswordReset.b297807e.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmVerification.07c01eba.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmEmailChange.172a5083.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/settings":Zt({component:pD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/admins":Zt({component:JA,conditions:[n=>Se.AuthStore.isValid]}),"/settings/mail":Zt({component:PD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/storage":Zt({component:BD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/auth-providers":Zt({component:vO,conditions:[n=>Se.AuthStore.isValid]}),"/settings/tokens":Zt({component:xO,conditions:[n=>Se.AuthStore.isValid]}),"*":Zt({asyncComponent:()=>_i(()=>import("./NotFoundPage.8b4364cc.js"),[])})};function $O(n,{from:e,to:t},i={}){const o=getComputedStyle(n),r=o.transform==="none"?"":o.transform,[l,s]=o.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*l/t.width-(t.left+l),f=e.top+e.height*s/t.height-(t.top+s),{delay:c=0,duration:u=h=>Math.sqrt(h)*120,easing:d=As}=i;return{delay:c,duration:Yn(u)?u(Math.sqrt(a*a+f*f)):u,easing:d,css:(h,b)=>{const v=b*a,_=b*f,y=h+b*e.width/t.width,S=h+b*e.height/t.height;r
|
||
|
<span class="txt">Manage admins</span>`,t=$(),i=g("hr"),o=$(),r=g("div"),r.innerHTML=`<i class="ri-logout-circle-line"></i>
|
||
|
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,o,f),w(a,r,f),l||(s=[Xe(xn.call(null,e)),X(r,"click",n[3])],l=!0)},p:le,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(o),a&&k(r),l=!1,rt(s)}}}function zO(n){var u;let e,t,i,o,r,l,s,a,f,c=((u=n[0])==null?void 0:u.id)&&Lb(n);return o=new n_({props:{routes:MO}}),o.$on("routeLoading",n[1]),o.$on("conditionsFailed",n[2]),l=new PO({}),a=new NO({}),{c(){e=g("div"),c&&c.c(),t=$(),i=g("div"),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment),p(i,"class","app-body"),p(e,"class","app-layout")},m(d,h){w(d,e,h),c&&c.m(e,null),m(e,t),m(e,i),H(o,i,null),w(d,r,h),H(l,d,h),w(d,s,h),H(a,d,h),f=!0},p(d,[h]){var b;(b=d[0])!=null&&b.id?c?(c.p(d,h),h&1&&T(c,1)):(c=Lb(d),c.c(),T(c,1),c.m(e,t)):c&&(Ae(),F(c,1,1,()=>{c=null}),De())},i(d){f||(T(c),T(o.$$.fragment,d),T(l.$$.fragment,d),T(a.$$.fragment,d),f=!0)},o(d){F(c),F(o.$$.fragment,d),F(l.$$.fragment,d),F(a.$$.fragment,d),f=!1},d(d){d&&k(e),c&&c.d(),q(o),d&&k(r),q(l,d),d&&k(s),q(a,d)}}}function HO(n,e,t){let i;pn(n,qf,a=>t(0,i=a));let o;function r(a){var f,c;((f=a==null?void 0:a.detail)==null?void 0:f.location)!==o&&(o=(c=a==null?void 0:a.detail)==null?void 0:c.location,B.setDocumentTitle(""),Ui({}),A1())}function l(){Se.AuthStore.isValid?Ss("/"):Se.logout()}function s(){Se.logout()}return[i,r,l,s]}class qO extends Ie{constructor(e){super(),Le(this,e,HO,zO,Ee,{})}}new qO({target:document.getElementById("app")});export{ne as A,X as B,Gt as C,j as D,ge as E,QA as F,Me as G,B as H,rt as I,hn as J,Ss as K,lt as L,pn as M,Go as N,yo as O,yn as P,En as Q,di as R,Ie as S,Ai as a,he as b,Fe as c,$ as d,g as e,V as f,p as g,w as h,Le as i,m as j,Xe as k,Re as l,H as m,T as n,F as o,k as p,q,VO as r,Ee as s,St as t,le as u,xn as v,Ae as w,De as x,Se as y,je as z};
|