pocketbase/ui/dist/assets/index.0314b5be.js

364 lines
804 KiB
JavaScript
Raw Normal View History

2022-07-09 05:53:10 +08:00
const Nb=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}};Nb();function re(){}const zl=n=>n;function ct(n,e){for(const t in e)n[t]=e[t];return n}function Ng(n){return n()}function gf(){return Object.create(null)}function lt(n){n.forEach(Ng)}function Kn(n){return typeof n=="function"}function Pe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let sr;function Qn(n,e){return sr||(sr=document.createElement("a")),sr.href=e,n===sr.href}function Rb(n){return Object.keys(n).length===0}function Rg(n,...e){if(n==null)return re;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function pn(n,e,t){n.$$.on_destroy.push(Rg(e,t))}function On(n,e,t,i){if(n){const s=jg(n,e,t,i);return n[0](s)}}function jg(n,e,t,i){return n[1]&&i?ct(t.ctx.slice(),n[1](i(e))):t.ctx}function Tn(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],r=Math.max(e.dirty.length,s.length);for(let o=0;o<r;o+=1)l[o]=e.dirty[o]|s[o];return l}return e.dirty|s}return e.dirty}function Dn(n,e,t,i,s,l){if(s){const r=jg(e,t,i,l);n.p(r,s)}}function An(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 ci(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Yt(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 _f(n){return n==null?"":n}function Hg(n,e,t){return n.set(t),e}function Xe(n){return n&&Kn(n.destroy)?n.destroy:re}const qg=typeof window!="undefined";let yo=qg?()=>window.performance.now():()=>Date.now(),gu=qg?n=>requestAnimationFrame(n):re;const Fs=new Set;function Vg(n){Fs.forEach(e=>{e.c(n)||(Fs.delete(e),e.f())}),Fs.size!==0&&gu(Vg)}function vo(n){let e;return Fs.size===0&&gu(Vg),{promise:new Promise(t=>{Fs.add(e={c:n,f:t})}),abort(){Fs.delete(e)}}}function m(n,e){n.appendChild(e)}function zg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function jb(n){const e=_("style");return Hb(zg(n),e),e.sheet}function Hb(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 zn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function H(n){return document.createTextNode(n)}function O(){return H(" ")}function rt(){return H("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Jt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Bn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Bg(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 fi(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 Tt(n){return n===""?null:+n}function qb(n){return Array.from(n.childNodes)}function _e(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function $e(n,e){n.value=e==null?"":e}function bf(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 Ug(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");ret
`;for(let b=0;b<=1;b+=a){const v=e+(t-e)*l(b);u+=b*100+`%{${r(v,1-v)}}
`}const f=u+`100% {${r(t,1-t)}}
}`,c=`__svelte_${Vb(f)}_${o}`,d=zg(n),{stylesheet:h,rules:g}=Jr.get(d)||zb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const y=n.style.animation||"";return n.style.animation=`${y?`${y}, `:""}${c} ${i}ms linear ${s}ms 1 both`,xr+=1,c}function Pl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),xr-=s,xr||Bb())}function Bb(){gu(()=>{xr||(Jr.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),Jr.clear())})}function Ub(n,e,t,i){if(!e)return re;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return re;const{delay:l=0,duration:r=300,easing:o=zl,start:a=yo()+l,end:u=a+r,tick:f=re,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function y(){c&&(g=El(n,0,1,r,l,o,c)),l||(h=!0)}function b(){c&&Pl(n,g),d=!1}return vo(v=>{if(!h&&v>=a&&(h=!0),h&&v>=u&&(f(1,0),b()),!d)return!1;if(h){const S=v-a,C=0+1*o(S/r);f(C,1-C)}return!0}),y(),f(0,1),b}function Wb(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Wg(n,s)}}function Wg(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Ll;function kl(n){Ll=n}function ko(){if(!Ll)throw new Error("Function called outside component initialization");return Ll}function di(n){ko().$$.on_mount.push(n)}function Yb(n){ko().$$.after_update.push(n)}function Kb(n){ko().$$.on_destroy.push(n)}function vn(){const n=ko();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Ug(e,t,{cancelable:i});return s.slice().forEach(r=>{r.call(n,l)}),!l.defaultPrevented}return!0}}function ut(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ml=[],he=[],Nr=[],Da=[],Yg=Promise.resolve();let Aa=!1;function Kg(){Aa||(Aa=!0,Yg.then(Jg))}function Ui(){return Kg(),Yg}function Dt(n){Nr.push(n)}function Re(n){Da.push(n)}const No=new Set;let lr=0;function Jg(){const n=Ll;do{for(;lr<ml.length;){const e=ml[lr];lr++,kl(e),Jb(e.$$)}for(kl(null),ml.length=0,lr=0;he.length;)he.pop()();for(let e=0;e<Nr.length;e+=1){const t=Nr[e];No.has(t)||(No.add(t),t())}Nr.length=0}while(ml.length);for(;Da.length;)Da.pop()();Aa=!1,No.clear(),kl(n)}function Jb(n){if(n.fragment!==null){n.update(),lt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let el;function _u(){return el||(el=Promise.resolve(),el.then(()=>{el=null})),el}function us(n,e,t){n.dispatchEvent(Ug(`${e?"intro":"outro"}${t}`))}const Rr=new Set;let oi;function Te(){oi={r:0,c:[],p:oi}}function De(){oi.r||lt(oi.c),oi=oi.p}function E(n,e){n&&n.i&&(Rr.delete(n),n.i(e))}function F(n,e,t,i){if(n&&n.o){if(Rr.has(n))return;Rr.add(n),oi.c.push(()=>{Rr.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const bu={duration:0};function yu(n,e,t){let i=e(n,t),s=!1,l,r,o=0;function a(){l&&Pl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=zl,tick:g=re,css:y}=i||bu;y&&(l=El(n,0,1,d,c,h,y,o++)),g(0,1);const b=yo()+c,v=b+d;r&&r.abort(),s=!0,Dt(()=>us(n,!0,"start")),r=vo(S=>{if(s){if(S>=v)return g(1,0),us(n,!0,"end"),a(),s=!1;if(S>=b){const C=h((S-b)/d);g(C,1-C)}}return s})}let f=!1;return{start(){f||(f=!0,Pl(n),Kn(i)?(i=i(),_u().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function xg(n,e,t){let i=e(n,t),s=!0,l;const r=oi;r.r+=1;function o(){const{delay:a=0,duration:u=300,easing:f=zl,tick:c=re,css:d}=i||bu;d&&(l=El(n,1,0,u,a,f,d));const h=yo()+a,g=h+u;Dt(()=>us(n,!1,"start")),vo(y=>{if(s){if(y>=g)return c(0,1),us(n,!1,"end"),--r.r||lt(r.c),!1;if(y>=h){const b=f((y-h)/u);c(1-b,b)}}return s})}return Kn(i)?_u().then(()=>{i=i(),o()}):o(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&Pl(n,l),s=!1)}}}function ft(n,e,t,i){let s=e(n,t),l=i?0:1,r=nu
`),function(l){if(i=l.indexOf(":"),e=Ho.trim(l.substr(0,i)).toLowerCase(),t=Ho.trim(l.substr(i+1)),e){if(s[e]&&m1.indexOf(e)>=0)return;s[e]=e==="set-cookie"?(s[e]?s[e]:[]).concat([t]):s[e]?s[e]+", "+t:t}}),s},w1=g1,qo=s_,S1=function(n){return new Promise(function(e,t){var i=n.data,s=n.headers,l=n.responseType;ar.isFormData(i)&&delete s["Content-Type"];var r=new XMLHttpRequest;if(n.auth){var o=n.auth.username||"",a=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";s.Authorization="Basic "+btoa(o+":"+a)}var u=v1(n.baseURL,n.url);function f(){if(r){var d="getAllResponseHeaders"in r?k1(r.getAllResponseHeaders()):null,h={data:l&&l!=="text"&&l!=="json"?r.response:r.responseText,status:r.status,statusText:r.statusText,headers:d,config:n,request:r};_1(e,t,h),r=null}}if(r.open(n.method.toUpperCase(),y1(u,n.params,n.paramsSerializer),!0),r.timeout=n.timeout,"onloadend"in r?r.onloadend=f:r.onreadystatechange=function(){r&&r.readyState===4&&(r.status!==0||r.responseURL&&r.responseURL.indexOf("file:")===0)&&setTimeout(f)},r.onabort=function(){r&&(t(qo("Request aborted",n,"ECONNABORTED",r)),r=null)},r.onerror=function(){t(qo("Network Error",n,null,r)),r=null},r.ontimeout=function(){var d="timeout of "+n.timeout+"ms exceeded";n.timeoutErrorMessage&&(d=n.timeoutErrorMessage),t(qo(d,n,n.transitional&&n.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",r)),r=null},ar.isStandardBrowserEnv()){var c=(n.withCredentials||w1(u))&&n.xsrfCookieName?b1.read(n.xsrfCookieName):void 0;c&&(s[n.xsrfHeaderName]=c)}"setRequestHeader"in r&&ar.forEach(s,function(d,h){i===void 0&&h.toLowerCase()==="content-type"?delete s[h]:r.setRequestHeader(h,d)}),ar.isUndefined(n.withCredentials)||(r.withCredentials=!!n.withCredentials),l&&l!=="json"&&(r.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&r.addEventListener("progress",n.onDownloadProgress),typeof n.onUploadProgress=="function"&&r.upload&&r.upload.addEventListener("progress",n.onUploadProgress),n.cancelToken&&n.cancelToken.promise.then(function(d){r&&(r.abort(),t(d),r=null)}),i||(i=null),r.send(i)})},Qt=Ln,Df=function(n,e){u1.forEach(n,function(t,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(n[e]=t,delete n[i])})},C1=i_,M1={"Content-Type":"application/x-www-form-urlencoded"};function Af(n,e){!Qt.isUndefined(n)&&Qt.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}var Ef,qr={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(Ef=S1),Ef),transformRequest:[function(n,e){return Df(e,"Accept"),Df(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)?(Af(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):Qt.isObject(n)||e&&e["Content-Type"]==="application/json"?(Af(e,"application/json"),function(t,i,s){if(Qt.isString(t))try{return(i||JSON.parse)(t),Qt.trim(t)}catch(l){if(l.name!=="SyntaxError")throw l}return(s||JSON.stringify)(t)}(n)):n}],transformResponse:[function(n){var e=this.transitional,t=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,s=!t&&this.responseType==="json";if(s||i&&Qt.isString(n)&&n.length)try{return JSON.parse(n)}catch(l){if(s)throw l.name==="SyntaxError"?C1(l,this,"E_JSON_PARSE"):l}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300}};qr.headers={common:{Accept:"application/json, text/plain, */*"}},Qt.forEach(["delete","get","head"],function(n){qr.headers[n]={}}),Qt.forEach(["post","put","patch"],function(n){qr.headers[n]=Qt.merge(M1)});var vu=qr,$1=Ln,O1=vu,l_=function(n){return!(!n||!n.__CANCEL__)},Pf=Ln,Vo=function(n,e,t){var i=this||O1;return $1.forEach(t,function(s){n=s.call(i,n,e)}),n},T1=l_,D1=vu;function zo(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var sn=Ln,r_=function(n,e){e=e||{};var t={},i=["url","method","data"],s=
`+e.prev+e.base;return t+li.call(n,","+t)+`
`+e.prev}function dr(n,e){var t=Na(n),i=[];if(t){i.length=n.length;for(var s=0;s<n.length;s++)i[s]=Pi(n,s)?e(n[s],n):""}var l,r=typeof Go=="function"?Go(n):[];if(zs){l={};for(var o=0;o<r.length;o++)l["$"+r[o]]=r[o]}for(var a in n)Pi(n,a)&&(t&&String(Number(a))===a&&a<n.length||zs&&l["$"+a]instanceof Symbol||(g_.call(/[^\w$]/,a)?i.push(e(a,n)+": "+e(n[a],n)):i.push(a+": "+e(n[a],n))));if(typeof Go=="function")for(var u=0;u<r.length;u++)__.call(n,r[u])&&i.push("["+e(r[u])+"]: "+e(n[r[u]],n));return i}var k_,Ou=Su,Js=function(n,e){var t=h_(n,!!e);return typeof t=="function"&&Q1(n,".prototype.")>-1?m_(t):t},dy=function n(e,t,i,s){var l=t||{};if(Pi(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Pi(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var r=!Pi(l,"customInspect")||l.customInspect;if(typeof r!="boolean"&&r!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Pi(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Pi(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=l.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 v_(e,l);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return o?Yf(e,a):a}if(typeof e=="bigint"){var u=String(e)+"n";return o?Yf(e,u):u}var f=l.depth===void 0?5:l.depth;if(i===void 0&&(i=0),i>=f&&f>0&&typeof e=="object")return Na(e)?"[Array]":"[Object]";var c=function(R,J){var W;if(R.indent===" ")W=" ";else{if(!(typeof R.indent=="number"&&R.indent>0))return null;W=li.call(Array(R.indent+1)," ")}return{base:W,prev:li.call(Array(J+1),W)}}(l,i);if(s===void 0)s=[];else if(Gf(s,e)>=0)return"[Circular]";function d(R,J,W){if(J&&(s=ay.call(s)).push(J),W){var q={depth:l.depth};return Pi(l,"quoteStyle")&&(q.quoteStyle=l.quoteStyle),n(R,q,i+1,s)}return n(R,l,i+1,s)}if(typeof e=="function"&&!xf(e)){var h=function(R){if(R.name)return R.name;var J=ry.call(ly.call(R),/^function\s*([\w$]+)/);return J?J[1]:null}(e),g=dr(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(g.length>0?" { "+li.call(g,", ")+" }":"")}if(y_(e)){var y=zs?Ri.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fa.call(e);return typeof e!="object"||zs?y:il(y)}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 b="<"+zf.call(String(e.nodeName)),v=e.attributes||[],S=0;S<v.length;S++)b+=" "+v[S].name+"="+b_(uy(v[S].value),"double",l);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+zf.call(String(e.nodeName))+">"}if(Na(e)){if(e.length===0)return"[]";var C=dr(e,d);return c&&!function(R){for(var J=0;J<R.length;J++)if(Gf(R[J],`
`)>=0)return!1;return!0}(C)?"["+Ra(C,c)+"]":"[ "+li.call(C,", ")+" ]"}if(function(R){return!(Li(R)!=="[object Error]"||ln&&typeof R=="object"&&ln in R)}(e)){var M=dr(e,d);return"cause"in Error.prototype||!("cause"in e)||__.call(e,"cause")?M.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+li.call(M,", ")+" }":"{ ["+String(e)+"] "+li.call(Bf.call("[cause]: "+d(e.cause),M),", ")+" }"}if(typeof e=="object"&&r){if(Jf&&typeof e[Jf]=="function"&&Ia)return Ia(e,{depth:f-i});if(r!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(function(R){if(!fr||!R||typeof R!="object")return!1;try{fr.call(R);try{cr.call(R)}catch{return!0}return R instanceof Map}catch{}return!1}(e)){var $=[];return ty.call(e,function(R,J){$.push(d(J,e,!0)+" => "+d(R,e))}),Zf("Map",fr.call(e),$,c)}if(function(R){if(!cr||!R||typeof R!="object")return!1;try{cr.call(R);try{fr.call(R)}catch{return!0}return R instanceof Set}catch{}return!1}(e)){var T=[];return ny.call(e,function(R){T.push(d(R,e))}),Zf("Set",cr.call(e),T,c)}if(function(R){if(!tl||!R||typeof R!="object")return!1;try{tl.call(R,tl);try{nl.call(R,nl)}catch{return!0}return R instanceof WeakMap}catch{}return!1}(e))return Zo("WeakMap");if(function(R){if(!nl||!R||typeof R!="object")return!1;try{nl.call(R,nl);try{tl.call(R,tl)}catch{return!0}return R instanceof WeakSet}catch{}return!1}(e))return Zo("WeakSet");if(function(R){if(!Vf||!R||typeof R!="object")return!1;try{return Vf.call(R),!0}catch{}return!1}(e))return Zo("WeakRef");if(function(R){return!(Li(R)!=="[object Number]"||ln&&typeof R=="object"&&ln in R)}(e))return il(d(Number(e)));if(function(R){if(!R||typeof R!="object"||!xo)return!1;try{return xo.call(R),!0}catch{}return!1}(e))return il(d(xo.call(e)));if(function(R){return!(Li(R)!=="[object Boolean]"||ln&&typeof R=="object"&&ln in R)}(e))return il(iy.call(e));if(function(R){return!(Li(R)!=="[object String]"||ln&&typeof R=="object"&&ln in R)}(e))return il(d(String(e)));if(!function(R){return!(Li(R)!=="[object Date]"||ln&&typeof R=="object"&&ln in R)}(e)&&!xf(e)){var A=dr(e,d),D=Wf?Wf(e)===Object.prototype:e instanceof Object||e.constructor===Object,P=e instanceof Object?"":"null prototype",L=!D&&ln&&Object(e)===e&&ln in e?$u.call(Li(e),8,-1):P?"Object":"",N=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(L||P?"["+li.call(Bf.call([],L||[],P||[]),": ")+"] ":"");return A.length===0?N+"{}":c?N+"{"+Ra(A,c)+"}":N+"{ "+li.call(A,", ")+" }"}return String(e)},py=Ou("%TypeError%"),pr=Ou("%WeakMap%",!0),hr=Ou("%Map%",!0),hy=Js("WeakMap.prototype.get",!0),my=Js("WeakMap.prototype.set",!0),gy=Js("WeakMap.prototype.has",!0),_y=Js("Map.prototype.get",!0),by=Js("Map.prototype.set",!0),yy=Js("Map.prototype.has",!0),Xo=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},vy=String.prototype.replace,ky=/%20/g,Xf="RFC3986",Tu={default:Xf,formatters:{RFC1738:function(n){return vy.call(n,ky,"+")},RFC3986:function(n){return String(n)}},RFC1738:"RFC1738",RFC3986:Xf},wy=Tu,Qo=Object.prototype.hasOwnProperty,Gi=Array.isArray,ii=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),Qf=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},w_={arrayToObject:Qf,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 s=e[i],l=s.obj[s.prop],r=Object.keys(l),o=0;o<r.length;++o){var a=r[o],u=l[a];typeof u=="object"&&u!==null&&t.indexOf(u)===-1&&(e.push({obj:l,prop:a}),t.push(u))}return function(f){for(;f.length>1;){var c=f.pop(),d=c.obj[c.prop];if(Gi(d)){for(var h=[],g=0;g<d.length;++g)d[g]!==void 0&&h.push(d[g]);c.obj[c.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,s){if(n.length===0)return n;v
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function un(n,{delay:e=0,duration:t=400,easing:i=To}={}){const s=getComputedStyle(n),l=+s.opacity,r=parseFloat(s.height),o=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*r}px;padding-top: ${h*o}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Un(n,{delay:e=0,duration:t=400,easing:i=To,start:s=0,opacity:l=0}={}){const r=getComputedStyle(n),o=+r.opacity,a=r.transform==="none"?"":r.transform,u=1-s,f=o*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${o-f*d}
2022-07-09 16:16:35 +08:00
`}}function Kk(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,r){w(l,e,r),n[13](e),$e(e,n[7]),i||(s=X(e,"input",n[14]),i=!0)},p(l,r){r&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),r&128&&e.value!==l[7]&&$e(e,l[7])},i:re,o:re,d(l){l&&k(e),n[13](null),i=!1,s()}}}function Jk(n){let e,t,i,s;function l(a){n[12](a)}var r=n[4];function o(a){let u={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return r&&(e=new r(o(n)),he.push(()=>Fe(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=rt()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],Re(()=>t=!1)),r!==(r=a[4])){if(e){Te();const c=e;F(c.$$.fragment,1,0,()=>{z(c,1)}),De()}r?(e=new r(o(a)),he.push(()=>Fe(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else r&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&F(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&z(e,a)}}}function Ac(n){let e,t,i,s,l,r,o=n[7]!==n[0]&&Ec();return{c(){o&&o.c(),e=O(),t=_("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,u){o&&o.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(r=X(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?o?u&129&&E(o,1):(o=Ec(),o.c(),E(o,1),o.m(e.parentNode,e)):o&&(Te(),F(o,1,1,()=>{o=null}),De())},i(a){s||(E(o),Dt(()=>{i||(i=ft(t,ti,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){F(o),i||(i=ft(t,ti,{duration:150,x:5},!1)),i.run(0),s=!1},d(a){o&&o.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,r()}}}function Ec(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ft(e,ti,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=ft(e,ti,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function xk(n){let e,t,i,s,l,r,o,a,u,f,c;const d=[Jk,Kk],h=[];function g(b,v){return b[4]&&!b[5]?0:1}r=g(n),o=h[r]=d[r](n);let y=(n[0].length||n[7].length)&&Ac(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=O(),o.c(),a=O(),y&&y.c(),p(s,"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(b,v){w(b,e,v),m(e,t),m(t,i),m(i,s),m(t,l),h[r].m(t,null),m(t,a),y&&y.m(t,null),u=!0,f||(c=[X(t,"submit",Jt(n[10])),X(e,"click",Bn(n[11]))],f=!0)},p(b,[v]){let S=r;r=g(b),r===S?h[r].p(b,v):(Te(),F(h[S],1,1,()=>{h[S]=null}),De(),o=h[r],o?o.p(b,v):(o=h[r]=d[r](b),o.c()),E(o,1),o.m(t,a)),b[0].length||b[7].length?y?(y.p(b,v),v&129&&E(y,1)):(y=Ac(b),y.c(),E(y,1),y.m(t,null)):y&&(Te(),F(y,1,1,()=>{y=null}),De())},i(b){u||(E(o),E(y),u=!0)},o(b){F(o),F(y),u=!1},d(b){b&&k(e),h[r].d(),y&&y.d(),f=!1,lt(c)}}}function Gk(n,e,t){const i=vn(),s="search_"+U.randomString(7);let{value:l=""}=e,{placeholder:r='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:o=new Pn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h($=!0){t(7,d=""),$&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function y(){u||f||(t(5,f=!0),t(4,u=(await bi(()=>import("./FilterAutocompleteInput.2d75cd85.js"),[])).default),t(5,f=!1))}di(()=>{y()});function b($){ut.call(this,n,$)}function v($){d=$,t(7,d),t(0,l)}function S($){he[$?"unshift":"push"](()=>{c=$,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const M=()=>{h(!1),g()};return n.$$set=$=>{"value"in $&&t(0,l=$.value),"placeholder"in $&&t(1,r=$.placeholder),"autocompleteCollection"in $&&t(2,o=$.autocompleteCollection),"extraAutocompleteKeys"in $&&t(3,a=$.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,r,o,a,u,f,c,d,s,h,g,b,v,S,C,M]}class Do extends Ne{constructor(e){super(),Ie(this,e,Gk,xk,Pe,{value:0
2022-07-09 05:53:10 +08:00
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function s2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="url",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function l2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="referer",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function r2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="status",p(t,"class",U.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function o2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function Lc(n){let e;function t(l,r){return l[6]?u2:a2}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function a2(n){var o;let e,t,i,s,l,r=((o=n[0])==null?void 0:o.length)&&Fc(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),r&&r.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?r?r.p(a,u):(r=Fc(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function u2(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Fc(n){let e,t,i;return{c(){e=_("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(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Ic(n){let e;return{c(){e=_("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 Nc(n,e){var se,G,Oe;let t,i,s,l=((se=e[21].method)==null?void 0:se.toUpperCase())+"",r,o,a,u,f,c=e[21].url+"",d,h,g,y,b,v,S=(e[21].referer||"N/A")+"",C,M,$,T,A,D=e[21].status+"",P,L,N,R,J,W,q,x,K,Y,te=(((G=e[21].meta)==null?void 0:G.errorMessage)||((Oe=e[21].meta)==null?void 0:Oe.errorData))&&Ic();R=new Ci({props:{date:e[21].created}});function fe(){return e[16](e[21])}function ye(...ee){return e[17](e[21],...ee)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),r=H(l),a=O(),u=_("td"),f=_("span"),d=H(c),g=O(),te&&te.c(),y=O(),b=_("td"),v=_("span"),C=H(S),$=O(),T=_("td"),A=_("span"),P=H(D),L=O(),N=_("td"),B(R.$$.fragment),J=O(),W=_("td"),W.innerHTML='<i class="ri-arrow-right-line"></i>',q=O(),p(s,"class",o="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(v,"class","txt txt-ellipsis"),p(v,"title",M=e[21].referer),ne(v,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(A,"class","label"),ne(A,"label-danger",e[21].status>=400),p(T,"class","col-type-number col-field-status"),p(N,"class","col-type-date col-field-created"),p(W,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,be){w(ee,t,be),m(t,i),m(i,s),m(s,r),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),te&&te.m(u,null),m(t,y),m(t,b),m(b,v),m(v,C),m(t,$),m(t,T),m(T,A),m(A,P),m(t,L),m(t,N),V(R,N,null),m(t,J),m(t,W),m(t,q),x=!0,K||(Y=[X(t,"click",fe),X(t,"keydown",ye)],K=!0)},p(ee,be){var ie,ve,je;e=ee,(!x||be&8)&&l!==(l=((ie=e[21].method)==null?void 0:ie.toUpperCase())+"")&&_e(r,l),(!x||be&8&&o!==(o="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",o),(!x||be&8)&&c!==(c=e[21].url+"")&&_e(d,c),(!x||be&8&&h!==(h=e[21].url))&&p(f,"title",h),((ve=e[21].meta)==null?void 0:ve.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?te||(te=Ic(),te.c(),te.m(u,null)):te&&(te.d(1),te=null),(!x||be&8)&&S!==(S=(e[21].referer||"N/A")+"")&&_e(C,S),(!x||be&8&&M!==(M=e[21].referer))&&p(v,"title",M),be&8&&ne(v,"txt-hint",!e[21].referer),(!x||be&8)&&D!==(D=e[21].status+"")&&_e(P,D),be&8&&ne(A,"label-danger",e[21].status>=400);const ue={};be&8&&(ue.date=e[21].created),R.$set(ue)},i(ee){x||(E(R.$$.fragment,ee),x=!0)},o(ee){F(R.$$.fragment,ee),x=!1},d(ee){ee&&k(t),te&&te.d(),z(R),K=!1,lt(Y)}}}function Rc(n){let e,t,i=n[3].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a&8&&i!==(i=o[3].length+"")&&_e(s,i),a&16&&_e(r,o[4])},d(o){o&&k(e)}}}function jc(n){let e,t,i,s,l=n[4]-n[3].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),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(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=X(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&_e(r,l),c&64&&ne(t,"btn-loading",f[6]),c&64&&ne(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function f2(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C,M,$,T,A=[],D=new Map,P,L,N,R;function J(ie){n[11](ie)}let W={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[i2]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),l=new en({props:W}),he.push(()=>Fe(l,"sort",J));function q(ie){n[12](ie)}let x={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 E0=function(){return typeof window=="undefined"?function(n){return n()}:window.requestAnimationFrame}();function P0(n,e,t){const i=t||(r=>Array.prototype.slice.call(r));let s=!1,l=[];return function(...r){l=i(r),s||(s=!0,E0.call(window,()=>{s=!1,n.apply(e,l)}))}}function p2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const h2=n=>n==="start"?"left":n==="end"?"right":"center",Hc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function mi(){}const m2=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n=="undefined"}function Pt(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 Vt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Vt(n)?n:e}function ht(n,e){return typeof n=="undefined"?e:n}const g2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,L0=(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 s,l,r;if(Pt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(dt(n))for(r=Object.keys(n),l=r.length,s=0;s<l;s++)e.call(t,n[r[s]],r[s])}function lo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function ro(n){if(Pt(n))return n.map(ro);if(dt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=ro(n[t[s]]);return e}return n}function F0(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function _2(n,e,t,i){if(!F0(n))return;const s=e[n],l=t[n];dt(s)&&dt(l)?Fl(s,l,i):e[n]=ro(l)}function Fl(n,e,t){const i=Pt(e)?e:[e],s=i.length;if(!dt(n))return n;t=t||{};const l=t.merger||_2;for(let r=0;r<s;++r){if(e=i[r],!dt(e))continue;const o=Object.keys(e);for(let a=0,u=o.length;a<u;++a)l(o[a],n,e,t)}return n}function Ml(n,e){return Fl(n,e,{merger:b2})}function b2(n,e,t){if(!F0(n))return;const i=e[n],s=t[n];dt(i)&&dt(s)?Ml(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ro(s))}const y2="",v2=".";function qc(n,e){const t=n.indexOf(v2,e);return t===-1?n.length:t}function zi(n,e){if(e===y2)return n;let t=0,i=qc(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=qc(e,t);return n}function zu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n!="undefined",Bi=n=>typeof n=="function",Vc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function k2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ht=Math.PI,Et=2*Ht,w2=Et+Ht,oo=Number.POSITIVE_INFINITY,S2=Ht/180,jt=Ht/2,al=Ht/4,zc=Ht*2/3,qn=Math.log10,ai=Math.sign;function Bc(n){const e=Math.round(n);n=$l(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(qn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function C2(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((s,l)=>s-l).pop(),e}function Il(n){return!isNaN(parseFloat(n))&&isFinite(n)}function $l(n,e,t){return Math.abs(n-e)<t}function M2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function I0(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Xn(n){return n*(Ht/180)}function Bu(n){return n*(180/Ht)}function Uc(n){if(!Vt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function N0(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Ht&&(l+=Et),{angle:l,distance:s}}function Qa(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function $2(n,e){return(n-e+w2)%Et-Ht}function Cn(n){return(n%Et+Et)%Et}function Nl(n,e,t,i){const s=Cn(n),l=Cn(e),r=Cn(t),o=Cn(l-s),a=Cn(r-s),u=Cn(s-l),f=Cn(s-r);return s===l||s===r||i&&l===r||o
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function xl(n){return n+.5|0}const ji=(n,e,t)=>Math.max(Math.min(n,t),e);function yl(n){return ji(xl(n*2.55),0,255)}function Vi(n){return ji(xl(n*255),0,255)}function vi(n){return ji(xl(n/2.55)/100,0,1)}function Kc(n){return ji(xl(n*100),0,100)}const Nn={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},eu=[..."0123456789ABCDEF"],T2=n=>eu[n&15],D2=n=>eu[(n&240)>>4]+eu[n&15],kr=n=>(n&240)>>4===(n&15),A2=n=>kr(n.r)&&kr(n.g)&&kr(n.b)&&kr(n.a);function E2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const P2=(n,e)=>n<255?e(n):"";function L2(n){var e=A2(n)?T2:D2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+P2(n.a,e):void 0}const F2=/^(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),s=(l,r=(l+n/30)%12)=>t-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function I2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function N2(n,e,t){const i=R0(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function R2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Uu(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),r=Math.min(t,i,s),o=(l+r)/2;let a,u,f;return l!==r&&(f=l-r,u=o>.5?f/(2-l-r):f/(l+r),a=R2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,o]}function Wu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Vi)}function Yu(n,e,t){return Wu(R0,n,e,t)}function j2(n,e,t){return Wu(N2,n,e,t)}function H2(n,e,t){return Wu(I2,n,e,t)}function j0(n){return(n%360+360)%360}function q2(n){const e=F2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?yl(+e[5]):Vi(+e[5]));const s=j0(+e[2]),l=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?i=j2(s,l,r):e[1]==="hsv"?i=H2(s,l,r):i=Yu(s,l,r),{r:i[0],g:i[1],b:i[2],a:t}}function V2(n,e){var t=Uu(n);t[0]=j0(t[0]+e),t=Yu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function z2(n){if(!n)return;const e=Uu(n),t=e[0],i=Kc(e[1]),s=Kc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${vi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Jc={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"},xc={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 Kw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],r=t.duration;l.forEach(o=>o({chart:e,initial:t.initial,numSteps:r,currentStep:Math.min(i-t.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=E0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let r=l.length-1,o=!1,a;for(;r>=0;--r)a=l[r],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),o=!0):(l[r]=l[l.length-1],l.pop());o&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.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,s)=>Math.max(i,s._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 s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var gi=new Kw;const ad="transparent",Jw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Zc(n||ad),s=i.valid&&Zc(e||ad);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class xw{constructor(e,t,i,s){const l=t[i];s=Cr([e.to,s,l,e.from]);const r=Cr([e.from,l,s]);this._active=!0,this._fn=e.fn||Jw[e.type||typeof r],this._easing=Ol[e.easing]||Ol.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=r,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,r=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Cr([e.to,t,s,e.from]),this._from=Cr([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,r=this._loop,o=this._to;let a;if(this._active=l!==o&&(r||t<i),!this._active){this._target[s]=o,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,o,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 s=0;s<i.length;s++)i[s][t]()}}const Gw=["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:Gw}});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 tb{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 s=e[i];if(!dt(s))return;const l={};for(co
`)>-1?n.split(`
`):n}function g3(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:r,value:o}=l.getLabelAndValue(s);return{chart:n,label:r,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function jd(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:r,boxHeight:o}=e,a=$n(e.bodyFont),u=$n(e.titleFont),f=$n(e.footerFont),c=l.length,d=s.length,h=i.length,g=Yn(e.padding);let y=g.height,b=0,v=i.reduce((M,$)=>M+$.before.length+$.lines.length+$.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,c&&(y+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),v){const M=e.displayColors?Math.max(o,a.lineHeight):a.lineHeight;y+=h*M+(v-h)*a.lineHeight+(v-1)*e.bodySpacing}d&&(y+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(M){b=Math.max(b,t.measureText(M).width+S)};return t.save(),t.font=u.string,Ct(n.title,C),t.font=a.string,Ct(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?r+2+e.boxPadding:0,Ct(i,M=>{Ct(M.before,C),Ct(M.lines,C),Ct(M.after,C)}),S=0,t.font=f.string,Ct(n.footer,C),t.restore(),b+=g.width,{width:b,height:y}}function _3(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function b3(n,e,t,i){const{x:s,width:l}=i,r=t.caretSize+t.caretPadding;if(n==="left"&&s+l+r>e.width||n==="right"&&s-l-r<0)return!0}function y3(n,e,t,i){const{x:s,width:l}=t,{width:r,chartArea:{left:o,right:a}}=n;let u="center";return i==="center"?u=s<=(o+a)/2?"left":"right":s<=l/2?u="left":s>=r-l/2&&(u="right"),b3(u,n,e,t)&&(u="center"),u}function Hd(n,e,t){const i=t.yAlign||e.yAlign||_3(n,t);return{xAlign:t.xAlign||e.xAlign||y3(n,e,t,i),yAlign:i}}function v3(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function k3(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function qd(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:r}=n,{xAlign:o,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=js(r);let g=v3(e,o);const y=k3(e,a,u);return a==="center"?o==="left"?g+=u:o==="right"&&(g-=u):o==="left"?g-=Math.max(f,d)+s:o==="right"&&(g+=Math.max(c,h)+s),{x:on(g,0,i.width-e.width),y:on(y,0,i.height-e.height)}}function Er(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Vd(n){return si([],_i(n))}function w3(n,e,t){return Yi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function zd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class uu extends Oi{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()),s=i.enabled&&t.options.animation&&i.animations,l=new tb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=w3(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),r=i.afterTitle.apply(this,[e]);let o=[];return o=si(o,_i(s)),o=si(o,_i(l)),o=si(o,_i(r)),o}getBeforeBody(e,t){return Vd(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Ct(e,l=>{const r={before:[],lines:[],after:[]},o=zd(i,l);si(r.before,_i(o.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.1.0
* https://www.chartjs.org
* (c) 2021 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const B3={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"}};lb._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},formats:function(){return B3},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 Gd(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ft(e,Un,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=ft(e,Un,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function U3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=H(n[1]),t=O(),s=H(i)},m(l,r){w(l,e,r),w(l,t,r),w(l,s,r)},p(l,r){r&2&&_e(e,l[1]),r&2&&i!==(i=l[1]===1?"log":"logs")&&_e(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function W3(n){let e;return{c(){e=H("Loading...")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Y3(n){let e,t,i,s,l,r,o=n[2]&&Gd();function a(c,d){return c[2]?W3:U3}let u=a(n),f=u(n);return{c(){e=_("div"),o&&o.c(),t=O(),i=_("canvas"),s=O(),l=_("div"),f.c(),p(i,"class","chart-canvas svelte-vh4sl8"),bf(i,"height","250px"),bf(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ne(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),r=!0},p(c,[d]){c[2]?o?d&4&&E(o,1):(o=Gd(),o.c(),E(o,1),o.m(e,t)):o&&(Te(),F(o,1,1,()=>{o=null}),De()),d&4&&ne(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){r||(E(o),r=!0)},o(c){F(o),r=!1},d(c){c&&k(e),o&&o.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function K3(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,r,o=[],a=0,u=!1;async function f(){return t(2,u=!0),Se.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)o.push({x:U.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);o.push({x:new Date,y:void 0})}).catch(h=>{h!==null&&(c(),console.warn(h),Se.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,o=[])}di(()=>(go.register(Ki,Po,Xl,ff,er,m3,S3),t(6,r=new go(l,{type:"line",data:{datasets:[{label:"Total requests",data:o,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}}}})),()=>r==null?void 0:r.destroy()));function d(h){he[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i!="undefined"||typeof s!="undefined")&&f(),n.$$.dirty&192&&typeof o!="undefined"&&r&&(t(6,r.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 s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,r={},o={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,"&amp;").replace(/</g,"&lt;").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:++l}),S.__id},clone:function S(C,M){M=M||{};var $,T;switch(o.util.type(C)){case"Object":if(T=o.util.objId(C),M[T])return M[T];$={},M[T]=$;for(var A in C)C.hasOwnProperty(A)&&($[A]=S(C[A],M));return $;case"Array":return T=o.util.objId(C),M[T]?M[T]:($=[],M[T]=$,C.forEach(function(D,P){$[P]=S(D,M)}),$);default:return C}},getLanguage:function(S){for(;S;){var C=s.exec(S.className);if(C)return C[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,C){S.className=S.className.replace(RegExp(s,"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($){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec($.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var M in C)if(C[M].src==S)return C[M]}return null}},isActive:function(S,C,M){for(var $="no-"+C;S;){var T=S.classList;if(T.contains(C))return!0;if(T.contains($))return!1;S=S.parentElement}return!!M}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(S,C){var M=o.util.clone(o.languages[S]);for(var $ in C)M[$]=C[$];return M},insertBefore:function(S,C,M,$){$=$||o.languages;var T=$[S],A={};for(var D in T)if(T.hasOwnProperty(D)){if(D==C)for(var P in M)M.hasOwnProperty(P)&&(A[P]=M[P]);M.hasOwnProperty(D)||(A[D]=T[D])}var L=$[S];return $[S]=A,o.languages.DFS(o.languages,function(N,R){R===L&&N!=S&&(this[N]=A)}),A},DFS:function S(C,M,$,T){T=T||{};var A=o.util.objId;for(var D in C)if(C.hasOwnProperty(D)){M.call(C,D,C[D],$||D);var P=C[D],L=o.util.type(P);L==="Object"&&!T[A(P)]?(T[A(P)]=!0,S(P,M,null,T)):L==="Array"&&!T[A(P)]&&(T[A(P)]=!0,S(P,M,D,T))}}},plugins:{},highlightAll:function(S,C){o.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,M){var $={callback:M,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",$),$.elements=Array.prototype.slice.apply($.container.querySelectorAll($.selector)),o.hooks.run("before-all-elements-highlight",$);for(var T=0,A;A=$.elements[T++];)o.highlightElement(A,C===!0,$.callback)},highlightElement:function(S,C,M){var $=o.util.getLanguage(S),T=o.languages[$];o.util.setLanguage(S,$);var A=S.parentElement;A&&A.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(A,$);var D=S.textContent,P={element:S,language:$,grammar:T,code:D};function L(R){P.highlightedCode=R,o.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,o.hooks.run("after-highlight",P),o.hooks.run("complete",P),M&&M.call(P.element)}if(o.hooks.run("before-sanity-check",P),A=P.element.parentElement,A&&A.nodeName.toLowerCase()==="pre"&&!A.hasAttribute("tabindex")&&A.setAttribute("tabindex","0"),!P.code){o.hooks.run("complete",P),M&&M.call(P.element);return}if(o.hooks.run("before-highlight",P),!P.grammar){L(o.util.encode(P.code));return}if(C&&i.Worker){var N=new Worker(o.filename);N.onmessage=function(R){L(R.data)},N.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else L(o.highlight(P.code,P.grammar,P.language))},highlight:function(S,C,M){var $={code:S,grammar:C,language:M};if(o.hooks.run("before-tokenize",$),!$.grammar)throw new Error('The language "'+$.language+'" has no grammar.');return $.tokens=o.tokenize($.code,$.grammar),o.hooks.run("after-tokenize",$),a.stringify(o.util.encode($.tokens),$.language)},tokenize:function(S,C){var M=C.rest;if(M){for(var $ in M)C[$]=M[$];delete C.rest}var T=new c;return d(T,T.head,S),f(S,T,C,T.head,0),g(T)},hooks:{all:{},add
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}v.textContent=T,t.highlightElement(v)},function(T){b.setAttribute(o,f),v.textContent=T})}}),t.plugins.fileHighlight={highlight:function(b){for(var v=(b||document).querySelectorAll(c),S=0,C;C=v[S++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})($b);var hl=$b.exports,x3={exports:{}};(function(n){(function(){if(typeof Prism=="undefined")return;var e=Object.assign||function(l,r){for(var o in r)r.hasOwnProperty(o)&&(l[o]=r[o]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(r,o){return o.toUpperCase()})}function s(l){for(var r=0,o=0;o<l.length;++o)l.charCodeAt(o)==" ".charCodeAt(0)&&(r+=3);return l.length+r}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,r){r=e(this.defaults,r);for(var o in r){var a=i(o);o!=="normalize"&&a!=="setDefaults"&&r[o]&&this[a]&&(l=this[a].call(this,l,r[o]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,r){return r=r|0||4,l.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(l,r){return r=r|0||4,l.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var r=l.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(o,a){return o.length-a.length}),!r[0].length)?l:l.replace(RegExp("^"+r[0],"gm"),"")},indent:function(l,r){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(l,r){r=r===!0?80:r|0||80;for(var o=l.split(`
`),a=0;a<o.length;++a)if(!(s(o[a])<=r)){for(var u=o[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>r&&(u[c]=`
`+u[c],f=d)}o[a]=u.join("")}return o.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(l){var r=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=r.normalize(l.code,l.settings);return}var o=l.element.parentNode;if(!(!l.code||!o||o.nodeName.toLowerCase()!=="pre")){for(var a=o.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var h=a[d];h==l.element?c=!0:h.nodeName==="#text"&&(c?f+=h.nodeValue:u+=h.nodeValue,o.removeChild(h),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=r.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=r.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(x3);function G3(n){let e,t;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-tv7jme"),p(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:re,o:re,d(i){i&&k(e)}}}function Z3(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function r(o){return o=typeof o=="string"?o:"",o=hl.plugins.NormalizeWhitespace.normalize(o,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),hl.highlight(o,hl.languages[s]||hl.languages.javascript,s)}return n.$$set=o=>{"content"in o&&t(1,i=o.content),"language"in o&&t(2,s=o.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof hl!="undefined"&&i&&t(0,l=r(i))},[l,i,s]}class tn extends Ne{constructor(e){super(),Ie(this,e,Z3,G3,Pe,{content:1,language:2})}}const X3=n=>({}),Xd=n=>({}),Q3=n=>({}),Qd=n=>({});function ep(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C=n[4]&&!n[2]&&tp(n);const M=n[18].header,$=On(M,n,n[17],Qd);let T=n[4]&&n[2]&&np(n);const A=n[18].default,D=On(A,n,n[17],null),P=n[18].footer,L=On(P,n,n[17],Xd);return{c(){e=_("div"),t=_("div"),s=O(),l=_("div"),r=_("div"),C&&C.c(),o=O(),$&&$.c(),a=O(),T&&T.c(),u=O(),f=_("div"),D&&D.c(),c=O(),d=_("div"),L&&L.c(),p(t,"class","overlay"),p(r,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),ne(l,"popup",n[2]),p(e,"class","overlay-panel-container"),ne(e,"padded",n[2]),ne(e,"active",n[0])},m(N,R){w(N,e,R),m(e,t),m(e,s),m(e,l),m(l,r),C&&C.m(r,null),m(r,o),$&&$.m(r,null),m(r,a),T&&T.m(r,null),m(l,u),m(l,f),D&&D.m(f,null),n[20](f),m(l,c),m(l,d),L&&L.m(d,null),b=!0,v||(S=[X(t,"click",Jt(n[19])),X(f,"scroll",n[21])],v=!0)},p(N,R){n=N,n[4]&&!n[2]?C?C.p(n,R):(C=tp(n),C.c(),C.m(r,o)):C&&(C.d(1),C=null),$&&$.p&&(!b||R&131072)&&Dn($,M,n,n[17],b?Tn(M,n[17],R,Q3):An(n[17]),Qd),n[4]&&n[2]?T?T.p(n,R):(T=np(n),T.c(),T.m(r,null)):T&&(T.d(1),T=null),D&&D.p&&(!b||R&131072)&&Dn(D,A,n,n[17],b?Tn(A,n[17],R,null):An(n[17]),null),L&&L.p&&(!b||R&131072)&&Dn(L,P,n,n[17],b?Tn(P,n[17],R,X3):An(n[17]),Xd),(!b||R&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),R&262&&ne(l,"popup",n[2]),R&4&&ne(e,"padded",n[2]),R&1&&ne(e,"active",n[0])},i(N){b||(Dt(()=>{i||(i=ft(t,so,{duration:Es,opacity:0},!0)),i.run(1)}),E($,N),E(D,N),E(L,N),Dt(()=>{y&&y.end(1),g=yu(l,ti,n[2]?{duration:Es,y:-10}:{duration:Es,x:50}),g.start()}),b=!0)},o(N){i||(i=ft(t,so,{duration:Es,opacity:0},!1)),i.run(0),F($,N),F(D,N),F(L,N),g&&g.invalidate(),y=xg(l,ti,n[2]?{duration:Es,y:10}:{duration:Es,x:50}),b=!1},d(N){N&&k(e),N&&i&&i.end(),C&&C.d(),$&&$.d(N),T&&T.d(),D&&D.d(N),n[20](null),L&&L.d(N),N&&y&&y.end(),v=!1,lt(S)}}}function tp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=X(e,"click",Jt(n[5])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function np(n){let e,t,i;return{c(){e=_("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(s,l){w(s,e,l),t||(i=X(e,"click",Jt
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&16&&l!==(l=b[4]))&&p(e,"for",l);const S={};v&16&&(S.id=b[4]),v&1&&(S.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&v&1&&(a=!0,S.value=b[0].exceptDomains,Re(()=>a=!1)),o.$set(S)},i(b){c||(E(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function lM(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[3](b)}let y={id:n[4]+".options.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(y.value=n[0].onlyDomains),o=new vs({props:y}),he.push(()=>Fe(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:`Domains that are ONLY allowed as value.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const S={};v&16&&(S.id=b[4]+".options.onlyDomains"),v&1&&(S.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&v&1&&(a=!0,S.value=b[0].onlyDomains,Re(()=>a=!1)),o.$set(S)},i(b){c||(E(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function rM(n){let e,t,i,s,l,r,o;return i=new He({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[sM,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[lM,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),o=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),r.$set(c)},i(a){o||(E(i.$$.fragment,a),E(r.$$.fragment,a),o=!0)},o(a){F(i.$$.fragment,a),F(r.$$.fragment,a),o=!1},d(a){a&&k(e),z(i),z(r)}}}function oM(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(o){n.$$.not_equal(s.exceptDomains,o)&&(s.exceptDomains=o,t(0,s))}function r(o){n.$$.not_equal(s.onlyDomains,o)&&(s.onlyDomains=o,t(0,s))}return n.$$set=o=>{"key"in o&&t(1,i=o.key),"options"in o&&t(0,s=o.options)},[s,i,l,r]}class Ab extends Ne{constructor(e){super(),Ie(this,e,oM,rM,Pe,{key:1,options:0})}}function aM(n){let e,t,i,s;function l(a){n[2](a)}function r(a){n[3](a)}let o={};return n[0]!==void 0&&(o.key=n[0]),n[1]!==void 0&&(o.options=n[1]),e=new Ab({props:o}),he.push(()=>Fe(e,"key",l)),he.push(()=>Fe(e,"options",r)),{c(){B(e.$$.fragment)},m(a,u){V(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],Re(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],Re(()=>i=!1)),e.$set(f)},i(a){s||(E(e.$$.fragment,a),s=!0)},o(a){F(e.$$.fragment,a),s=!1},d(a){z(e,a)}}}function uM(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(o){i=o,t(0,i)}function r(o){s=o,t(1,s)}return n.$$set=o=>{"key"in o&&t(0,i=o.key),"options"in o&&t(1,s=o.options)},[i,s,l,r]}class fM extends Ne{constructor(e){super(),Ie(this,e,uM,aM,Pe,{key:0,options:1})}}var Sa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Hs={_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'>
`+j.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var I=wt("div","flatpickr-weekwrapper");I.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var j=wt("div","flatpickr-weeks");return I.appendChild(j),{weekWrapper:I,weekNumbers:j}}function ye(I,j){j===void 0&&(j=!0);var Q=j?I:I-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,st("onYearChange"),J()),R(),st("onMonthChange"),Ze())}function se(I,j){if(I===void 0&&(I=!0),j===void 0&&(j=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,j===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var Q=Oa(t.config),de=Q.hours,Ee=Q.minutes,We=Q.seconds;h(de,Ee,We)}t.redraw(),I&&st("onChange")}function G(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),st("onClose")}function Oe(){t.config!==void 0&&st("onDestroy");for(var I=t._handlers.length;I--;)t._handlers[I].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 j=t.calendarContainer.parentNode;if(j.lastChild&&j.removeChild(j.lastChild),j.parentNode){for(;j.firstChild;)j.parentNode.insertBefore(j.firstChild,j);j.parentNode.removeChild(j)}}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(I){return t.calendarContainer.contains(I)}function be(I){if(t.isOpen&&!t.config.inline){var j=wn(I),Q=ee(j),de=j===t.input||j===t.altInput||t.element.contains(j)||I.path&&I.path.indexOf&&(~I.path.indexOf(t.input)||~I.path.indexOf(t.altInput)),Ee=!de&&!Q&&!ee(I.relatedTarget),We=!t.config.ignoredFocusElements.some(function(tt){return tt.contains(j)});Ee&&We&&(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 ue(I){if(!(!I||t.config.minDate&&I<t.config.minDate.getFullYear()||t.config.maxDate&&I>t.config.maxDate.getFullYear())){var j=I,Q=t.currentYear!==j;t.currentYear=j||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(),st("onYearChange"),J())}}function ie(I,j){var Q;j===void 0&&(j=!0);var de=t.parseDate(I,void 0,j);if(t.config.minDate&&de&&Sn(de,t.config.minDate,j!==void 0?j:!t.minDateHasTime)<0||t.config.maxDate&&de&&Sn(de,t.config.maxDate,j!==void 0?j:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===vo
`),d=_("span"),h=_("span"),h.textContent="Choose presets",g=O(),B(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(f,"class","help-block")},m($,T){w($,e,T),m(e,t),m(e,i),m(e,s),w($,r,T),V(o,$,T),w($,u,T),w($,f,T),m(f,c),m(f,d),m(d,h),m(d,g),V(y,d,null),b=!0,v||(S=Xe(St.call(null,s,{text:`Allow uploading files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),v=!0)},p($,T){(!b||T&512&&l!==(l=$[9]))&&p(e,"for",l);const A={};T&512&&(A.id=$[9]),!a&&T&1&&(a=!0,A.value=$[0].mimeTypes,Re(()=>a=!1)),o.$set(A);const D={};T&1025&&(D.$$scope={dirty:T,ctx:$}),y.$set(D)},i($){b||(E(o.$$.fragment,$),E(y.$$.fragment,$),b=!0)},o($){F(o.$$.fragment,$),F(y.$$.fragment,$),b=!1},d($){$&&k(e),$&&k(r),z(o,$),$&&k(u),$&&k(f),z(y),v=!1,S()}}}function RM(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[8](b)}let y={id:n[9],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(y.value=n[0].thumbs),o=new vs({props:y}),he.push(()=>Fe(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,v){(!c||v&512&&l!==(l=b[9]))&&p(e,"for",l);const S={};v&512&&(S.id=b[9]),!a&&v&1&&(a=!0,S.value=b[0].thumbs,Re(()=>a=!1)),o.$set(S)},i(b){c||(E(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function jM(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;return i=new He({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[LM,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[FM,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),u=new He({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[NM,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),d=new He({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[RM,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,y){w(g,e,y),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),m(e,f),m(e,c),V(d,c,null),h=!0},p(g,[y]){const b={};y&2&&(b.name="schema."+g[1]+".options.maxSize"),y&1537&&(b.$$scope={dirty:y,ctx:g}),i.$set(b);const v={};y&2&&(v.name="schema."+g[1]+".options.maxSelect"),y&1537&&(v.$$scope={dirty:y,ctx:g}),r.$set(v);const S={};y&2&&(S.name="schema."+g[1]+".options.mimeTypes"),y&1537&&(S.$$scope={dirty:y,ctx:g}),u.$set(S);const C={};y&2&&(C.name="schema."+g[1]+".options.thumbs"),y&1537&&(C.$$scope={dirty:y,ctx:g}),d.$set(C)},i(g){h||(E(i.$$.fragment,g),E(r.$$.fragment,g),E(u.$$.fragment,g),E(d.$$.fragment,g),h=!0)},o(g){F(i.$$.fragment,g),F(r.$$.fragment,g),F(u.$$.fragment,g),F(d.$$.fragment,g),h=!1},d(g){g&&k(e),z(i),z(r),z(u),z(d)}}}function HM(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Tt(this.value),t(0,s)}function r(){s.maxSelect=Tt(this.value),t(0,s)}function o(d){n.$$.not_equal(s.mimeTypes,d)&&(s.mimeTypes=d,t(0,s))}const a=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},u=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},f=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function c(d){n.$$.not_equal(s.thumbs,d)&&(s.thumbs=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,r,o,a,u,f,c]}class qM extends Ne{constructor
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,C=O(),M=_("hr"),$=O(),T=_("p"),T.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",A=O(),D=_("div"),D.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=O(),L=_("hr"),N=O(),R=_("p"),R.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=null &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(r,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(M,"class","m-t-10 m-b-5"),p(T,"class","m-b-0"),p(D,"class","inline-flex flex-gap-5"),p(L,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(K,Y){w(K,e,Y),m(e,t),m(t,i),m(i,s),m(i,l),m(i,r),m(r,o),m(r,a),m(r,u),m(r,f),m(r,c),m(r,d);for(let te=0;te<x.length;te+=1)x[te].m(r,null);m(i,h),m(i,g),m(i,y),m(i,b),m(i,v),m(i,S),m(i,C),m(i,M),m(i,$),m(i,T),m(i,A),m(i,D),m(i,P),m(i,L),m(i,N),m(i,R),W=!0},p(K,Y){if(Y&1){q=K[0].schema;let te;for(te=0;te<q.length;te+=1){const fe=Up(K,q,te);x[te]?x[te].p(fe,Y):(x[te]=Yp(fe),x[te].c(),x[te].m(r,null))}for(;te<x.length;te+=1)x[te].d(1);x.length=q.length}},i(K){W||(K&&Dt(()=>{J||(J=ft(e,un,{duration:150},!0)),J.run(1)}),W=!0)},o(K){K&&(J||(J=ft(e,un,{duration:150},!1)),J.run(0)),W=!1},d(K){K&&k(e),zn(x,K),K&&J&&J.end()}}}function k$(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=H(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&_e(i,t)},d(s){s&&k(e)}}}function w$(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=H(t),s=H(".*")},m(l,r){w(l,e,r),m(e,i),m(e,s)},p(l,r){r&1&&t!==(t=l[19].name+"")&&_e(i,t)},d(l){l&&k(e)}}}function Yp(n){let e;function t(l,r){return l[19].type==="relation"||l[19].type==="user"?w$:k$}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function S$(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const r=o=>o[14];for(let o=0;o<l.length;o+=1){let a=Bp(n,l,o),u=r(a);t.set(u,e[o]=Kp(u,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=rt()},m(o,a){for(let u=0;u<e.length;u+=1)e[u].m(o,a);w(o,i,a),s=!0},p(o,a){a&262235&&(l=Object.entries(o[6]),Te(),e=ot(e,a,r,1,o,l,t,i.parentNode,Lt,Kp,i,Bp),De())},i(o){if(!s){for(let a=0;a<l.length;a+=1)E(e[a]);s=!0}},o(o){for(let a=0;a<e.length;a+=1)F(e[a]);s=!1},d(o){for(let a=0;a<e.length;a+=1)e[a].d(o);o&&k(i)}}}function C$(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function M$(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("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(l,r){w(l,e,r),t||(i=[Xe(St.call(null,e,"Lock and set to Admins only")),X(e,"click",s)],t=!0)},p(l,r){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function $$(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("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(l,r){w(l,e,r),t||(i=[Xe(St.call(null,e,"Unlock and set custom rule")),X(e,"click",s)],t=!0)},p(l,r){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function O$(n){let e;return{c(){e=H("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function T$(n){let e;return{c(){e=H("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function D$(n){let e,t=n[15]+"",i,s,l=Ni(n[0][n[14]])?"Admins only":"Custom rule",r,o,a,u,f=n[14],c,d,h,g,y,b,v;function S(){return n[10](n[14])}const C=()=>n[11](u,f),M=()=>n[11](null,f);function $(N){n[12](N,n[14])}var T=n[4];function A(N){let R={baseCollection:N[0],disabled:Ni(N[0][N[14]])};return N[0][N[14]]!==void 0&&(R.value=N[0][N[14]]),{props:R}}T&&(u=new T(A(n)),C(),he.push(()=>Fe(u,"value",$)));function D(N,R){return R&1&&(g=null),g==null&&(g=!!Ni(N[0][N[14]])),g?T$:O$}let P=D(n,-1),L=P(n);return{c(){e=_("label"),i=H(t),s=H(" - "),r=H(l),a=O(),u&&B(u.$$.fragment),d=O(),h=_("div"),L.c(),p(e,"for",o=n[18]),p(h,"class","help-block")},m(N,R){w(N,e,R),m(e,i),m(e,s),m(e,r),w(N,a,R),u&&V(u,N,R),w(N,d,R),w(N,h,R),L.m(h,null),y=!0,b||(v=X(e,"click",S),b=!0)},p(N,R){n=N,(!y||R&1)&&l!==(l=
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
2022-07-09 16:16:35 +08:00
</a>.`,s=O(),l=_("span"),o=H(r),a=O(),b&&b.c(),u=O(),c.c(),d=rt(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m(M,$){w(M,e,$),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,a),b&&b.m(e,null),w(M,u,$),S[f].m(M,$),w(M,d,$),h=!0,g||(y=X(l,"click",n[7]),g=!0)},p(M,[$]){(!h||$&4)&&r!==(r=M[2]?"Hide available fields":"Show available fields")&&_e(o,r),M[2]?b?(b.p(M,$),$&4&&E(b,1)):(b=Wp(M),b.c(),E(b,1),b.m(e,null)):b&&(Te(),F(b,1,1,()=>{b=null}),De());let T=f;f=C(M),f===T?S[f].p(M,$):(Te(),F(S[T],1,1,()=>{S[T]=null}),De(),c=S[f],c?c.p(M,$):(c=S[f]=v[f](M),c.c()),E(c,1),c.m(d.parentNode,d))},i(M){h||(E(b),E(c),h=!0)},o(M){F(b),F(c),h=!1},d(M){M&&k(e),b&&b.d(),M&&k(u),S[f].d(M),M&&k(d),g=!1,y()}}}function Ni(n){return n===null}function E$(n,e,t){let{collection:i=new Pn}=e,s={},l=!1,r={},o,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,o=(await bi(()=>import("./FilterAutocompleteInput.2d75cd85.js"),[])).default)}catch(v){console.warn(v),t(4,o=null)}t(5,a=!1)}di(()=>{f()});const c=()=>t(2,l=!l),d=async v=>{var S;t(0,i[v]=s[v]||"",i),await Ui(),(S=r[v])==null||S.focus()},h=v=>{t(1,s[v]=i[v],s),t(0,i[v]=null,i)},g=v=>{var S;return(S=r[v])==null?void 0:S.focus()};function y(v,S){he[v?"unshift":"push"](()=>{r[S]=v,t(3,r)})}function b(v,S){n.$$.not_equal(i[S],v)&&(i[S]=v,t(0,i))}return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},[i,s,l,r,o,a,u,c,d,h,g,y,b]}class P$ extends Ne{constructor(e){super(),Ie(this,e,E$,A$,Pe,{collection:0})}}function Jp(n,e,t){const i=n.slice();return i[14]=e[t],i}function xp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gp(n){let e;return{c(){e=_("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,s,l=n[1].originalName+"",r,o,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=H(`Renamed collection
2022-07-09 05:53:10 +08:00
`),s=_("strong"),r=H(l),o=O(),a=_("i"),u=O(),f=_("strong"),d=H(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,r),m(t,o),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&_e(r,l),g&2&&c!==(c=h[1].name+"")&&_e(d,c)},d(h){h&&k(e)}}}function Xp(n){let e,t,i,s,l=n[14].originalName+"",r,o,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=H(`Renamed field
`),s=_("strong"),r=H(l),o=O(),a=_("i"),u=O(),f=_("strong"),d=H(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,r),m(t,o),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&_e(r,l),g&16&&c!==(c=h[14].name+"")&&_e(d,c)},d(h){h&&k(e)}}}function Qp(n){let e,t,i,s=n[14].name+"",l,r;return{c(){e=_("li"),t=H("Removed field "),i=_("span"),l=H(s),r=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(o,a){w(o,e,a),m(e,t),m(e,i),m(i,l),m(e,r)},p(o,a){a&8&&s!==(s=o[14].name+"")&&_e(l,s)},d(o){o&&k(e)}}}function L$(n){let e,t,i,s,l,r,o,a,u,f,c,d,h=n[3].length&&Gp(),g=n[5]&&Zp(n),y=n[4],b=[];for(let C=0;C<y.length;C+=1)b[C]=Xp(xp(n,y,C));let v=n[3],S=[];for(let C=0;C<v.length;C+=1)S[C]=Qp(Jp(n,v,C));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,r=O(),h&&h.c(),o=O(),a=_("h6"),a.textContent="Changes:",u=O(),f=_("ul"),g&&g.c(),c=O();for(let C=0;C<b.length;C+=1)b[C].c();d=O();for(let C=0;C<S.length;C+=1)S[C].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(C,M){w(C,e,M),m(e,t),m(e,i),m(e,s),m(s,l),m(s,r),h&&h.m(s,null),w(C,o,M),w(C,a,M),w(C,u,M),w(C,f,M),g&&g.m(f,null),m(f,c);for(let $=0;$<b.length;$+=1)b[$].m(f,null);m(f,d);for(let $=0;$<S.length;$+=1)S[$].m(f,null)},p(C,M){if(C[3].length?h||(h=Gp(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),C[5]?g?g.p(C,M):(g=Zp(C),g.c(),g.m(f,c)):g&&(g.d(1),g=null),M&16){y=C[4];let $;for($=0;$<y.length;$+=1){const T=xp(C,y,$);b[$]?b[$].p(T,M):(b[$]=Xp(T),b[$].c(),b[$].m(f,d))}for(;$<b.length;$+=1)b[$].d(1);b.length=y.length}if(M&8){v=C[3];let $;for($=0;$<v.length;$+=1){const T=Jp(C,v,$);S[$]?S[$].p(T,M):(S[$]=Qp(T),S[$].c(),S[$].m(f,null))}for(;$<S.length;$+=1)S[$].d(1);S.length=v.length}},d(C){C&&k(e),h&&h.d(),C&&k(o),C&&k(a),C&&k(u),C&&k(f),g&&g.d(),zn(b,C),zn(S,C)}}}function F$(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function I$(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=_("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(r,o){w(r,e,o),w(r,t,o),w(r,i,o),e.focus(),s||(l=[X(e,"click",n[8]),X(i,"click",n[9])],s=!0)},p:re,d(r){r&&k(e),r&&k(t),r&&k(i),s=!1,lt(l)}}}function N$(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[I$],header:[F$],default:[L$]},$$scope:{ctx:n}};return e=new Ti({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const r={};l&524346&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[10](null),z(e,s)}}}function R$(n,e,t){let i,s,l;const r=vn();let o,a;async function u(v){t(1,a=v),await Ui(),!i&&!s.length&&!l.length?c():o==null||o.show()}function f(){o==null||o.hide()}function c(){f(),r("confirm")}const d=()=>f(),h=()=>c();function g(v){he[v?"unshift":"push"](()=>{o=v,t(2,o)})}function y(v){ut.call(this,n,v)}function b(v){ut.call(this,n,v)}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,s=(a==null?void 0:a.schema.filter(v=>v.id&&!v.toDelete&&v.originalName!=v.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(v=>v.id&&v.toDelete))||[])},[f,a,o,l,s,i,c,u,d,h,g,y,b]}class j$ extends Ne{constructor(e){super(),Ie(this,e,R$,N$,Pe,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function eh(n){let e,t,i,s;function l(o){n[26](o)}let r={};return n[2]!==void 0&&(r.collection=n[2]),t=new P$({props:r}),he.push(()=>Fe(t,"collection",l)),{c(){e=_("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(o,a){w(o,e,a),V(t,e,null),s=!0},p(o,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=o[2],Re(()=>i=!1)),t.$set(u)},i(o){s||(E(t.$$.fragment,o),s=!0)},o(o){F(t.$$.fragment,o),s=!1},d(o){o&&k(e),z(t)}}}function H$(n){let e,t,i,s,l,r;function o(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new v$({props:a}),he.push(()=>Fe(i,"collection",o));let u=n[9]===Vl&&eh(n);return{c(){e=_("div"),t=_("div"),B(i.$$.fragment),l=O(),u&&u.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===ps),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),V(i,t,null),m(e,l),u&&u.m(e,null),r=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],Re(()=>s=!1)),i.$set(d),c[0]&512&&ne(t,"active",f[9]===ps),f[9]===Vl?u?(u.p(f,c),c[0]&512&&E(u,1)):(u=eh(f),u.c(),E(u,1),u.m(e,null)):u&&(Te(),F(u,1,1,()=>{u=null}),De())},i(f){r||(E(i.$$.fragment,f),E(u),r=!0)},o(f){F(i.$$.fragment,f),F(u),r=!1},d(f){f&&k(e),z(i),u&&u.d()}}}function th(n){let e,t,i,s,l,r,o;return r=new bs({props:{class:"dropdown dropdown-right m
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[20]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function nh(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function V$(n){let e,t,i,s,l,r,o,a,u,f,c,d,h=n[2].system&&nh();return{c(){e=_("label"),t=H("Name"),s=O(),l=_("input"),u=O(),h&&h.c(),f=rt(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",r=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=o=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,y){w(g,e,y),m(e,t),w(g,s,y),w(g,l,y),w(g,u,y),h&&h.m(g,y),w(g,f,y),n[2].isNew&&l.focus(),c||(d=X(l,"input",n[21]),c=!0)},p(g,y){y[1]&128&&i!==(i=g[38])&&p(e,"for",i),y[1]&128&&r!==(r=g[38])&&p(l,"id",r),y[0]&2048&&(l.disabled=g[11]),y[0]&4&&o!==(o=g[2].isNew)&&(l.autofocus=o),y[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=nh(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function ih(n){let e,t,i,s,l,r;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,a){w(o,e,a),s=!0,l||(r=Xe(t=St.call(null,e,n[12])),l=!0)},p(o,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,o[12])},i(o){s||(o&&Dt(()=>{i||(i=ft(e,Un,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(o){o&&(i||(i=ft(e,Un,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(o){o&&k(e),o&&i&&i.end(),l=!1,r()}}}function sh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,o){w(r,e,o),i=!0,s||(l=Xe(St.call(null,e,"Has errors")),s=!0)},i(r){i||(r&&Dt(()=>{t||(t=ft(e,Un,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(r){r&&(t||(t=ft(e,Un,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(r){r&&k(e),r&&t&&t.end(),s=!1,l()}}}function z$(n){var N,R,J,W,q,x;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,r,o,a,u,f,c,d,h,g,y=!U.isEmpty((N=n[4])==null?void 0:N.schema),b,v,S,C,M=!U.isEmpty((R=n[4])==null?void 0:R.listRule)||!U.isEmpty((J=n[4])==null?void 0:J.viewRule)||!U.isEmpty((W=n[4])==null?void 0:W.createRule)||!U.isEmpty((q=n[4])==null?void 0:q.updateRule)||!U.isEmpty((x=n[4])==null?void 0:x.deleteRule),$,T,A,D=!n[2].isNew&&!n[2].system&&th(n);o=new He({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[V$,({uniqueId:K})=>({38:K}),({uniqueId:K})=>[0,K?128:0]]},$$scope:{ctx:n}}});let P=y&&ih(n),L=M&&sh();return{c(){e=_("h4"),i=H(t),s=O(),D&&D.c(),l=O(),r=_("form"),B(o.$$.fragment),a=O(),u=_("input"),f=O(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=O(),P&&P.c(),b=O(),v=_("button"),S=_("span"),S.textContent="API Rules",C=O(),L&&L.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(r,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===ps),p(S,"class","txt"),p(v,"type","button"),p(v,"class","tab-item"),ne(v,"active",n[9]===Vl),p(c,"class","tabs-header stretched")},m(K,Y){w(K,e,Y),m(e,i),w(K,s,Y),D&&D.m(K,Y),w(K,l,Y),w(K,r,Y),V(o,r,null),m(r,a),m(r,u),w(K,f,Y),w(K,c,Y),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,v),m(v,S),m(v,C),L&&L.m(v,null),$=!0,T||(A=[X(r,"submit",Jt(n[22])),X(d,"click",n[23]),X(v,"click",n[24])],T=!0)},p(K,Y){var fe,ye,se,G,Oe,ee;(!$||Y[0]&4)&&t!==(t=K[2].isNew?"New collection":"Edit collection")&&_e(i,t),!K[2].isNew&&!K[2].system?D?(D.p(K,Y),Y[0]&4&&E(D,1)):(D=th(K),D.c(),E(D,1),D.m(l.parentNode,l)):D&&(Te(),F(D,1,1,()=>{D=null}),De());const te={};Y[0]&2048&&(te.class="form-field required m-b-0 "+(K[11]?"disabled":"")),Y[0]&2052|Y[1]&384&&(te.$$scope={dirty:Y,ctx:K}),o.$set(te),Y[0]&16&&(y=!U.isEmpty((fe=K[4])==null?void 0:fe.schema)),y?P?(P.p(K,Y),Y[0]&16&&E(P,1)):(P=ih(K),P.c(),E(P,1),P.m(d,null)):P&&(Te(),F(P,1,1,()=>{P=null}),De()),Y[0]&512&&ne(d,"active",K[9]===ps),Y[0]&16&&(M=!U.isEmpty((ye=K[4])==null?void 0:ye.listRule)||!U.isEmpty((se=K[4])==null?void 0:se.viewRule)||!U.isEmpty((G=K[4])==null?void 0:G.createRule)||
<span class="txt">New collection</span>`,v=O(),B(S.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ne(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(i,"class","form-field search"),ne(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(y,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(L,N){w(L,e,N),m(e,t),m(t,i),m(i,s),m(s,l),m(i,r),m(i,o),$e(o,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let R=0;R<d.length;R+=1)d[R].m(c,null);D&&D.m(c,null),m(e,g),m(e,y),m(y,b),w(L,v,N),V(S,L,N),C=!0,M||($=[X(l,"click",n[8]),X(o,"input",n[9]),X(b,"click",n[11])],M=!0)},p(L,[N]){N&16&&ne(l,"hidden",!L[4]),N&1&&o.value!==L[0]&&$e(o,L[0]),N&16&&ne(i,"active",L[4]),N&106&&(T=L[3],d=ot(d,N,A,1,L,T,h,c,an,ah,null,lh),!T.length&&D?D.p(L,N):T.length?D&&(D.d(1),D=null):(D=rh(L),D.c(),D.m(c,null)));const R={};S.$set(R)},i(L){C||(E(S.$$.fragment,L),C=!0)},o(L){F(S.$$.fragment,L),C=!1},d(L){L&&k(e);for(let N=0;N<d.length;N+=1)d[N].d();D&&D.d(),L&&k(v),n[12](null),z(S,L),M=!1,lt($)}}}function x$(n,e,t){let i,s,l,r,o;pn(n,ui,b=>t(5,r=b)),pn(n,Ks,b=>t(7,o=b));let a,u="";function f(b){Hg(ui,r=b,r)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),g=()=>a==null?void 0:a.show();function y(b){he[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=o.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,r,f,o,c,d,h,g,y]}class G$ extends Ne{constructor(e){super(),Ie(this,e,x$,J$,Pe,{})}}function Z$(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C,M,$,T,A,D,P,L,N,R,J,W,q,x,K,Y,te,fe,ye,se,G,Oe,ee,be,ue,ie,ve,je,Le,qe,oe,le,ke,Ve;return{c(){e=_("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=O(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
quoted), number, null, true, false`,l=O(),r=_("li"),o=_("code"),o.textContent="OPERATOR",a=H(` - is one of:
`),u=_("br"),f=O(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=O(),y=_("span"),y.textContent="Equal",b=O(),v=_("li"),S=_("code"),S.textContent="!=",C=O(),M=_("span"),M.textContent="NOT equal",$=O(),T=_("li"),A=_("code"),A.textContent=">",D=O(),P=_("span"),P.textContent="Greater than",L=O(),N=_("li"),R=_("code"),R.textContent=">=",J=O(),W=_("span"),W.textContent="Greater than or equal",q=O(),x=_("li"),K=_("code"),K.textContent="<",Y=O(),te=_("span"),te.textContent="Less than or equal",fe=O(),ye=_("li"),se=_("code"),se.textContent="<=",G=O(),Oe=_("span"),Oe.textContent="Less than or equal",ee=O(),be=_("li"),ue=_("code"),ue.textContent="~",ie=O(),ve=_("span"),ve.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,je=O(),Le=_("li"),qe=_("code"),qe.textContent="!~",oe=O(),le=_("span"),le.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ke=O(),Ve=_("p"),Ve.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(o,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(y,"class","txt-hint"),p(S,"class","filter-op svelte-1w7s5nw"),p(M,"class","txt-hint"),p(A,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(R,"class","filter-op svelte-1w7s5nw"),p(W,"class","txt-hint"),p(K,"class","filter-op svelte-1w7s5nw"),p(te,"class","txt-hint"),p(se,"class","filter-op svelte-1w7s5nw"),p(Oe,"class","txt-hint"),p(ue,"class","filter-op svelte-1w7s5nw"),p(ve,"class","txt-hint"),p(qe,"class","filter-op svelte-1w7s5nw"),p(le,"class","txt-hint")},m(ze,Ge){w(ze,e,Ge),w(ze,t,Ge),w(ze,i,Ge),m(i,s),m(i,l),m(i,r),m(r,o),m(r,a),m(r,u),m(r,f),m(r,c),m(c,d),m(d,h),m(d,g),m(d,y),m(c,b),m(c,v),m(v,S),m(v,C),m(v,M),m(c,$),m(c,T),m(T,A),m(T,D),m(T,P),m(c,L),m(c,N),m(N,R),m(N,J),m(N,W),m(c,q),m(c,x),m(x,K),m(x,Y),m(x,te),m(c,fe),m(c,ye),m(ye,se),m(ye,G),m(ye,Oe),m(c,ee),m(c,be),m(be,ue),m(be,ie),m(be,ve),m(c,je),m(c,Le),m(Le,qe),m(Le,oe),m(Le,le),w(ze,ke,Ge),w(ze,Ve,Ge)},p:re,i:re,o:re,d(ze){ze&&k(e),ze&&k(t),ze&&k(i),ze&&k(ke),ze&&k(Ve)}}}class X$ extends Ne{constructor(e){super(),Ie(this,e,null,Z$,Pe,{})}}function uh(n,e,t){const i=n.slice();return i[8]=e[t],i}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[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=_("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+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&ne(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function mh(n,e){let t,i,s,l;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&ne(t,"active",e[3]===e[13].lang)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function gh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&36&&ne(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function _h(n,e){let t,i,s,l;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&ne(t,"active",e[2]===e[8].code)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function Q$(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v=n[0].name+"",S,C,M,$,T,A,D,P=[],L=new Map,N,R,J=[],W=new Map,q,x,K,Y,te,fe,ye,se,G,Oe,ee,be,ue,ie,ve,je,Le,qe,oe,le,ke,Ve,ze,Ge,ge,Ae,Z,ae,Be,vt,it,gt,at,yt,zt,$t,Ot,me,Ce,Ke,st,fn,ce,we,Ze,xt,qt,ni,pe,I,j,Q,de,Ee,We,tt,Je,nt=[],xe=new Map,et,_t,Ft=[],nn=new Map,Fn,Bt=n[1]&&ph(),ks=n[4];const ws=Me=>Me[13].lang;for(let Me=0;Me<ks.length;Me+=1){let Ye=dh(n,ks,Me),At=ws(Ye);L.set(At,P[Me]=hh(At,Ye))}let Ji=n[4];const tr=Me=>Me[13].lang;for(let Me=0;Me<Ji.length;Me+=1){let Ye=ch(n,Ji,Me),At=tr(Ye);W.set(At,J[Me]=mh(At,Ye))}ge=new tn({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),yt=new tn({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),$t=new X$({}),Ze=new tn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let Ss=n[5];const nr=Me=>Me[8].code;for(let Me=0;Me<Ss.length;Me+=1){let Ye=fh(n,Ss,Me),At=nr(Ye);xe.set(At,nt[Me]=gh(At,Ye))}let xi=n[5];const ir=Me=>Me[8].code;for(let Me=0;Me<xi.length;Me+=1){let Ye=uh(n,xi,Me),At=ir(Ye);nn.set(At,Ft[Me]=_h(At,Ye))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records"),c=O(),Bt&&Bt.c(),d=O(),h=_("div"),g=_("p"),y=H("Fetch a paginated "),b=_("strong"),S=H(v),C=H(" records list."),M=O(),$=_("div"),$.textContent="Client SDKs example",T=O(),A=_("div"),D=_("div");for(let Me=0;Me<P.length;Me+=1)P[Me].c();N=O(),R=_("div");for(let Me=0;Me<J.length;Me+=1)J[Me].c();q=O(),x=_("div"),x.textContent="Query parameters",K=O(),Y=_("table"),te=_("thead"),te.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,fe=O(),ye=_("tbody"),se=_("tr"),se.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,G=O(),Oe=_("tr"),Oe.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,ee=O(),be=_("tr"),ue=_("td"),ue.textContent="sort",ie=O(),ve=_("td"),ve.innerHTML='<span class="label">String</span>',je=O(),Le=_("td"),qe=H("Specify the records order attribute(s). "),oe=_("br"),le=H(`
Add `),ke=_("code"),ke.textContent="-",Ve=H(" / "),ze=_("code"),ze.textContent="+",Ge=H(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),B(ge.$$.fragment),Ae=O(),Z=_("tr"),ae=_("td"),ae.textContent="filter",Be=O(),vt=_("td"),vt.innerHTML='<span class="label">String</span>',it=O(),gt=_("td"),at=H(`Filter the returned records. Ex.:
`),B(yt.$$.fragment),zt=O(),B($t.$$.fragment),Ot=O(),me=_("tr"),Ce=_("td"),Ce.textContent="expand",Ke=O(),st=_("td"),st.innerHTML='<span class="label">String</span>',fn=O(),ce=_("td"),we=H(`Auto expand nested record relations. Ex.:
`),B(Ze.$$.fragment),xt=H(`
Supports up to 6-levels depth nested relations expansion. `),qt=_("br"),ni=H(`
The expanded relations will be appended to each individual record under the
`),pe=_("code"),pe.textContent="@expand",I=H(" property (eg. "),j=_("code"),j.textContent='"@expand": {"rel1": {...}, ...}',Q=H(")."),de=O(),Ee=_("div"),Ee.textContent="Responses",We=O(),tt=_("div"),Je=_("div");for(let Me=0;Me<nt.length;Me+=1)nt[Me].c();et=O(),_t=_("div");for(let Me=0;Me<Ft.length;Me+=1)Ft[Me].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p($,"class","section-title"),p(D,"class","tabs-header compact left"),p(R,"class","tabs-content"),p(A,"class","tabs m-b-lg"),p(x,"class","section-title"),p(Y,"class","table-compact table-border m-b-lg"),p(Ee,"class","section-title"),p(Je,"class","tabs-header compact left"),p(_t,"class","tabs-content"),p(tt,"class","tabs")},m(Me,Ye){w(Me,e,Ye),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(e,c),Bt&&Bt.m(e,null),w(Me,d,Ye),w(Me,h,Ye),m(h,g),m(g,y),m(g,b),m(b,S),m(g,C),w(Me,M,Ye),w(Me,$,Ye),w(Me,T,Ye),w(Me,A,Ye),m(A,D);for(let At=0;At<P.length;At+=1)P[At].m(D,null);m(A,N),m(A,R);for(let At=0;At<J.length;At+=1)J[At].m(R,null);w(Me,q,Ye),w(Me,x,Ye),w(Me,K,Ye),w(Me,Y,Ye),m(Y,te),m(Y,fe),m(Y,ye),m(ye,se),m(ye,G),m(ye,Oe),m(ye,ee),m(ye,be),m(be,ue),m(be,ie),m(be,ve),m(be,je),m(be,Le),m(Le,qe),m(Le,oe),m(Le,le),m(Le,ke),m(Le,Ve),m(Le,ze),m(Le,Ge),V(ge,Le,null),m(ye,Ae),m(ye,Z),m(Z,ae),m(Z,Be),m(Z,vt),m(Z,it),m(Z,gt),m(gt,at),V(yt,gt,null),m(gt,zt),V($t,gt,null),m(ye,Ot),m(ye,me),m(me,Ce),m(me,Ke),m(me,st),m(me,fn),m(me,ce),m(ce,we),V(Ze,ce,null),m(ce,xt),m(ce,qt),m(ce,ni),m(ce,pe),m(ce,I),m(ce,j),m(ce,Q),w(Me,de,Ye),w(Me,Ee,Ye),w(Me,We,Ye),w(Me,tt,Ye),m(tt,Je);for(let At=0;At<nt.length;At+=1)nt[At].m(Je,null);m(tt,et),m(tt,_t);for(let At=0;At<Ft.length;At+=1)Ft[At].m(_t,null);Fn=!0},p(Me,[Ye]){(!Fn||Ye&1)&&a!==(a=Me[0].name+"")&&_e(u,a),Me[1]?Bt||(Bt=ph(),Bt.c(),Bt.m(e,null)):Bt&&(Bt.d(1),Bt=null),(!Fn||Ye&1)&&v!==(v=Me[0].name+"")&&_e(S,v),Ye&24&&(ks=Me[4],P=ot(P,Ye,ws,1,Me,ks,L,D,an,hh,null,dh)),Ye&24&&(Ji=Me[4],Te(),J=ot(J,Ye,tr,1,Me,Ji,W,R,Lt,mh,null,ch),De()),Ye&36&&(Ss=Me[5],nt=ot(nt,Ye,nr,1,Me,Ss,xe,Je,an,gh,null,fh)),Ye&36&&(xi=Me[5],Te(),Ft=ot(Ft,Ye,ir,1,Me,xi,nn,_t,Lt,_h,null,uh),De())},i(Me){if(!Fn){for(let Ye=0;Ye<Ji.length;Ye+=1)E(J[Ye]);E(ge.$$.fragment,Me),E(yt.$$.fragment,Me),E($t.$$.fragment,Me),E(Ze.$$.fragment,Me);for(let Ye=0;Ye<xi.length;Ye+=1)E(Ft[Ye]);Fn=!0}},o(Me){for(let Ye=0;Ye<J.length;Ye+=1)F(J[Ye]);F(ge.$$.fragment,Me),F(yt.$$.fragment,Me),F($t.$$.fragment,Me),F(Ze.$$.fragment,Me);for(let Ye=0;Ye<Ft.length;Ye+=1)F(Ft[Ye]);Fn=!1},d(Me){Me&&k(e),Bt&&Bt.d(),Me&&k(d),Me&&k(h),Me&&k(M),Me&&k($),Me&&k(T),Me&&k(A);for(let Ye=0;Ye<P.length;Ye+=1)P[Ye].d();for(let Ye=0;Ye<J.length;Ye+=1)J[Ye].d();Me&&k(q),Me&&k(x),Me&&k(K),Me&&k(Y),z(ge),z(yt),z($t),z(Ze),Me&&k(de),Me&&k(Ee),Me&&k(We),Me&&k(tt);for(let Ye=0;Ye<nt.length;Ye+=1)nt[Ye].d();for(let Ye=0;Ye<Ft.length;Ye+=1)Ft[Ye].d()}}}function eO(n,e,t){let i,{collection:s=new Pn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[U.dummyCollectionRecord(s),U.dummyCollectionRecord(s)]},null,2)}),o.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&o.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),o.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("${s==null?void 0:s.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("${s==null?void 0:s.name}", 200 /* batch size */);
.then(function (records) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,r,a,o,u,f]}class tO extends Ne{constructor(e){super(),Ie(this,e,eO,Q$,Pe,{collection:0})}}function bh(n,e,t){const i=n.slice();return i[8]=e[t],i}function yh(n,e,t){const i=n.slice();return i[8]=e[t],i}function vh(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=_("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+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&ne(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function Ch(n,e){let t,i,s,l;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&ne(t,"active",e[3]===e[13].lang)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function Mh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&36&&ne(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function $h(n,e){let t,i,s,l;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&ne(t,"active",e[2]===e[8].code)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function nO(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,S=n[0].name+"",C,M,$,T,A,D,P,L=[],N=new Map,R,J,W=[],q=new Map,x,K,Y,te,fe,ye,se,G,Oe,ee,be,ue,ie,ve,je,Le,qe,oe,le,ke,Ve,ze,Ge,ge,Ae,Z,ae,Be,vt,it,gt,at=[],yt=new Map,zt,$t,Ot=[],me=new Map,Ce,Ke=n[1]&&wh(),st=n[4];const fn=pe=>pe[13].lang;for(let pe=0;pe<st.length;pe+=1){let I=kh(n,st,pe),j=fn(I);N.set(j,L[pe]=Sh(j,I))}let ce=n[4];const we=pe=>pe[13].lang;for(let pe=0;pe<ce.length;pe+=1){let I=vh(n,ce,pe),j=we(I);q.set(j,W[pe]=Ch(j,I))}le=new tn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let Ze=n[5];const xt=pe=>pe[8].code;for(let pe=0;pe<Ze.length;pe+=1){let I=yh(n,Ze,pe),j=xt(I);yt.set(j,at[pe]=Mh(j,I))}let qt=n[5];const ni=pe=>pe[8].code;for(let pe=0;pe<qt.length;pe+=1){let I=bh(n,qt,pe),j=ni(I);me.set(j,Ot[pe]=$h(j,I))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),Ke&&Ke.c(),h=O(),g=_("div"),y=_("p"),b=H("Fetch a single "),v=_("strong"),C=H(S),M=H(" record."),$=O(),T=_("div"),T.textContent="Client SDKs example",A=O(),D=_("div"),P=_("div");for(let pe=0;pe<L.length;pe+=1)L[pe].c();R=O(),J=_("div");for(let pe=0;pe<W.length;pe+=1)W[pe].c();x=O(),K=_("div"),K.textContent="Path Parameters",Y=O(),te=_("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>`,fe=O(),ye=_("div"),ye.textContent="Query parameters",se=O(),G=_("table"),Oe=_("thead"),Oe.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ee=O(),be=_("tbody"),ue=_("tr"),ie=_("td"),ie.textContent="expand",ve=O(),je=_("td"),je.innerHTML='<span class="label">String</span>',Le=O(),qe=_("td"),oe=H(`Auto expand nested record relations. Ex.:
`),B(le.$$.fragment),ke=H(`
Supports up to 6-levels depth nested relations expansion. `),Ve=_("br"),ze=H(`
The expanded relations will be appended to the record under the
`),Ge=_("code"),Ge.textContent="@expand",ge=H(" property (eg. "),Ae=_("code"),Ae.textContent='"@expand": {"rel1": {...}, ...}',Z=H(")."),ae=O(),Be=_("div"),Be.textContent="Responses",vt=O(),it=_("div"),gt=_("div");for(let pe=0;pe<at.length;pe+=1)at[pe].c();zt=O(),$t=_("div");for(let pe=0;pe<Ot.length;pe+=1)Ot[pe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","tabs-header compact left"),p(J,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(K,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(G,"class","table-compact table-border m-b-lg"),p(Be,"class","section-title"),p(gt,"class","tabs-header compact left"),p($t,"class","tabs-content"),p(it,"class","tabs")},m(pe,I){w(pe,e,I),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),Ke&&Ke.m(e,null),w(pe,h,I),w(pe,g,I),m(g,y),m(y,b),m(y,v),m(v,C),m(y,M),w(pe,$,I),w(pe,T,I),w(pe,A,I),w(pe,D,I),m(D,P);for(let j=0;j<L.length;j+=1)L[j].m(P,null);m(D,R),m(D,J);for(let j=0;j<W.length;j+=1)W[j].m(J,null);w(pe,x,I),w(pe,K,I),w(pe,Y,I),w(pe,te,I),w(pe,fe,I),w(pe,ye,I),w(pe,se,I),w(pe,G,I),m(G,Oe),m(G,ee),m(G,be),m(be,ue),m(ue,ie),m(ue,ve),m(ue,je),m(ue,Le),m(ue,qe),m(qe,oe),V(le,qe,null),m(qe,ke),m(qe,Ve),m(qe,ze),m(qe,Ge),m(qe,ge),m(qe,Ae),m(qe,Z),w(pe,ae,I),w(pe,Be,I),w(pe,vt,I),w(pe,it,I),m(it,gt);for(let j=0;j<at.length;j+=1)at[j].m(gt,null);m(it,zt),m(it,$t);for(let j=0;j<Ot.length;j+=1)Ot[j].m($t,null);Ce=!0},p(pe,[I]){(!Ce||I&1)&&a!==(a=pe[0].name+"")&&_e(u,a),pe[1]?Ke||(Ke=wh(),Ke.c(),Ke.m(e,null)):Ke&&(Ke.d(1),Ke=null),(!Ce||I&1)&&S!==(S=pe[0].name+"")&&_e(C,S),I&24&&(st=pe[4],L=ot(L,I,fn,1,pe,st,N,P,an,Sh,null,kh)),I&24&&(ce=pe[4],Te(),W=ot(W,I,we,1,pe,ce,q,J,Lt,Ch,null,vh),De()),I&36&&(Ze=pe[5],at=ot(at,I,xt,1,pe,Ze,yt,gt,an,Mh,null,yh)),I&36&&(qt=pe[5],Te(),Ot=ot(Ot,I,ni,1,pe,qt,me,$t,Lt,$h,null,bh),De())},i(pe){if(!Ce){for(let I=0;I<ce.length;I+=1)E(W[I]);E(le.$$.fragment,pe);for(let I=0;I<qt.length;I+=1)E(Ot[I]);Ce=!0}},o(pe){for(let I=0;I<W.length;I+=1)F(W[I]);F(le.$$.fragment,pe);for(let I=0;I<Ot.length;I+=1)F(Ot[I]);Ce=!1},d(pe){pe&&k(e),Ke&&Ke.d(),pe&&k(h),pe&&k(g),pe&&k($),pe&&k(T),pe&&k(A),pe&&k(D);for(let I=0;I<L.length;I+=1)L[I].d();for(let I=0;I<W.length;I+=1)W[I].d();pe&&k(x),pe&&k(K),pe&&k(Y),pe&&k(te),pe&&k(fe),pe&&k(ye),pe&&k(se),pe&&k(G),z(le),pe&&k(ae),pe&&k(Be),pe&&k(vt),pe&&k(it);for(let I=0;I<at.length;I+=1)at[I].d();for(let I=0;I<Ot.length;I+=1)Ot[I].d()}}}function iO(n,e,t){let i,{collection:s=new Pn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)}),i&&o.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),o.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("${s==null?void 0:s.name}", "RECORD_ID")
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,r,a,o,u,f]}class sO extends Ne{constructor(e){super(),Ie(this,e,iO,nO,Pe,{collection:0})}}function Oh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Th(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 Ah(n,e,t){const i=n.slice();return i[16]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Ph(n){let e;return{c(){e=_("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 Lh(n,e){let t,i=e[16].lang+"",s,l,r,o;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&_e(s,i),f&20&&ne(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),r=!1,o()}}}function Fh(n,e){let t,i,s,l;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[16].code),i.$set(a),o&20&&ne(t,"active",e[2]===e[16].lang)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function lO(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rO(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function oO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("User "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function aO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("Relation record "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function uO(n){let e,t,i,s,l;return{c(){e=H("FormData object."),t=_("br"),i=H(`
Set to `),s=_("code"),s.textContent="null",l=H(" to delete already uploaded file(s).")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),w(r,s,o),w(r,l,o)},p:re,d(r){r&&k(e),r&&k(t),r&&k(i),r&&k(s),r&&k(l)}}}function fO(n){let e;return{c(){e=H("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function cO(n){let e;return{c(){e=H("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function dO(n){let e;return{c(){e=H("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function pO(n){let e;return{c(){e=H("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function hO(n){let e;return{c(){e=H("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Ih(n,e){let t,i,s,l,r,o=e[13].name+"",a,u,f,c,d=U.getFieldValueType(e[13])+"",h,g,y,b;function v(A,D){return A[13].required?rO:lO}let S=v(e),C=S(e);function M(A,D){if(A[13].type==="text")return hO;if(A[13].type==="number")return pO;if(A[13].type==="json")return dO;if(A[13].type==="email")return cO;if(A[13].type==="url")return fO;if(A[13].type==="file")return uO;if(A[13].type==="relation")return aO;if(A[13].type==="user")return oO}let $=M(e),T=$&&$(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=O(),r=_("span"),a=H(o),u=O(),f=_("td"),c=_("span"),h=H(d),g=O(),y=_("td"),T&&T.c(),b=O(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(A,D){w(A,t,D),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,r),m(r,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,y),T&&T.m(y,null),m(t,b)},p(A,D){e=A,S!==(S=v(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(s,l))),D&1&&o!==(o=e[13].name+"")&&_e(a,o),D&1&&d!==(d=U.getFieldValueType(e[13])+"")&&_e(h,d),$===($=M(e))&&T?T.p(e,D):(T&&T.d(1),T=$&&$(e),T&&(T.c(),T.m(y,null)))},d(A){A&&k(t),C.d(),T&&T.d()}}}function Nh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&_e(s,i),f&10&&ne(t,"active",e[1]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Rh(n,e){let t,i,s,l;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&8&&(a.content=e[8].body),i.$set(a),o&10&&ne(t,"active",e[1]===e[8].code)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function mO(n){var Ot;let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v=n[0].name+"",S,C,M,$,T,A,D,P,L,N,R,J=[],W=new Map,q,x,K=[],Y=new Map,te,fe,ye,se,G,Oe,ee,be=[],ue=new Map,ie,ve,je,Le,qe,oe=[],le=new Map,ke,Ve,ze=[],Ge=new Map,ge,Ae=n[5]&&Ph(),Z=n[4];const ae=me=>me[16].lang;for(let me=0;me<Z.length;me+=1){let Ce=Eh(n,Z,me),Ke=ae(Ce);W.set(Ke,J[me]=Lh(Ke,Ce))}let Be=n[4];const vt=me=>me[16].lang;for(let me=0;me<Be.length;me+=1){let Ce=Ah(n,Be,me),Ke=vt(Ce);Y.set(Ke,K[me]=Fh(Ke,Ce))}let it=(Ot=n[0])==null?void 0:Ot.schema;const gt=me=>me[13].name;for(let me=0;me<it.length;me+=1){let Ce=Dh(n,it,me),Ke=gt(Ce);ue.set(Ke,be[me]=Ih(Ke,Ce))}let at=n[3];const yt=me=>me[8].code;for(let me=0;me<at.length;me+=1){let Ce=Th(n,at,me),Ke=yt(Ce);le.set(Ke,oe[me]=Nh(Ke,Ce))}let zt=n[3];const $t=me=>me[8].code;for(let me=0;me<zt.length;me+=1){let Ce=Oh(n,zt,me),Ke=$t(Ce);Ge.set(Ke,ze[me]=Rh(Ke,Ce))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records"),c=O(),Ae&&Ae.c(),d=O(),h=_("div"),g=_("p"),y=H("Create a new "),b=_("strong"),S=H(v),C=H(" record."),M=O(),$=_("p"),$.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,T=O(),A=_("p"),A.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",D=O(),P=_("div"),P.textContent="Client SDKs example",L=O(),N=_("div"),R=_("div");for(let me=0;me<J.length;me+=1)J[me].c();q=O(),x=_("div");for(let me=0;me<K.length;me+=1)K[me].c();te=O(),fe=_("div"),fe.textContent="Body Parameters",ye=O(),se=_("table"),G=_("thead"),G.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Oe=O(),ee=_("tbody");for(let me=0;me<be.length;me+=1)be[me].c();ie=O(),ve=_("div"),ve.textContent="Responses",je=O(),Le=_("div"),qe=_("div");for(let me=0;me<oe.length;me+=1)oe[me].c();ke=O(),Ve=_("div");for(let me=0;me<ze.length;me+=1)ze[me].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(P,"class","section-title"),p(R,"class","tabs-header compact left"),p(x,"class","tabs-content"),p(N,"class","tabs m-b-lg"),p(fe,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(qe,"class","tabs-header compact left"),p(Ve,"class","tabs-content"),p(Le,"class","tabs")},m(me,Ce){w(me,e,Ce),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(e,c),Ae&&Ae.m(e,null),w(me,d,Ce),w(me,h,Ce),m(h,g),m(g,y),m(g,b),m(b,S),m(g,C),m(h,M),m(h,$),m(h,T),m(h,A),w(me,D,Ce),w(me,P,Ce),w(me,L,Ce),w(me,N,Ce),m(N,R);for(let Ke=0;Ke<J.length;Ke+=1)J[Ke].m(R,null);m(N,q),m(N,x);for(let Ke=0;Ke<K.length;Ke+=1)K[Ke].m(x,null);w(me,te,Ce),w(me,fe,Ce),w(me,ye,Ce),w(me,se,Ce),m(se,G),m(se,Oe),m(se,ee);for(let Ke=0;Ke<be.length;Ke+=1)be[Ke].m(ee,null);w(me,ie,Ce),w(me,ve,Ce),w(me,je,Ce),w(me,Le,Ce),m(Le,qe);for(let Ke=0;Ke<oe.length;Ke+=1)oe[Ke].m(qe,null);m(Le,ke),m(Le,Ve);for(let Ke=0;Ke<ze.length;Ke+=1)ze[Ke].m(Ve,null);ge=!0},p(me,[Ce]){var Ke;(!ge||Ce&1)&&a!==(a=me[0].name+"")&&_e(u,a),me[5]?Ae||(Ae=Ph(),Ae.c(),Ae.m(e,null)):Ae&&(Ae.d(1),Ae=null),(!ge||Ce&1)&&v!==(v=me[0].name+"")&&_e(S,v),Ce&20&&(Z=me[4],J=ot(J,Ce,ae,1,me,Z,W,R,an,Lh,null,Eh)),Ce&20&&(Be=me[4],Te(),K=ot(K,Ce,vt,1,me,Be,Y,x,Lt,Fh,null,Ah),De()),Ce&1&&(it=(Ke=me[0])==null?void 0:Ke.schema,be=ot(be,Ce,gt,1,me,it,ue,ee,an,Ih,null,Dh)),Ce&10&&(at=me[3],oe=ot(oe,Ce,yt,1,me,at,le,qe,an,Nh,null,Th)),Ce&10&&(zt=me[3],Te(),ze=ot(ze,Ce,$t,1,me,zt,Ge,Ve,Lt,Rh,null,Oh),De())},i(me){if(!ge){for(let Ce=0;Ce<Be.length;Ce+=1)E(K[Ce]);for(let Ce=0;Ce<zt.length;Ce+=1)E(ze[Ce]);ge=!0}},o(me){for(let Ce=0;Ce<K.length;Ce+=1)F(K[Ce]);for(let Ce=0;Ce<ze.length;Ce+=1)F(ze[Ce]);ge=!1},d(me){me&&k(e),Ae&&Ae.d(),me&&k(d),me&&k(h),me&&k(D),me&&k(P),me&&k(L),me&&k(N);for(let Ce=0;Ce<J.length;Ce+=1)J[Ce].d();for(let Ce=0;Ce<K.length;Ce+=1)K[Ce].d();me&&k(te),me&&k(fe),me&&k(ye),me&&k(se);for(let Ce=0;Ce<be.length;Ce+=1)be[Ce].d();me&&k(ie),me&&k(ve),me&&k(je),me&&k(Le);for(let Ce=0;Ce<oe.length;Ce+=1)oe[Ce].d();for(let Ce=0;Ce<ze.length;Ce+=1)ze[Ce].d()}}}function gO(n,e,t){let i,{collection:s=new Pn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(2,r=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,o=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[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("${s==null?void 0:s.name}", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,r,o,a,i,u,f]}class _O extends Ne{constructor(e){super(),Ie(this,e,gO,mO,Pe,{collection:0})}}function jh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[8]=e[t],i}function qh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Vh(n,e,t){const i=n.slice();return i[16]=e[t],i}function zh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Bh(n){let e;return{c(){e=_("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 Uh(n,e){let t,i=e[16].lang+"",s,l,r,o;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&_e(s,i),f&20&&ne(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),r=!1,o()}}}function Wh(n,e){let t,i,s,l;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[16].code),i.$set(a),o&20&&ne(t,"active",e[2]===e[16].lang)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function bO(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yO(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function vO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("User "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function kO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("Relation record "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function wO(n){let e,t,i,s,l;return{c(){e=H("FormData object."),t=_("br"),i=H(`
Set to `),s=_("code"),s.textContent="null",l=H(" to delete already uploaded file(s).")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),w(r,s,o),w(r,l,o)},p:re,d(r){r&&k(e),r&&k(t),r&&k(i),r&&k(s),r&&k(l)}}}function SO(n){let e;return{c(){e=H("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function CO(n){let e;return{c(){e=H("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function MO(n){let e;return{c(){e=H("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function $O(n){let e;return{c(){e=H("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function OO(n){let e;return{c(){e=H("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Yh(n,e){let t,i,s,l,r,o=e[13].name+"",a,u,f,c,d=U.getFieldValueType(e[13])+"",h,g,y,b;function v(A,D){return A[13].required?yO:bO}let S=v(e),C=S(e);function M(A,D){if(A[13].type==="text")return OO;if(A[13].type==="number")return $O;if(A[13].type==="json")return MO;if(A[13].type==="email")return CO;if(A[13].type==="url")return SO;if(A[13].type==="file")return wO;if(A[13].type==="relation")return kO;if(A[13].type==="user")return vO}let $=M(e),T=$&&$(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=O(),r=_("span"),a=H(o),u=O(),f=_("td"),c=_("span"),h=H(d),g=O(),y=_("td"),T&&T.c(),b=O(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(A,D){w(A,t,D),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,r),m(r,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,y),T&&T.m(y,null),m(t,b)},p(A,D){e=A,S!==(S=v(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(s,l))),D&1&&o!==(o=e[13].name+"")&&_e(a,o),D&1&&d!==(d=U.getFieldValueType(e[13])+"")&&_e(h,d),$===($=M(e))&&T?T.p(e,D):(T&&T.d(1),T=$&&$(e),T&&(T.c(),T.m(y,null)))},d(A){A&&k(t),C.d(),T&&T.d()}}}function Kh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&_e(s,i),f&10&&ne(t,"active",e[1]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Jh(n,e){let t,i,s,l;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&8&&(a.content=e[8].body),i.$set(a),o&10&&ne(t,"active",e[1]===e[8].code)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function TO(n){var fn;let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,S=n[0].name+"",C,M,$,T,A,D,P,L,N,R,J,W=[],q=new Map,x,K,Y=[],te=new Map,fe,ye,se,G,Oe,ee,be,ue,ie,ve,je,Le=[],qe=new Map,oe,le,ke,Ve,ze,Ge=[],ge=new Map,Ae,Z,ae=[],Be=new Map,vt,it=n[5]&&Bh(),gt=n[4];const at=ce=>ce[16].lang;for(let ce=0;ce<gt.length;ce+=1){let we=zh(n,gt,ce),Ze=at(we);q.set(Ze,W[ce]=Uh(Ze,we))}let yt=n[4];const zt=ce=>ce[16].lang;for(let ce=0;ce<yt.length;ce+=1){let we=Vh(n,yt,ce),Ze=zt(we);te.set(Ze,Y[ce]=Wh(Ze,we))}let $t=(fn=n[0])==null?void 0:fn.schema;const Ot=ce=>ce[13].name;for(let ce=0;ce<$t.length;ce+=1){let we=qh(n,$t,ce),Ze=Ot(we);qe.set(Ze,Le[ce]=Yh(Ze,we))}let me=n[3];const Ce=ce=>ce[8].code;for(let ce=0;ce<me.length;ce+=1){let we=Hh(n,me,ce),Ze=Ce(we);ge.set(Ze,Ge[ce]=Kh(Ze,we))}let Ke=n[3];const st=ce=>ce[8].code;for(let ce=0;ce<Ke.length;ce+=1){let we=jh(n,Ke,ce),Ze=st(we);Be.set(Ze,ae[ce]=Jh(Ze,we))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),it&&it.c(),h=O(),g=_("div"),y=_("p"),b=H("Update a single "),v=_("strong"),C=H(S),M=H(" record."),$=O(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,A=O(),D=_("p"),D.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=O(),L=_("div"),L.textContent="Client SDKs example",N=O(),R=_("div"),J=_("div");for(let ce=0;ce<W.length;ce+=1)W[ce].c();x=O(),K=_("div");for(let ce=0;ce<Y.length;ce+=1)Y[ce].c();fe=O(),ye=_("div"),ye.textContent="Path parameters",se=O(),G=_("table"),G.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>`,Oe=O(),ee=_("div"),ee.textContent="Body Parameters",be=O(),ue=_("table"),ie=_("thead"),ie.innerHTML=`<tr><th>Param</th>
<th width="60%">Type</th>
<th width="50%">Description</th></tr>`,ve=O(),je=_("tbody");for(let ce=0;ce<Le.length;ce+=1)Le[ce].c();oe=O(),le=_("div"),le.textContent="Responses",ke=O(),Ve=_("div"),ze=_("div");for(let ce=0;ce<Ge.length;ce+=1)Ge[ce].c();Ae=O(),Z=_("div");for(let ce=0;ce<ae.length;ce+=1)ae[ce].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(L,"class","section-title"),p(J,"class","tabs-header compact left"),p(K,"class","tabs-content"),p(R,"class","tabs m-b-lg"),p(ye,"class","section-title"),p(G,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(ue,"class","table-compact table-border m-b-lg"),p(le,"class","section-title"),p(ze,"class","tabs-header compact left"),p(Z,"class","tabs-content"),p(Ve,"class","tabs")},m(ce,we){w(ce,e,we),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),it&&it.m(e,null),w(ce,h,we),w(ce,g,we),m(g,y),m(y,b),m(y,v),m(v,C),m(y,M),m(g,$),m(g,T),m(g,A),m(g,D),w(ce,P,we),w(ce,L,we),w(ce,N,we),w(ce,R,we),m(R,J);for(let Ze=0;Ze<W.length;Ze+=1)W[Ze].m(J,null);m(R,x),m(R,K);for(let Ze=0;Ze<Y.length;Ze+=1)Y[Ze].m(K,null);w(ce,fe,we),w(ce,ye,we),w(ce,se,we),w(ce,G,we),w(ce,Oe,we),w(ce,ee,we),w(ce,be,we),w(ce,ue,we),m(ue,ie),m(ue,ve),m(ue,je);for(let Ze=0;Ze<Le.length;Ze+=1)Le[Ze].m(je,null);w(ce,oe,we),w(ce,le,we),w(ce,ke,we),w(ce,Ve,we),m(Ve,ze);for(let Ze=0;Ze<Ge.length;Ze+=1)Ge[Ze].m(ze,null);m(Ve,Ae),m(Ve,Z);for(let Ze=0;Ze<ae.length;Ze+=1)ae[Ze].m(Z,null);vt=!0},p(ce,[we]){var Ze;(!vt||we&1)&&a!==(a=ce[0].name+"")&&_e(u,a),ce[5]?it||(it=Bh(),it.c(),it.m(e,null)):it&&(it.d(1),it=null),(!vt||we&1)&&S!==(S=ce[0].name+"")&&_e(C,S),we&20&&(gt=ce[4],W=ot(W,we,at,1,ce,gt,q,J,an,Uh,null,zh)),we&20&&(yt=ce[4],Te(),Y=ot(Y,we,zt,1,ce,yt,te,K,Lt,Wh,null,Vh),De()),we&1&&($t=(Ze=ce[0])==null?void 0:Ze.schema,Le=ot(Le,we,Ot,1,ce,$t,qe,je,an,Yh,null,qh)),we&10&&(me=ce[3],Ge=ot(Ge,we,Ce,1,ce,me,ge,ze,an,Kh,null,Hh)),we&10&&(Ke=ce[3],Te(),ae=ot(ae,we,st,1,ce,Ke,Be,Z,Lt,Jh,null,jh),De())},i(ce){if(!vt){for(let we=0;we<yt.length;we+=1)E(Y[we]);for(let we=0;we<Ke.length;we+=1)E(ae[we]);vt=!0}},o(ce){for(let we=0;we<Y.length;we+=1)F(Y[we]);for(let we=0;we<ae.length;we+=1)F(ae[we]);vt=!1},d(ce){ce&&k(e),it&&it.d(),ce&&k(h),ce&&k(g),ce&&k(P),ce&&k(L),ce&&k(N),ce&&k(R);for(let we=0;we<W.length;we+=1)W[we].d();for(let we=0;we<Y.length;we+=1)Y[we].d();ce&&k(fe),ce&&k(ye),ce&&k(se),ce&&k(G),ce&&k(Oe),ce&&k(ee),ce&&k(be),ce&&k(ue);for(let we=0;we<Le.length;we+=1)Le[we].d();ce&&k(oe),ce&&k(le),ce&&k(ke),ce&&k(Ve);for(let we=0;we<Ge.length;we+=1)Ge[we].d();for(let we=0;we<ae.length;we+=1)ae[we].d()}}}function DO(n,e,t){let i,{collection:s=new Pn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(2,r=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,o=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[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("${s==null?void 0:s.name}", "RECORD_ID", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,r,o,a,i,u,f]}class AO extends Ne{constructor(e){super(),Ie(this,e,DO,TO,Pe,{collection:0})}}function xh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Gh(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=_("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+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&ne(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function tm(n,e){let t,i,s,l;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&ne(t,"active",e[3]===e[13].lang)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function nm(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&36&&ne(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function im(n,e){let t,i,s,l;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&ne(t,"active",e[2]===e[8].code)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function EO(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,S=n[0].name+"",C,M,$,T,A,D,P,L=[],N=new Map,R,J,W=[],q=new Map,x,K,Y,te,fe,ye,se,G,Oe,ee=[],be=new Map,ue,ie,ve=[],je=new Map,Le,qe=n[1]&&Qh(),oe=n[4];const le=Z=>Z[13].lang;for(let Z=0;Z<oe.length;Z+=1){let ae=Xh(n,oe,Z),Be=le(ae);N.set(Be,L[Z]=em(Be,ae))}let ke=n[4];const Ve=Z=>Z[13].lang;for(let Z=0;Z<ke.length;Z+=1){let ae=Zh(n,ke,Z),Be=Ve(ae);q.set(Be,W[Z]=tm(Be,ae))}let ze=n[5];const Ge=Z=>Z[8].code;for(let Z=0;Z<ze.length;Z+=1){let ae=Gh(n,ze,Z),Be=Ge(ae);be.set(Be,ee[Z]=nm(Be,ae))}let ge=n[5];const Ae=Z=>Z[8].code;for(let Z=0;Z<ge.length;Z+=1){let ae=xh(n,ge,Z),Be=Ae(ae);je.set(Be,ve[Z]=im(Be,ae))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),qe&&qe.c(),h=O(),g=_("div"),y=_("p"),b=H("Delete a single "),v=_("strong"),C=H(S),M=H(" record."),$=O(),T=_("div"),T.textContent="Client SDKs example",A=O(),D=_("div"),P=_("div");for(let Z=0;Z<L.length;Z+=1)L[Z].c();R=O(),J=_("div");for(let Z=0;Z<W.length;Z+=1)W[Z].c();x=O(),K=_("div"),K.textContent="Path parameters",Y=O(),te=_("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>`,fe=O(),ye=_("div"),ye.textContent="Responses",se=O(),G=_("div"),Oe=_("div");for(let Z=0;Z<ee.length;Z+=1)ee[Z].c();ue=O(),ie=_("div");for(let Z=0;Z<ve.length;Z+=1)ve[Z].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","tabs-header compact left"),p(J,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(K,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(Oe,"class","tabs-header compact left"),p(ie,"class","tabs-content"),p(G,"class","tabs")},m(Z,ae){w(Z,e,ae),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),qe&&qe.m(e,null),w(Z,h,ae),w(Z,g,ae),m(g,y),m(y,b),m(y,v),m(v,C),m(y,M),w(Z,$,ae),w(Z,T,ae),w(Z,A,ae),w(Z,D,ae),m(D,P);for(let Be=0;Be<L.length;Be+=1)L[Be].m(P,null);m(D,R),m(D,J);for(let Be=0;Be<W.length;Be+=1)W[Be].m(J,null);w(Z,x,ae),w(Z,K,ae),w(Z,Y,ae),w(Z,te,ae),w(Z,fe,ae),w(Z,ye,ae),w(Z,se,ae),w(Z,G,ae),m(G,Oe);for(let Be=0;Be<ee.length;Be+=1)ee[Be].m(Oe,null);m(G,ue),m(G,ie);for(let Be=0;Be<ve.length;Be+=1)ve[Be].m(ie,null);Le=!0},p(Z,[ae]){(!Le||ae&1)&&a!==(a=Z[0].name+"")&&_e(u,a),Z[1]?qe||(qe=Qh(),qe.c(),qe.m(e,null)):qe&&(qe.d(1),qe=null),(!Le||ae&1)&&S!==(S=Z[0].name+"")&&_e(C,S),ae&24&&(oe=Z[4],L=ot(L,ae,le,1,Z,oe,N,P,an,em,null,Xh)),ae&24&&(ke=Z[4],Te(),W=ot(W,ae,Ve,1,Z,ke,q,J,Lt,tm,null,Zh),De()),ae&36&&(ze=Z[5],ee=ot(ee,ae,Ge,1,Z,ze,be,Oe,an,nm,null,Gh)),ae&36&&(ge=Z[5],Te(),ve=ot(ve,ae,Ae,1,Z,ge,je,ie,Lt,im,null,xh),De())},i(Z){if(!Le){for(let ae=0;ae<ke.length;ae+=1)E(W[ae]);for(let ae=0;ae<ge.length;ae+=1)E(ve[ae]);Le=!0}},o(Z){for(let ae=0;ae<W.length;ae+=1)F(W[ae]);for(let ae=0;ae<ve.length;ae+=1)F(ve[ae]);Le=!1},d(Z){Z&&k(e),qe&&qe.d(),Z&&k(h),Z&&k(g),Z&&k($),Z&&k(T),Z&&k(A),Z&&k(D);for(let ae=0;ae<L.length;ae+=1)L[ae].d();for(let ae=0;ae<W.length;ae+=1)W[ae].d();Z&&k(x),Z&&k(K),Z&&k(Y),Z&&k(te),Z&&k(fe),Z&&k(ye),Z&&k(se),Z&&k(G);for(let ae=0;ae<ee.length;ae+=1)ee[ae].d();for(let ae=0;ae<ve.length;ae+=1)ve[ae].d()}}}function PO(n,e,t){let i,{collection:s=new Pn}=e,l=204,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:204,body:`
null
`}),o.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&&o.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),o.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("${s==null?void 0:s.name}", "RECORD_ID")
.then(function () {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,r,a,o,u,f]}class LO extends Ne{constructor(e){super(),Ie(this,e,PO,EO,Pe,{collection:0})}}function sm(n,e,t){const i=n.slice();return i[4]=e[t],i}function lm(n,e,t){const i=n.slice();return i[4]=e[t],i}function rm(n,e){let t,i=e[4].lang+"",s,l,r,o;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&4&&i!==(i=e[4].lang+"")&&_e(s,i),f&6&&ne(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),r=!1,o()}}}function om(n,e){let t,i,s,l;return i=new tn({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&4&&(a.content=e[4].code),i.$set(a),o&6&&ne(t,"active",e[1]===e[4].lang)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function FO(n){let e,t,i,s,l,r,o,a,u=[],f=new Map,c,d,h=[],g=new Map,y,b,v,S,C,M=n[2];const $=D=>D[4].lang;for(let D=0;D<M.length;D+=1){let P=lm(n,M,D),L=$(P);f.set(L,u[D]=rm(L,P))}let T=n[2];const A=D=>D[4].lang;for(let D=0;D<T.length;D+=1){let P=sm(n,T,D),L=A(P);g.set(L,h[D]=om(L,P))}return S=new tn({props:{content:JSON.stringify({action:"create",record:U.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
<div class="content"><p>/api/realtime</p></div>`,t=O(),i=_("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 &quot;Event data format&quot; 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&#39;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&#39;s
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p></div></div>`,s=O(),l=_("div"),l.textContent="Client SDKs example",r=O(),o=_("div"),a=_("div");for(let D=0;D<u.length;D+=1)u[D].c();c=O(),d=_("div");for(let D=0;D<h.length;D+=1)h[D].c();y=O(),b=_("div"),b.textContent="Event data format",v=O(),B(S.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(a,"class","tabs-header compact left"),p(d,"class","tabs-content"),p(o,"class","tabs m-b-base"),p(b,"class","section-title")},m(D,P){w(D,e,P),w(D,t,P),w(D,i,P),w(D,s,P),w(D,l,P),w(D,r,P),w(D,o,P),m(o,a);for(let L=0;L<u.length;L+=1)u[L].m(a,null);m(o,c),m(o,d);for(let L=0;L<h.length;L+=1)h[L].m(d,null);w(D,y,P),w(D,b,P),w(D,v,P),V(S,D,P),C=!0},p(D,[P]){P&6&&(M=D[2],u=ot(u,P,$,1,D,M,f,a,an,rm,null,lm)),P&6&&(T=D[2],Te(),h=ot(h,P,A,1,D,T,g,d,Lt,om,null,sm),De());const L={};P&1&&(L.content=JSON.stringify({action:"create",record:U.dummyCollectionRecord(D[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),S.$set(L)},i(D){if(!C){for(let P=0;P<T.length;P+=1)E(h[P]);E(S.$$.fragment,D),C=!0}},o(D){for(let P=0;P<h.length;P+=1)F(h[P]);F(S.$$.fragment,D),C=!1},d(D){D&&k(e),D&&k(t),D&&k(i),D&&k(s),D&&k(l),D&&k(r),D&&k(o);for(let P=0;P<u.length;P+=1)u[P].d();for(let P=0;P<h.length;P+=1)h[P].d();D&&k(y),D&&k(b),D&&k(v),z(S,D)}}}function IO(n,e,t){let{collection:i=new Pn}=e,s="JavaScript",l=[];const r=o=>t(1,s=o.lang);return n.$$set=o=>{"collection"in o&&t(0,i=o.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{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.record);
});
// Subscribe to changes in a single record
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
console.log(e.record);
});
// 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
2022-07-09 16:16:35 +08:00
`}])},[i,s,l,r]}class NO extends Ne{constructor(e){super(),Ie(this,e,IO,FO,Pe,{collection:0})}}function am(n,e,t){const i=n.slice();return i[14]=e[t],i}function um(n,e,t){const i=n.slice();return i[14]=e[t],i}function fm(n){let e,t,i,s;var l=n[14].component;function r(o){return{props:{collection:o[3]}}}return l&&(t=new l(r(n))),{c(){e=_("div"),t&&B(t.$$.fragment),i=O(),p(e,"class","tab-item active")},m(o,a){w(o,e,a),t&&V(t,e,null),m(e,i),s=!0},p(o,a){const u={};if(a&8&&(u.collection=o[3]),l!==(l=o[14].component)){if(t){Te();const f=t;F(f.$$.fragment,1,0,()=>{z(f,1)}),De()}l?(t=new l(r(o)),B(t.$$.fragment),E(t.$$.fragment,1),V(t,e,i)):t=null}else l&&t.$set(u)},i(o){s||(t&&E(t.$$.fragment,o),s=!0)},o(o){t&&F(t.$$.fragment,o),s=!1},d(o){o&&k(e),t&&z(t)}}}function cm(n,e){let t,i,s,l=e[4]===e[14].id&&fm(e);return{key:n,first:null,c(){t=rt(),l&&l.c(),i=rt(),this.first=t},m(r,o){w(r,t,o),l&&l.m(r,o),w(r,i,o),s=!0},p(r,o){e=r,e[4]===e[14].id?l?(l.p(e,o),o&16&&E(l,1)):(l=fm(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Te(),F(l,1,1,()=>{l=null}),De())},i(r){s||(E(l),s=!0)},o(r){F(l),s=!1},d(r){r&&k(t),l&&l.d(r),r&&k(i)}}}function RO(n){let e,t=[],i=new Map,s,l=n[5];const r=o=>o[14].id;for(let o=0;o<l.length;o+=1){let a=am(n,l,o),u=r(a);i.set(u,t[o]=cm(u,a))}return{c(){e=_("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","tabs-content")},m(o,a){w(o,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(o,a){a&56&&(l=o[5],Te(),t=ot(t,a,r,1,o,l,i,e,Lt,cm,null,am),De())},i(o){if(!s){for(let a=0;a<l.length;a+=1)E(t[a]);s=!0}},o(o){for(let a=0;a<t.length;a+=1)F(t[a]);s=!1},d(o){o&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function dm(n,e){let t,i,s=e[14].label+"",l,r,o,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=H(s),r=O(),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(c,d){w(c,t,d),m(t,i),m(i,l),m(t,r),o||(a=[X(t,"click",u),X(t,"keydown",Bg(f))],o=!0)},p(c,d){e=c,d&48&&ne(t,"active",e[4]===e[14].id)},d(c){c&&k(t),o=!1,lt(a)}}}function jO(n){let e,t,i=n[3].name+"",s,l,r,o,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=um(n,f,d),g=c(h);u.set(g,a[d]=dm(g,h))}return{c(){e=_("h4"),t=_("strong"),s=H(i),l=H(" records API"),r=O(),o=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(o,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,r,h),w(d,o,h);for(let g=0;g<a.length;g+=1)a[g].m(o,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&_e(s,i),h&114&&(f=d[5],a=ot(a,h,c,1,d,f,u,o,an,dm,null,um))},d(d){d&&k(e),d&&k(r),d&&k(o);for(let h=0;h<a.length;h+=1)a[h].d()}}}function HO(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[8]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function qO(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[HO],header:[jO],default:[RO]},$$scope:{ctx:n}};return e=new Ti({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const r={};l&524312&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[11](null),z(e,s)}}}function VO(n,e,t){const i=[{id:"list",label:"List",component:tO},{id:"view",label:"View",component:sO},{id:"create",label:"Create",component:_O},{id:"update",label:"Update",component:AO},{id:"delete",label:"Delete",component:LO},{id:"realtime",label:"Realtime",component:NO}];let s,l=new Pn,r=i[0].id;function o(v){return t(3,l=v),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(v){t(4,r=v)}function f(v,S){(v.code==="Enter"||v.code==="Space")&&(v.preventDefault(),u(S))}const c=()=>a(),d=v=>u(v.id),h=(v,S)=>f(S,v.id);function g(v){he[v?"unshift":"push"](()=>{s=v,t(2,s)})}function y(v){ut.call(this,n,v)}function b(v){ut.call(this,n,v)}return[a,u,s,l,r,i,f,o,c,d,h,g,y,b]}class zO extends Ne{constructor
2022-07-09 05:53:10 +08:00
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(o,a){w(o,e,a),m(e,t),n[18](t),m(e,i),m(e,s),l||(r=[X(t,"change",n[19]),X(s,"click",n[20])],l=!0)},p(o,a){a&32&&(t.multiple=o[5])},d(o){o&&k(e),n[18](null),l=!1,lt(r)}}}function qT(n){let e,t,i,s,l,r=n[3].name+"",o,a,u,f,c=[],d=new Map,h,g,y,b=n[4];const v=T=>T[28];for(let T=0;T<b.length;T+=1){let A=mm(n,b,T),D=v(A);d.set(D,c[T]=gm(D,A))}let S=n[0],C=[];for(let T=0;T<S.length;T+=1)C[T]=_m(hm(n,S,T));const M=T=>F(C[T],1,1,()=>{C[T]=null});let $=!n[9]&&bm(n);return{c(){e=_("label"),t=_("i"),s=O(),l=_("span"),o=H(r),u=O(),f=_("div");for(let T=0;T<c.length;T+=1)c[T].c();h=O();for(let T=0;T<C.length;T+=1)C[T].c();g=O(),$&&$.c(),p(t,"class",i=U.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[24]),p(f,"class","files-list")},m(T,A){w(T,e,A),m(e,t),m(e,s),m(e,l),m(l,o),w(T,u,A),w(T,f,A);for(let D=0;D<c.length;D+=1)c[D].m(f,null);m(f,h);for(let D=0;D<C.length;D+=1)C[D].m(f,null);m(f,g),$&&$.m(f,null),n[21](f),y=!0},p(T,A){if((!y||A&8&&i!==(i=U.getFieldTypeIcon(T[3].type)))&&p(t,"class",i),(!y||A&8)&&r!==(r=T[3].name+"")&&_e(o,r),(!y||A&16777216&&a!==(a=T[24]))&&p(e,"for",a),A&3222&&(b=T[4],Te(),c=ot(c,A,v,1,T,b,d,f,Lt,gm,h,mm),De()),A&4097){S=T[0];let D;for(D=0;D<S.length;D+=1){const P=hm(T,S,D);C[D]?(C[D].p(P,A),E(C[D],1)):(C[D]=_m(P),C[D].c(),E(C[D],1),C[D].m(f,g))}for(Te(),D=S.length;D<C.length;D+=1)M(D);De()}T[9]?$&&($.d(1),$=null):$?$.p(T,A):($=bm(T),$.c(),$.m(f,null))},i(T){if(!y){for(let A=0;A<b.length;A+=1)E(c[A]);for(let A=0;A<S.length;A+=1)E(C[A]);y=!0}},o(T){for(let A=0;A<c.length;A+=1)F(c[A]);C=C.filter(Boolean);for(let A=0;A<C.length;A+=1)F(C[A]);y=!1},d(T){T&&k(e),T&&k(u),T&&k(f);for(let A=0;A<c.length;A+=1)c[A].d();zn(C,T),$&&$.d(),n[21](null)}}}function VT(n){let e,t,i,s;e=new He({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[qT,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}});let l={};return i=new LT({props:l}),n[22](i),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(r,o){V(e,r,o),w(r,t,o),V(i,r,o),s=!0},p(r,[o]){const a={};o&8&&(a.class="form-field form-field-file "+(r[3].required?"required":"")),o&8&&(a.name=r[3].name),o&1090520063&&(a.$$scope={dirty:o,ctx:r}),e.$set(a);const u={};i.$set(u)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){F(e.$$.fragment,r),F(i.$$.fragment,r),s=!1},d(r){z(e,r),r&&k(t),n[22](null),z(i,r)}}}function zT(n,e,t){let i,s,l,{record:r}=e,{value:o=null}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new kn}=e,c,d,h;function g(N){U.removeByValue(u,N),t(1,u)}function y(N){U.pushUnique(u,N),t(1,u)}function b(N){U.isEmpty(a[N])||a.splice(N,1),t(0,a)}function v(){h==null||h.dispatchEvent(new CustomEvent("change",{detail:{value:o,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const S=N=>U.hasImageExtension(N)?d==null?void 0:d.show(Se.Records.getFileUrl(r,N)):!1,C=N=>g(N),M=N=>y(N),$=N=>b(N);function T(N){he[N?"unshift":"push"](()=>{c=N,t(6,c)})}const A=()=>{for(let N of c.files)a.push(N);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function P(N){he[N?"unshift":"push"](()=>{h=N,t(8,h)})}function L(N){he[N?"unshift":"push"](()=>{d=N,t(7,d)})}return n.$$set=N=>{"record"in N&&t(2,r=N.record),"value"in N&&t(13,o=N.value),"uploadedFiles"in N&&t(0,a=N.uploadedFiles),"deletedFileIndexes"in N&&t(1,u=N.deletedFileIndexes),"field"in N&&t(3,f=N.field)},n.$$.update=()=>{var N,R;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=U.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=U.toArray(u))),n.$$.dirty&8&&t(5,i=((N=f.options)==null?void 0:N.maxSelect)>1),n.$$.dirty&8224&&(typeof o=="undefined"||o===null)&&t(13,o=i?[]:null),n.$$.dirty&8192&&t(4,s=U.toArray(o)),n.$$.dirty&27&&t(9,l=(s.length||a.length)&&((R=f.options)==null?void 0:R.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&v()},[a,u,r,f,s,i,c,d,h,l,g,y,b,o,S,C,M,$,T
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function dD(n){let e,t,i;function s(r){n[31](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new fD({props:l}),he.push(()=>Fe(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function pD(n){let e,t,i;function s(r){n[30](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new eD({props:l}),he.push(()=>Fe(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function hD(n){let e,t,i,s,l;function r(f){n[27](f,n[40])}function o(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new BT({props:u}),he.push(()=>Fe(e,"value",r)),he.push(()=>Fe(e,"uploadedFiles",o)),he.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){B(e.$$.fragment)},m(f,c){V(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],Re(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],Re(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],Re(()=>s=!1)),e.$set(d)},i(f){l||(E(e.$$.fragment,f),l=!0)},o(f){F(e.$$.fragment,f),l=!1},d(f){z(e,f)}}}function mD(n){let e,t,i;function s(r){n[26](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new ST({props:l}),he.push(()=>Fe(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function gD(n){let e,t,i;function s(r){n[25](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new yT({props:l}),he.push(()=>Fe(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function _D(n){let e,t,i;function s(r){n[24](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new mT({props:l}),he.push(()=>Fe(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function bD(n){let e,t,i;function s(r){n[23](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new cT({props:l}),he.push(()=>Fe(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function yD(n){let e,t,i;function s(r){n[22](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new oT({props:l}),he.push(()=>Fe(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function vD(n){let e,t,i;function s(r){n[21](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new iT({props:l}),he.push(()=>Fe(e,"value",
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function MD(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",r,o,a,u,f,c=!n[2].isNew&&n[9]&&Tm(n);return{c(){e=_("h4"),i=H(t),s=O(),r=H(l),o=H(" record"),a=O(),c&&c.c(),u=rt()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,r),m(e,o),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&_e(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&_e(r,l),!d[2].isNew&&d[9]?c?(c.p(d,h),h[0]&516&&E(c,1)):(c=Tm(d),c.c(),E(c,1),c.m(u.parentNode,u)):c&&(Te(),F(c,1,1,()=>{c=null}),De())},i(d){f||(E(c),f=!0)},o(d){F(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function $D(n){let e,t,i,s,l,r=n[2].isNew?"Create":"Save changes",o,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=O(),s=_("button"),l=_("span"),o=H(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ne(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,o),u||(f=X(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&r!==(r=c[2].isNew?"Create":"Save changes")&&_e(o,r),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&ne(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function OD(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[$D],header:[MD],default:[SD]},$$scope:{ctx:n}};return e=new Ti({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&288&&(r.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[33](null),z(e,s)}}}function Dm(n){return JSON.stringify(n)}function TD(n,e,t){let i,s,l,r;const o=vn(),a="record_"+U.randomString(5);let{collection:u}=e,f,c=null,d=new Xr,h=!1,g=!1,y={},b={},v="";function S(ue){return M(ue),t(8,g=!0),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}function M(ue){Wi({}),c=ue||{},t(2,d=ue!=null&&ue.clone?ue.clone():new Xr),t(3,y={}),t(4,b={}),t(15,v=Dm(d))}function $(){if(h||!s)return;t(7,h=!0);const ue=A();let ie;d.isNew?ie=Se.Records.create(u==null?void 0:u.id,ue):ie=Se.Records.update(u==null?void 0:u.id,d.id,ue),ie.then(async ve=>{hn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),C(),o("save",ve)}).catch(ve=>{Se.errorResponseHandler(ve)}).finally(()=>{t(7,h=!1)})}function T(){!(c!=null&&c.id)||Mi("Do you really want to delete the selected record?",()=>Se.Records.delete(c["@collectionId"],c.id).then(()=>{C(),hn("Successfully deleted record."),o("delete",c)}).catch(ue=>{Se.errorResponseHandler(ue)}))}function A(){const ue=(d==null?void 0:d.export())||{},ie=new FormData,ve={};for(const je of(u==null?void 0:u.schema)||[])ve[je.name]=je;for(const je in ue)!ve[je]||(typeof ue[je]=="undefined"&&(ue[je]=null),U.addValueToFormData(ie,je,ue[je]));for(const je in y){const Le=U.toArray(y[je]);for(const qe of Le)ie.append(je,qe)}for(const je in b){const Le=U.toArray(b[je]);for(const qe of Le)ie.append(je+"."+qe,"")}return ie}const D=()=>C(),P=()=>T();function L(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function N(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function R(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function J(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function W(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function q(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function x(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function K(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function Y(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function te(ue,ie){n.$$.not_equal(y[ie.name],ue)&&(y[ie.name]=ue,t(3,
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Vm(n){let e,t,i;return{c(){e=_("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(s,l){w(s,e,l),t||(i=X(e,"click",n[28]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function zm(n,e){let t,i,s;return i=new Ib({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=rt(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r[0]&8&&(o.record=e[35]),r[0]&2048&&(o.field=e[38]),i.$set(o)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function Bm(n,e){let t,i,s,l,r,o,a,u,f,c,d,h,g,y=[],b=new Map,v,S,C,M,$,T,A,D,P,L,N,R;function J(){return e[25](e[35])}h=new Io({props:{id:e[35].id}});let W=e[11];const q=Y=>Y[38].name;for(let Y=0;Y<W.length;Y+=1){let te=Rm(e,W,Y),fe=q(te);b.set(fe,y[Y]=zm(fe,te))}C=new Ci({props:{date:e[35].created}}),T=new Ci({props:{date:e[35].updated}});function x(){return e[26](e[35])}function K(...Y){return e[27](e[35],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=O(),u=_("label"),c=O(),d=_("td"),B(h.$$.fragment),g=O();for(let Y=0;Y<y.length;Y+=1)y[Y].c();v=O(),S=_("td"),B(C.$$.fragment),M=O(),$=_("td"),B(T.$$.fragment),A=O(),D=_("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',P=O(),p(l,"type","checkbox"),p(l,"id",r="checkbox_"+e[35].id),l.checked=o=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"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($,"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(Y,te){w(Y,t,te),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),V(h,d,null),m(t,g);for(let fe=0;fe<y.length;fe+=1)y[fe].m(t,null);m(t,v),m(t,S),V(C,S,null),m(t,M),m(t,$),V(T,$,null),m(t,A),m(t,D),m(t,P),L=!0,N||(R=[X(l,"change",J),X(s,"click",Bn(e[19])),X(t,"click",x),X(t,"keydown",K)],N=!0)},p(Y,te){e=Y,(!L||te[0]&8&&r!==(r="checkbox_"+e[35].id))&&p(l,"id",r),(!L||te[0]&40&&o!==(o=e[5][e[35].id]))&&(l.checked=o),(!L||te[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const fe={};te[0]&8&&(fe.id=e[35].id),h.$set(fe),te[0]&2056&&(W=e[11],Te(),y=ot(y,te,q,1,e,W,b,t,Lt,zm,v,Rm),De());const ye={};te[0]&8&&(ye.date=e[35].created),C.$set(ye);const se={};te[0]&8&&(se.date=e[35].updated),T.$set(se)},i(Y){if(!L){E(h.$$.fragment,Y);for(let te=0;te<W.length;te+=1)E(y[te]);E(C.$$.fragment,Y),E(T.$$.fragment,Y),L=!0}},o(Y){F(h.$$.fragment,Y);for(let te=0;te<y.length;te+=1)F(y[te]);F(C.$$.fragment,Y),F(T.$$.fragment,Y),L=!1},d(Y){Y&&k(t),z(h);for(let te=0;te<y.length;te+=1)y[te].d();z(C),z(T),N=!1,lt(R)}}}function Um(n){let e,t,i=n[3].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a[0]&8&&i!==(i=o[3].length+"")&&_e(s,i),a[0]&16&&_e(r,o[4])},d(o){o&&k(e)}}}function Wm(n){let e,t,i,s,l=n[4]-n[3].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),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(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=X(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&_e(r,l),c[0]&256&&ne(t,"btn-loading",f[8]),c[0]&256&&ne(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Ym(n){let e,t,i,s,l,r,o=n[6]===1?"record":"records",a,u,f,c,d,h,g,y,b,v,S;return{c(){e=_("div"),t=_("div"),i=H("Selected "),s=_("strong"),l=H(n[6]),r=O(),a=H(o),u=O(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=O(),d=_("div"),h=O(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ne(f,"btn
<span class="txt">API Preview</span>`,b=O(),v=_("button"),v.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,S=O(),B(C.$$.fragment),M=O(),B($.$$.fragment),p(r,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(l,"class","breadcrumbs"),p(d,"type","button"),p(d,"class","btn btn-secondary btn-circle"),p(y,"type","button"),p(y,"class","btn btn-outline"),p(v,"type","button"),p(v,"class","btn btn-expanded"),p(g,"class","btns-group"),p(s,"class","page-header"),p(i,"class","page-wrapper")},m(W,q){V(e,W,q),w(W,t,q),w(W,i,q),m(i,s),m(s,l),m(l,r),m(l,o),m(l,a),m(a,f),m(s,c),m(s,d),m(s,h),m(s,g),m(g,y),m(g,b),m(g,v),m(i,S),V(C,i,null),m(i,M),V($,i,null),D=!0,P||(L=[Xe(St.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(y,"click",n[13]),X(v,"click",n[14])],P=!0)},p(W,q){(!D||q&4)&&u!==(u=W[2].name+"")&&_e(f,u);const x={};q&1&&(x.value=W[0]),q&4&&(x.autocompleteCollection=W[2]),C.$set(x);const K={};q&4&&(K.collection=W[2]),!T&&q&1&&(T=!0,K.filter=W[0],Re(()=>T=!1)),!A&&q&2&&(A=!0,K.sort=W[1],Re(()=>A=!1)),$.$set(K)},i(W){D||(E(e.$$.fragment,W),E(C.$$.fragment,W),E($.$$.fragment,W),D=!0)},o(W){F(e.$$.fragment,W),F(C.$$.fragment,W),F($.$$.fragment,W),D=!1},d(W){z(e,W),W&&k(t),W&&k(i),z(C),n[16](null),z($),P=!1,lt(L)}}}function eA(n){let e,t,i,s,l,r,o,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),s=_("h1"),s.textContent="Create your first collection to add records!",l=O(),r=_("button"),r.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(t,"class","icon"),p(s,"class","m-b-10"),p(r,"type","button"),p(r,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,r),o||(a=X(r,"click",n[11]),o=!0)},p:re,i:re,o:re,d(u){u&&k(e),o=!1,a()}}}function tA(n){let e;return{c(){e=_("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:re,i:re,o:re,d(t){t&&k(e)}}}function nA(n){let e,t,i,s,l,r,o,a,u;const f=[tA,eA,QD],c=[];function d(b,v){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new hf({props:h}),n[20](s);let g={};r=new zO({props:g}),n[21](r);let y={collection:n[2]};return a=new Fb({props:y}),n[22](a),a.$on("save",n[23]),a.$on("delete",n[24]),{c(){t.c(),i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment)},m(b,v){c[e].m(b,v),w(b,i,v),V(s,b,v),w(b,l,v),V(r,b,v),w(b,o,v),V(a,b,v),u=!0},p(b,[v]){let S=e;e=d(b),e===S?c[e].p(b,v):(Te(),F(c[S],1,1,()=>{c[S]=null}),De(),t=c[e],t?t.p(b,v):(t=c[e]=f[e](b),t.c()),E(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const M={};r.$set(M);const $={};v&4&&($.collection=b[2]),a.$set($)},i(b){u||(E(t),E(s.$$.fragment,b),E(r.$$.fragment,b),E(a.$$.fragment,b),u=!0)},o(b){F(t),F(s.$$.fragment,b),F(r.$$.fragment,b),F(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[20](null),z(s,b),b&&k(l),n[21](null),z(r,b),b&&k(o),n[22](null),z(a,b)}}}function iA(n,e,t){var J;let i,s,l,r;pn(n,ui,W=>t(2,s=W)),pn(n,Ks,W=>t(10,l=W)),pn(n,du,W=>t(8,r=W));const o=U.getQueryParams((J=window.location)==null?void 0:J.href);let a,u,f,c,d=o.filter||"",h=o.sort||"-created",g=o.collectionId;U.setDocumentTitle("Collections"),b4(g);const y=()=>a==null?void 0:a.show(),b=()=>a==null?void 0:a.show(s),v=()=>u==null?void 0:u.show(s),S=()=>f==null?void 0:f.show(),C=W=>t(0,d=W.detail);function M(W){he[W?"unshift":"push"](()=>{c=W,t(6,c)})}function $(W){d=W,t(0,d),t(2,s),t(9,g)}function T(W){h=W,t(1,h),t(2,s),t(9,g)}const A=W=>f==null?void 0:f.show(W==null?void 0:W.detail);function D(W){he[W?"unshift":"push"](()=>{a=W,t(3,a)})}function P(W){he[W?"unshift":"push"](()=>{u=W,t(4,u)})}function L(W){he[W?"unshift":"push"](()=>{f=W,t(5,f)})}const N=()=>c==null?void 0:c.load(),R=()=>c==null?void 0:c.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(W=>W.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&g!=s.id&&(t(9,g=s.id),t(1,h="-created"),t(0,d="")),n.$$.dirty&7&&(h||d||(s==null?void 0:s.id))&&U.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:d,sort:h})},[d,h,s,a,u,f,c,i,r,g,l,y,b,v,S,C,M,$,T,A,D,P,L,N,R]}class sA extends Ne{constructor(e){super(),Ie(this,e,iA,nA,Pe,{})}}function Km(n){let e,t;return e=new He({props:{class:"form-field disabled",name:"id",$$slots:{default:[lA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function lA(n){let e,t,i,s,l,r,o,a,u;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="ID",r=O(),o=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(o,"type","text"),p(o,"id",a=n[31]),o.value=u=n[1].id,o.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,r,c),w(f,o,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(o,"id",a),c[0]&2&&u!==(u=f[1].id)&&o.value!==u&&(o.value=u)},d(f){f&&k(e),f&&k(r),f&&k(o)}}}function Jm(n){let e,t,i,s;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(l,r){w(l,e,r),i||(s=Xe(t=St.call(null,e,"Verified")),i=!0)},d(l){l&&k(e),i=!1,s()}}}function rA(n){let e,t,i,s,l,r,o,a,u,f,c,d=n[1].verified&&Jm();return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="Email",r=O(),d&&d.c(),o=O(),a=_("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,r,g),d&&d.m(h,g),w(h,o,g),w(h,a,g),$e(a,n[2]),f||(c=X(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Jm(),d.c(),d.m(o.parentNode,o)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=h[31])&&p(a,"id",u),g[0]&4&&a.value!==h[2]&&$e(a,h[2])},d(h){h&&k(e),h&&k(r)
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function pA(n){let e,t,i,s,l=!n[1].verified&&Qm(n);return{c(){l&&l.c(),e=O(),t=_("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(r,o){l&&l.m(r,o),w(r,e,o),w(r,t,o),i||(s=X(t,"click",n[17]),i=!0)},p(r,o){r[1].verified?l&&(l.d(1),l=null):l?l.p(r,o):(l=Qm(r),l.c(),l.m(e.parentNode,e))},d(r){l&&l.d(r),r&&k(e),r&&k(t),i=!1,s()}}}function hA(n){let e,t,i,s,l,r,o=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&Xm(n);return{c(){h&&h.c(),e=O(),t=_("button"),i=_("span"),i.textContent="Cancel",s=O(),l=_("button"),r=_("span"),a=H(o),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ne(l,"btn-loading",n[5])},m(g,y){h&&h.m(g,y),w(g,e,y),w(g,t,y),m(t,i),w(g,s,y),w(g,l,y),m(l,r),m(r,a),f=!0,c||(d=X(t,"click",n[18]),c=!0)},p(g,y){g[1].isNew?h&&(Te(),F(h,1,1,()=>{h=null}),De()):h?(h.p(g,y),y[0]&2&&E(h,1)):(h=Xm(g),h.c(),E(h,1),h.m(e.parentNode,e)),(!f||y[0]&32)&&(t.disabled=g[5]),(!f||y[0]&2)&&o!==(o=g[1].isNew?"Create":"Save changes")&&_e(a,o),(!f||y[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),y[0]&32&&ne(l,"btn-loading",g[5])},i(g){f||(E(h),f=!0)},o(g){F(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function mA(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[hA],header:[dA],default:[cA]},$$scope:{ctx:n}};return e=new Ti({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&1088&&(r.beforeHide=s[24]),l[0]&1966|l[1]&2&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[25](null),z(e,s)}}}function gA(n,e,t){let i;const s=vn(),l="user_"+U.randomString(5);let r,o=new Qr,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function y(Y){return v(Y),t(6,u=!0),r==null?void 0:r.show()}function b(){return r==null?void 0:r.hide()}function v(Y){Wi({}),t(1,o=Y!=null&&Y.clone?Y.clone():new Qr),S()}function S(){t(3,h=!1),t(9,g=!0),t(2,f=(o==null?void 0:o.email)||""),t(7,c=""),t(8,d="")}function C(){if(a||!i)return;t(5,a=!0);const Y={email:f};(o.isNew||h)&&(Y.password=c,Y.passwordConfirm=d);let te;o.isNew?te=Se.Users.create(Y):te=Se.Users.update(o.id,Y),te.then(async fe=>{g&&$(!1),t(6,u=!1),b(),hn(o.isNew?"Successfully created user.":"Successfully updated user."),s("save",fe)}).catch(fe=>{Se.errorResponseHandler(fe)}).finally(()=>{t(5,a=!1)})}function M(){!(o!=null&&o.id)||Mi("Do you really want to delete the selected user?",()=>Se.Users.delete(o.id).then(()=>{t(6,u=!1),b(),hn("Successfully deleted user."),s("delete",o)}).catch(Y=>{Se.errorResponseHandler(Y)}))}function $(Y=!0){return Se.Users.requestVerification(o.isNew?f:o.email).then(()=>{t(6,u=!1),b(),Y&&hn(`Successfully sent verification email to ${o.email}.`)}).catch(te=>{Se.errorResponseHandler(te)})}const T=()=>$(),A=()=>M(),D=()=>b();function P(){f=this.value,t(2,f)}function L(){h=this.checked,t(3,h)}function N(){c=this.value,t(7,c)}function R(){d=this.value,t(8,d)}function J(){g=this.checked,t(9,g)}const W=()=>i&&u?(Mi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function q(Y){he[Y?"unshift":"push"](()=>{r=Y,t(4,r)})}function x(Y){ut.call(this,n,Y)}function K(Y){ut.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=o.isNew&&f!=""||h||f!==o.email)},[b,o,f,h,r,a,u,c,d,g,i,l,C,M,$,y,T,A,D,P,L,N,R,J,W,q,x,K]}class _A extends Ne{constructor(e){super(),Ie(this,e,gA,mA,Pe,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function eg(n,e,t){const i=n.slice();return i[37]=e[t],i}function tg(n,e,t){const i=n.slice();return i[40]=e[t],i}function ng(n,e,t){const i=n.slice();return i[40]=e[t],i}function bA(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C,M,$,T,A=[],D=new Map,P,L,N,R,J,W,q,x,K,Y,te=[],fe=new Map,ye,se,G,Oe,ee;c=new Do({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),c.$on("submit",n[17]);function be(Z){n[18](Z)}le
<span class="txt">New user</span>`,f=O(),B(c.$$.fragment),d=O(),h=_("div"),g=_("table"),y=_("thead"),b=_("tr"),B(v.$$.fragment),C=O(),B(M.$$.fragment),T=O();for(let Z=0;Z<A.length;Z+=1)A[Z].c();P=O(),B(L.$$.fragment),R=O(),B(J.$$.fragment),q=O(),x=_("th"),K=O(),Y=_("tbody");for(let Z=0;Z<te.length;Z+=1)te[Z].c();Ge&&Ge.c(),ye=O(),ge&&ge.c(),se=O(),Ae&&Ae.c(),p(i,"class","breadcrumbs"),p(l,"type","button"),p(l,"class","btn btn-secondary btn-circle"),p(o,"class","flex-fill"),p(u,"type","button"),p(u,"class","btn btn-expanded"),p(t,"class","page-header"),p(x,"class","col-type-action min-width"),p(g,"class","table"),ne(g,"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,s),m(t,l),m(t,r),m(t,o),m(t,a),m(t,u),m(e,f),V(c,e,null),m(e,d),m(e,h),m(h,g),m(g,y),m(y,b),V(v,b,null),m(b,C),V(M,b,null),m(b,T);for(let Be=0;Be<A.length;Be+=1)A[Be].m(b,null);m(b,P),V(L,b,null),m(b,R),V(J,b,null),m(b,q),m(b,x),m(g,K),m(g,Y);for(let Be=0;Be<te.length;Be+=1)te[Be].m(Y,null);Ge&&Ge.m(Y,null),m(e,ye),ge&&ge.m(e,null),m(e,se),Ae&&Ae.m(e,null),G=!0,Oe||(ee=[Xe(St.call(null,l,{text:"Edit profile collection",position:"right"})),X(l,"click",n[15]),X(u,"click",n[16])],Oe=!0)},p(Z,ae){const Be={};ae[0]&8&&(Be.value=Z[3]),c.$set(Be);const vt={};ae[1]&16384&&(vt.$$scope={dirty:ae,ctx:Z}),!S&&ae[0]&16&&(S=!0,vt.sort=Z[4],Re(()=>S=!1)),v.$set(vt);const it={};ae[1]&16384&&(it.$$scope={dirty:ae,ctx:Z}),!$&&ae[0]&16&&($=!0,it.sort=Z[4],Re(()=>$=!1)),M.$set(it),ae[0]&4096&&(je=Z[12],A=ot(A,ae,Le,1,Z,je,D,b,an,ig,P,ng));const gt={};ae[1]&16384&&(gt.$$scope={dirty:ae,ctx:Z}),!N&&ae[0]&16&&(N=!0,gt.sort=Z[4],Re(()=>N=!1)),L.$set(gt);const at={};ae[1]&16384&&(at.$$scope={dirty:ae,ctx:Z}),!W&&ae[0]&16&&(W=!0,at.sort=Z[4],Re(()=>W=!1)),J.$set(at),ae[0]&5450&&(Ve=Z[1],Te(),te=ot(te,ae,ze,1,Z,Ve,fe,Y,Lt,og,null,eg),De(),!Ve.length&&Ge?Ge.p(Z,ae):Ve.length?Ge&&(Ge.d(1),Ge=null):(Ge=sg(Z),Ge.c(),Ge.m(Y,null))),ae[0]&1024&&ne(g,"table-loading",Z[10]),Z[1].length?ge?ge.p(Z,ae):(ge=ag(Z),ge.c(),ge.m(e,se)):ge&&(ge.d(1),ge=null),Z[1].length&&Z[13]?Ae?Ae.p(Z,ae):(Ae=ug(Z),Ae.c(),Ae.m(e,null)):Ae&&(Ae.d(1),Ae=null)},i(Z){if(!G){E(c.$$.fragment,Z),E(v.$$.fragment,Z),E(M.$$.fragment,Z),E(L.$$.fragment,Z),E(J.$$.fragment,Z);for(let ae=0;ae<Ve.length;ae+=1)E(te[ae]);G=!0}},o(Z){F(c.$$.fragment,Z),F(v.$$.fragment,Z),F(M.$$.fragment,Z),F(L.$$.fragment,Z),F(J.$$.fragment,Z);for(let ae=0;ae<te.length;ae+=1)F(te[ae]);G=!1},d(Z){Z&&k(e),z(c),z(v),z(M);for(let ae=0;ae<A.length;ae+=1)A[ae].d();z(L),z(J);for(let ae=0;ae<te.length;ae+=1)te[ae].d();Ge&&Ge.d(),ge&&ge.d(),Ae&&Ae.d(),Oe=!1,lt(ee)}}}function yA(n){let e;return{c(){e=_("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:re,i:re,o:re,d(t){t&&k(e)}}}function vA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function kA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="email",p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function ig(n,e){let t,i,s,l,r,o,a,u=e[40].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),r=O(),o=_("span"),a=H("profile."),f=H(u),p(s,"class",l=U.getFieldTypeIcon(e[40].type)),p(o,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[40].type+" col-field-"+e[40].name),p(t,"name",d=e[40].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,r),m(i,o),m(o,a),m(o,f)},p(h,g){e=h,g[0]&4096&&l!==(l=U.getFieldTypeIcon(e[40].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[40].name+"")&&_e(f,u),g[0]&4096&&c!==(c="col-type-"+e[40].type+" col-field-"+e[40].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[40].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function wA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function SA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="updated",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function sg(n){let e;function t(l,r){return l[10]?MA:CA}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function CA(n){var o;let e,t,i,s,l,r=((o=n[3])==null?void 0:o.length)&&lg(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),r&&r.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?r?r.p(a,u):(r=lg(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function MA(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function lg(n){let e,t,i;return{c(){e=_("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(s,l){w(s,e,l),t||(i=X(e,"click",n[24]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function rg(n,e){let t,i,s;return i=new Ib({props:{field:e[40],record:e[37].profile||{}}}),{key:n,first:null,c(){t=rt(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r[0]&4096&&(o.field=e[40]),r[0]&2&&(o.record=e[37].profile||{}),i.$set(o)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function og(n,e){let t,i,s,l,r,o,a,u=e[37].email+"",f,c,d,h,g=e[37].verified?"Verified":"Unverified",y,b,v=[],S=new Map,C,M,$,T,A,D,P,L,N,R,J,W,q,x,K;s=new Io({props:{id:e[37].id}});let Y=e[12];const te=se=>se[40].name;for(let se=0;se<Y.length;se+=1){let G=tg(e,Y,se),Oe=te(G);S.set(Oe,v[se]=rg(Oe,G))}$=new Ci({props:{date:e[37].created}}),D=new Ci({props:{date:e[37].updated}});function fe(){return e[22](e[37])}function ye(){return e[23](e[37])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),B(s.$$.fragment),l=O(),r=_("td"),o=_("div"),a=_("span"),f=H(u),d=O(),h=_("span"),y=H(g),b=O();for(let se=0;se<v.length;se+=1)v[se].c();C=O(),M=_("td"),B($.$$.fragment),T=O(),A=_("td"),B(D.$$.fragment),P=O(),L=_("td"),N=_("button"),N.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,R=O(),J=_("button"),J.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,W=O(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[37].email),p(h,"class","label"),ne(h,"label-success",e[37].verified),ne(h,"label-warning",!e[37].verified),p(o,"class","inline-flex"),p(r,"class","col-type-email col-field-email"),p(M,"class","col-type-date col-field-created"),p(A,"class","col-type-date col-field-updated"),p(N,"type","button"),p(N,"class","btn btn-sm btn-outline"),p(J,"type","button"),p(J,"class","btn btn-sm m-l-10"),p(L,"class","col-type-action min-width"),this.first=t},m(se,G){w(se,t,G),m(t,i),V(s,i,null),m(t,l),m(t,r),m(r,o),m(o,a),m(a,f),m(o,d),m(o,h),m(h,y),m(t,b);for(let Oe=0;Oe<v.length;Oe+=1)v[Oe].m(t,null);m(t,C),m(t,M),V($,M,null),m(t,T),m(t,A),V(D,A,null),m(t,P),m(t,L),m(L,N),m(L,R),m(L,J),m(t,W),q=!0,x||(K=[X(N,"click",Bn(fe)),X(J,"click",Bn(ye))],x=!0)},p(se,G){e=se;const Oe={};G[0]&2&&(Oe.id=e[37].id),s.$set(Oe),(!q||G[0]&2)&&u!==(u=e[37].email+"")&&_e(f,u),(!q||G[0]&2&&c!==(c=e[37].email))&&p(a,"title",c),(!q||G[0]&2)&&g!==(g=e[37].verified?"Verified":"Unverified")&&_e(y,g),G[0]&2&&ne(h,"label-success",e[37].verified),G[0]&2&&ne(h,"label-warning",!e[37].verified),G[0]&4098&&(Y=e[12],Te(),v=ot(v,G,te,1,e,Y,S,t,Lt,rg,C,tg),De());const ee={};G[0]&2&&(ee.date=e[37].created),$.$set(ee);const be={};G[0]&2&&(be.date=e[37].updated),D.$set(be)},i(se){if(!q){E(s.$$.fragment,se);for(let G=0;G<Y.length;G+=1)E(v[G]);E($.$$.fragment,se),E(D.$$.fragment,se),q=!0}},o(se){F(s.$$.fragment,se);for(let G=0;G<v.length;G+=1)F(v[G]);F($.$$.fragment,se),F(D.$$.fragment,se),q=!1},d(se){se&&k(t),z(s);for(let G=0;G<v.length;G+=1)v[G].d();z($),z(D),x=!1,lt(K)}}}function ag(n){let e,t,i=n[1].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a[0]&2&&i!==(i=o[1].length+"")&&_e(s,i),a[0]&4&&_e(r,o[2])},d(o){o&&k(e)}}}function ug(n){let e,t,i,s,l=n[2]-n[1].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),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(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=X(t,"click",n[25]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&_e(r,l),c[0]&1024&&ne(t,"btn-loading",f[10]),c[0]&1024&&ne(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function $A(n){let e,t,i,s,l,r,o,a,u;const f=[yA,bA],c=[];function d(b,v){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let h={};s=new _A({props:h}),n[26](s),s.$on("save",n[27]),s.$on("delete",n[28]);let g={};r=new hf({props:g}),n[29](r),r.$on("save",n[30]);let y={collection:n[5]};return a=new Fb({props:y}),n[31](a),a.$on("save",n[32]),{c(){t.c(),i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment)},m(b,v){c[e].m(b,v),w(b,i,v),V(s,b,v),w(b,l,v),V(r,b,v),w(b,o,v),V(a,b,v),u=!0},p(b,v){let S=e;e=d(b),e===S?c[e].p(b,v):(Te(),F(c[S],1,1,()=>{c[S]=null}),De(),t=c[e],t?t.p(b,v):(t=c[e]=f[e](b),t.c()),E(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const M={};r.$set(M);const $={};v[0]&32&&($.collection=b[5]),a.$set($)},i(b){u||(E(t),E(s.$$.fragment,b),E(r.$$.fragment,b),E(a.$$.fragment,b),u=!0)},o(b){F(t),F(s.$$.fragment,b),F(r.$$.fragment,b),F(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[26](null),z(s,b),b&&k(l),n[29](null),z(r,b),b&&k(o),n[31](null),z(a,b)}}}function OA(n,e,t){var Oe;let i,s;const l=U.getQueryParams((Oe=window.location)==null?void 0:Oe.href),r=["id","userId","created","updated"];let o,a,u,f=[],c=1,d=0,h=!1,g=l.filter||"",y=l.sort||"-created",b=new Pn,v=!1;U.setDocumentTitle("Users"),$();async function S(ee=1){return t(10,h=!0),Se.Users.getList(ee,50,{sort:y||"-created",filter:g}).then(be=>{ee<=1&&C(),t(10,h=!1),t(1,f=f.concat(be.items)),t(9,c=be.page),t(2,d=be.totalItems)}).catch(be=>{be!==null&&(t(10,h=!1),console.warn(be),C(),Se.errorResponseHandler(be,!1))})}function C(){t(1,f=[]),t(9,c=1),t(
<span class="txt">Application</span>`,r=O(),o=_("a"),o.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=O(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=O(),c=_("div"),c.textContent="Authentication",d=O(),h=_("a"),h.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,g=O(),y=_("a"),y.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,b=O(),v=_("a"),v.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/auth-providers"),p(h,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(v,"href","/settings/admins"),p(v,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(M,$){w(M,e,$),m(e,t),m(t,i),m(t,s),m(t,l),m(t,r),m(t,o),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,y),m(t,b),m(t,v),S||(C=[Xe(ri.call(null,l,{path:"/settings"})),Xe(Mn.call(null,l)),Xe(ri.call(null,o,{path:"/settings/mail/?.*"})),Xe(Mn.call(null,o)),Xe(ri.call(null,u,{path:"/settings/storage/?.*"})),Xe(Mn.call(null,u)),Xe(ri.call(null,h,{path:"/settings/auth-providers/?.*"})),Xe(Mn.call(null,h)),Xe(ri.call(null,y,{path:"/settings/tokens/?.*"})),Xe(Mn.call(null,y)),Xe(ri.call(null,v,{path:"/settings/admins/?.*"})),Xe(Mn.call(null,v))],S=!0)},p:re,i:re,o:re,d(M){M&&k(e),S=!1,lt(C)}}}class Qs extends Ne{constructor(e){super(),Ie(this,e,null,DA,Pe,{})}}function fg(n,e,t){const i=n.slice();return i[31]=e[t],i}function cg(n){let e,t;return e=new He({props:{class:"form-field disabled",name:"id",$$slots:{default:[AA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function AA(n){let e,t,i,s,l,r,o,a,u;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="ID",r=O(),o=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(o,"type","text"),p(o,"id",a=n[30]),o.value=u=n[1].id,o.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,r,c),w(f,o,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(o,"id",a),c[0]&2&&u!==(u=f[1].id)&&o.value!==u&&(o.value=u)},d(f){f&&k(e),f&&k(r),f&&k(o)}}}function dg(n){let e,t,i,s,l,r,o,a;function u(){return n[17](n[31])}function f(...c){return n[18](n[31],...c)}return{c(){e=_("figure"),t=_("img"),l=O(),Qn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt",s="Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",r="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(c,d){w(c,e,d),m(e,t),m(e,l),o||(a=[X(e,"click",u),X(e,"keydown",f)],o=!0)},p(c,d){n=c,d[0]&4&&r!==(r="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",r)},d(c){c&&k(e),o=!1,lt(a)}}}function EA(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="Email",r=O(),o=_("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(o,"type","email"),p(o,"autocomplete","off"),p(o,"id",a=n[30]),o.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,r,d),w(c,o,d),$e(o,n[3]),u||(f=X(o,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(o,"id",a),d[0]&8&&o.value!==c[3]&&$e(o,c[3])},d(c){c&&k(e),c&&k(r),c&&k(o),u=!1,f()}}}function pg(n){let e,t;return e=new He({props:{class:"form-field form-field-toggle",$$slots:{default:[PA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function PA(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",r=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[20]),o=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function jA(n){let e,t,i,s,l,r,o=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&mg(n);return{c(){h&&h.c(),e=O(),t=_("button"),i=_("span"),i.textContent="Cancel",s=O(),l=_("button"),r=_("span"),a=H(o),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ne(l,"btn-loading",n[6])},m(g,y){h&&h.m(g,y),w(g,e,y),w(g,t,y),m(t,i),w(g,s,y),w(g,l,y),m(l,r),m(r,a),f=!0,c||(d=X(t,"click",n[16]),c=!0)},p(g,y){g[1].isNew?h&&(Te(),F(h,1,1,()=>{h=null}),De()):h?(h.p(g,y),y[0]&2&&E(h,1)):(h=mg(g),h.c(),E(h,1),h.m(e.parentNode,e)),(!f||y[0]&64)&&(t.disabled=g[6]),(!f||y[0]&2)&&o!==(o=g[1].isNew?"Create":"Save changes")&&_e(a,o),(!f||y[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),y[0]&64&&ne(l,"btn-loading",g[6])},i(g){f||(E(h),f=!0)},o(g){F(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function HA(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[jA],header:[NA],default:[IA]},$$scope:{ctx:n}};return e=new Ti({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&1152&&(r.beforeHide=s[23]),l[0]&1886|l[1]&8&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[24](null),z(e,s)}}}function qA(n,e,t){let i;const s=vn(),l="admin_"+U.randomString(5);let r,o=new Bs,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function y(K){return v(K),t(7,u=!0),r==null?void 0:r.show()}function b(){return r==null?void 0:r.hide()}function v(K){Wi({}),t(1,o=K!=null&&K.clone?K.clone():new Bs),S()}function S(){t(4,g=!1),t(3,c=(o==null?void 0:o.email)||""),t(2,f=(o==null?void 0:o.avatar)||0),t(8,d=""),t(9,h="")}function C(){if(a||!i)return;t(6,a=!0);const K={email:c,avatar:f};(o.isNew||g)&&(K.password=d,K.passwordConfirm=h);let Y;o.isNew?Y=Se.Admins.create(K):Y=Se.Admins.update(o.id,K),Y.then(async te=>{var fe;t(7,u=!1),b(),hn(o.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",te),((fe=Se.AuthStore.model)==null?void 0:fe.id)===te.id&&Se.AuthStore.save(Se.AuthStore.token,te)}).catch(te=>{Se.errorResponseHandler(te)}).finally(()=>{t(6,a=!1)})}function M(){!(o!=null&&o.id)||Mi("Do you really want to delete the selected admin?",()=>Se.Admins.delete(o.id).then(()=>{t(7,u=!1),b(),hn("Successfully deleted admin."),s("delete",o)}).catch(K=>{Se.errorResponseHandler(K)}))}const $=()=>M(),T=()=>b(),A=K=>t(2,f=K),D=(K,Y)=>{(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),t(2,f=K))};function P(){c=this.value,t(3,c)}function L(){g=this.checked,t(4,g)}function N(){d=this.value,t(8,d)}function R(){h=this.value,t(9,h)}const J=()=>i&&u?(Mi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function W(K){he[K?"unshift":"push"](()=>{r=K,t(5,r)})}function q(K){ut.call(this,n,K)}function x(K){ut.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=o.isNew&&c!=""||g||c!==o.email||f!==o.avatar)},[b,o,f,c,g,r,a,u,d,h,i,l,C,M,y,$,T,A,D,P,L,N,R,J,W,q,x]}class VA extends Ne{constructor(e){super(),Ie(this,e,qA,HA,Pe,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function gg(n,e,t){const i=n.slice();return i[21]=e[t],i}function zA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function BA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="email",p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function UA(n){let e,t,i,s;return{c(){
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function bg(n){let e,t,i;return{c(){e=_("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(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function yg(n){let e;return{c(){e=_("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 vg(n,e){let t,i,s,l,r,o,a,u,f,c,d,h,g=e[21].email+"",y,b,v,S,C,M,$,T,A,D,P,L,N,R;u=new Io({props:{id:e[21].id}});let J=e[21].id===e[6].id&&yg();C=new Ci({props:{date:e[21].created}}),T=new Ci({props:{date:e[21].updated}});function W(){return e[13](e[21])}function q(...x){return e[14](e[21],...x)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),o=O(),a=_("td"),B(u.$$.fragment),f=O(),J&&J.c(),c=O(),d=_("td"),h=_("span"),y=H(g),v=O(),S=_("td"),B(C.$$.fragment),M=O(),$=_("td"),B(T.$$.fragment),A=O(),D=_("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',P=O(),Qn(l.src,r="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg")||p(l,"src",r),p(l,"alt","Admin avatar"),p(s,"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",b=e[21].email),p(d,"class","col-type-email col-field-email"),p(S,"class","col-type-date col-field-created"),p($,"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(x,K){w(x,t,K),m(t,i),m(i,s),m(s,l),m(t,o),m(t,a),V(u,a,null),m(a,f),J&&J.m(a,null),m(t,c),m(t,d),m(d,h),m(h,y),m(t,v),m(t,S),V(C,S,null),m(t,M),m(t,$),V(T,$,null),m(t,A),m(t,D),m(t,P),L=!0,N||(R=[X(t,"click",W),X(t,"keydown",q)],N=!0)},p(x,K){e=x,(!L||K&16&&!Qn(l.src,r="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg"))&&p(l,"src",r);const Y={};K&16&&(Y.id=e[21].id),u.$set(Y),e[21].id===e[6].id?J||(J=yg(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!L||K&16)&&g!==(g=e[21].email+"")&&_e(y,g),(!L||K&16&&b!==(b=e[21].email))&&p(h,"title",b);const te={};K&16&&(te.date=e[21].created),C.$set(te);const fe={};K&16&&(fe.date=e[21].updated),T.$set(fe)},i(x){L||(E(u.$$.fragment,x),E(C.$$.fragment,x),E(T.$$.fragment,x),L=!0)},o(x){F(u.$$.fragment,x),F(C.$$.fragment,x),F(T.$$.fragment,x),L=!1},d(x){x&&k(t),z(u),J&&J.d(),z(C),z(T),N=!1,lt(R)}}}function kg(n){let e,t,i=n[4].length+"",s,l,r=n[4].length+"",o;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),o=H(r),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,o)},p(a,u){u&16&&i!==(i=a[4].length+"")&&_e(s,i),u&16&&r!==(r=a[4].length+"")&&_e(o,r)},d(a){a&&k(e)}}}function JA(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C,M,$,T,A,D,P,L,N,R,J,W,q,x,K,Y=[],te=new Map,fe,ye,se,G,Oe,ee;e=new Qs({}),c=new Do({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),c.$on("submit",n[8]);function be(ge){n[9](ge)}let ue={class:"col-type-text",name:"id",$$slots:{default:[zA]},$$scope:{ctx:n}};n[2]!==void 0&&(ue.sort=n[2]),C=new en({props:ue}),he.push(()=>Fe(C,"sort",be));function ie(ge){n[10](ge)}let ve={class:"col-type-email col-field-email",name:"email",$$slots:{default:[BA]},$$scope:{ctx:n}};n[2]!==void 0&&(ve.sort=n[2]),T=new en({props:ve}),he.push(()=>Fe(T,"sort",ie));function je(ge){n[11](ge)}let Le={class:"col-type-date col-field-created",name:"created",$$slots:{default:[UA]},$$scope:{ctx:n}};n[2]!==void 0&&(Le.sort=n[2]),P=new en({props:Le}),he.push(()=>Fe(P,"sort",je));function qe(ge){n[12](ge)}let oe={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[WA]},$$scope:{ctx:n}};n[2]!==void 0&&(oe.sort=n[2]),R=new en({props:oe}),he.push(()=>Fe(R,"sort",qe));let le=n[4];const ke=ge=>ge[21].id;for(let ge=0;ge<le.length;ge+=1){let Ae=gg(n,le,ge),Z=ke(Ae);te.set(Z,Y[ge]=vg(Z,Ae))}let Ve=null;le.length||(Ve=_g(n));let ze=n[4].length&&kg(n),Ge={};return se=new VA({props:Ge}),n[16](se),se.$on("save",n[17]),se.$on("delete",n[18]),{c(){B(e.$$.fra
<div class="breadcrumb-item">Admins</div>`,r=O(),o=_("div"),a=O(),u=_("button"),u.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,f=O(),B(c.$$.fragment),d=O(),h=_("div"),g=_("table"),y=_("thead"),b=_("tr"),v=_("th"),S=O(),B(C.$$.fragment),$=O(),B(T.$$.fragment),D=O(),B(P.$$.fragment),N=O(),B(R.$$.fragment),W=O(),q=_("th"),x=O(),K=_("tbody");for(let ge=0;ge<Y.length;ge+=1)Y[ge].c();Ve&&Ve.c(),fe=O(),ze&&ze.c(),ye=O(),B(se.$$.fragment),p(l,"class","breadcrumbs"),p(o,"class","flex-fill"),p(u,"type","button"),p(u,"class","btn btn-expanded"),p(s,"class","page-header"),p(v,"class","min-width"),p(q,"class","col-type-action min-width"),p(g,"class","table"),ne(g,"table-loading",n[5]),p(h,"class","table-wrapper"),p(i,"class","page-wrapper")},m(ge,Ae){V(e,ge,Ae),w(ge,t,Ae),w(ge,i,Ae),m(i,s),m(s,l),m(s,r),m(s,o),m(s,a),m(s,u),m(i,f),V(c,i,null),m(i,d),m(i,h),m(h,g),m(g,y),m(y,b),m(b,v),m(b,S),V(C,b,null),m(b,$),V(T,b,null),m(b,D),V(P,b,null),m(b,N),V(R,b,null),m(b,W),m(b,q),m(g,x),m(g,K);for(let Z=0;Z<Y.length;Z+=1)Y[Z].m(K,null);Ve&&Ve.m(K,null),m(i,fe),ze&&ze.m(i,null),w(ge,ye,Ae),V(se,ge,Ae),G=!0,Oe||(ee=X(u,"click",n[7]),Oe=!0)},p(ge,[Ae]){const Z={};Ae&2&&(Z.value=ge[1]),c.$set(Z);const ae={};Ae&16777216&&(ae.$$scope={dirty:Ae,ctx:ge}),!M&&Ae&4&&(M=!0,ae.sort=ge[2],Re(()=>M=!1)),C.$set(ae);const Be={};Ae&16777216&&(Be.$$scope={dirty:Ae,ctx:ge}),!A&&Ae&4&&(A=!0,Be.sort=ge[2],Re(()=>A=!1)),T.$set(Be);const vt={};Ae&16777216&&(vt.$$scope={dirty:Ae,ctx:ge}),!L&&Ae&4&&(L=!0,vt.sort=ge[2],Re(()=>L=!1)),P.$set(vt);const it={};Ae&16777216&&(it.$$scope={dirty:Ae,ctx:ge}),!J&&Ae&4&&(J=!0,it.sort=ge[2],Re(()=>J=!1)),R.$set(it),Ae&122&&(le=ge[4],Te(),Y=ot(Y,Ae,ke,1,ge,le,te,K,Lt,vg,null,gg),De(),!le.length&&Ve?Ve.p(ge,Ae):le.length?Ve&&(Ve.d(1),Ve=null):(Ve=_g(ge),Ve.c(),Ve.m(K,null))),Ae&32&&ne(g,"table-loading",ge[5]),ge[4].length?ze?ze.p(ge,Ae):(ze=kg(ge),ze.c(),ze.m(i,null)):ze&&(ze.d(1),ze=null);const gt={};se.$set(gt)},i(ge){if(!G){E(e.$$.fragment,ge),E(c.$$.fragment,ge),E(C.$$.fragment,ge),E(T.$$.fragment,ge),E(P.$$.fragment,ge),E(R.$$.fragment,ge);for(let Ae=0;Ae<le.length;Ae+=1)E(Y[Ae]);E(se.$$.fragment,ge),G=!0}},o(ge){F(e.$$.fragment,ge),F(c.$$.fragment,ge),F(C.$$.fragment,ge),F(T.$$.fragment,ge),F(P.$$.fragment,ge),F(R.$$.fragment,ge);for(let Ae=0;Ae<Y.length;Ae+=1)F(Y[Ae]);F(se.$$.fragment,ge),G=!1},d(ge){z(e,ge),ge&&k(t),ge&&k(i),z(c),z(C),z(T),z(P),z(R);for(let Ae=0;Ae<Y.length;Ae+=1)Y[Ae].d();Ve&&Ve.d(),ze&&ze.d(),ge&&k(ye),n[16](null),z(se,ge),Oe=!1,ee()}}}function xA(n,e,t){var D;let i;pn(n,Vu,P=>t(6,i=P));const s=U.getQueryParams((D=window.location)==null?void 0:D.href);let l,r=[],o=!1,a=s.filter||"",u=s.sort||"-created";U.setDocumentTitle("Admins");function f(){return t(5,o=!0),t(4,r=[]),Se.Admins.getFullList(100,{sort:u||"-created",filter:a}).then(P=>{t(4,r=P),t(5,o=!1)}).catch(P=>{P!==null&&(t(5,o=!1),console.warn(P),c(),Se.errorResponseHandler(P,!1))})}function c(){t(4,r=[])}const d=()=>l==null?void 0:l.show(),h=P=>t(1,a=P.detail);function g(P){u=P,t(2,u)}function y(P){u=P,t(2,u)}function b(P){u=P,t(2,u)}function v(P){u=P,t(2,u)}const S=P=>l==null?void 0:l.show(P),C=(P,L)=>{(L.code==="Enter"||L.code==="Space")&&(L.preventDefault(),l==null||l.show(P))},M=()=>t(1,a="");function $(P){he[P?"unshift":"push"](()=>{l=P,t(3,l)})}const T=()=>f(),A=()=>f();return n.$$.update=()=>{n.$$.dirty&6&&u!==-1&&a!==-1&&(U.replaceClientQueryParams({filter:a,sort:u}),f())},[f,a,u,l,r,o,i,d,h,g,y,b,v,S,C,M,$,T,A]}class GA extends Ne{constructor(e){super(),Ie(this,e,xA,JA,Pe,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function wg(n){let e,t,i;return{c(){e=_("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=O(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function ZA(n){let e,t,i,s,l,r,o,a,u=!n[0]&&wg();const f=n[2].default,c=On(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=O(),s=_("div"),u&&u.c(),l=O(),c&&c.c(),r=O(),o=_("div"),p(t,"class","flex-fill"),p(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),p(o,"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,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,r),m(e,o),a=!0},p(d,[h]){d[0]?u&&(u.d(1),u=null):u||(u=wg(),u.c(),u.m(s,l)),c&&c.p&&(!a||h&2)&&Dn(c,f,d,d[1],a?Tn(f,d[1],h,null):An(d[1]),null)},i(d){a||(E(c,d),a=!0)},o(d){F(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function XA(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=r=>{"nobranding"in r&&t(0,l=r.nobranding),"$$scope"in r&&t(1,s=r.$$scope)},[l,s,i]}class QA extends Ne{constructor(e){super(),Ie(this,e,XA,ZA,Pe,{nobranding:0})}}function eE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Email"),s=O(),l=_("input"),p(e,"for",i=n[7]),p(l,"type","email"),p(l,"id",r=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0]),l.focus(),o||(a=X(l,"input",n[4]),o=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&r!==(r=u[7])&&p(l,"id",r),f&1&&l.value!==u[0]&&$e(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function tE(n){let e,t,i,s,l,r,o,a,u,f,c;return{c(){e=_("label"),t=H("Password"),s=O(),l=_("input"),o=O(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",p(e,"for",i=n[7]),p(l,"type","password"),p(l,"id",r=n[7]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),$e(l,n[1]),w(d,o,h),w(d,a,h),m(a,u),f||(c=[X(l,"input",n[5]),Xe(Mn.call(null,u))],f=!0)},p(d,h){h&128&&i!==(i=d[7])&&p(e,"for",i),h&128&&r!==(r=d[7])&&p(l,"id",r),h&2&&l.value!==d[1]&&$e(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(o),d&&k(a),f=!1,lt(c)}}}function nE(n){let e,t,i,s,l,r,o,a,u,f,c;return s=new He({props:{class:"form-field required",name:"email",$$slots:{default:[eE,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field required",name:"password",$$slots:{default:[tE,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign in</h4>",i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),a=_("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),V(s,e,null),m(e,l),V(r,e,null),m(e,o),m(e,a),u=!0,f||(c=X(e,"submit",Jt(n[3])),f=!0)},p(d,h){const g={};h&385&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const y={};h&386&&(y.$$scope={dirty:h,ctx:d}),r.$set(y),h&4&&ne(a,"btn-disabled",d[2]),h&4&&ne(a,"btn-loading",d[2])},i(d){u||(E(s.$$.fragment,d),E(r.$$.fragment,d),u=!0)},o(d){F(s.$$.fragment,d),F(r.$$.fragment,d),u=!1},d(d){d&&k(e),z(s),z(r),f=!1,c()}}}function iE(n){let e,t;return e=new QA({props:{$$slots:{default:[nE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function sE(n,e,t){var f;const i=U.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",r=!1;function o(){if(!r)return t(2,r=!0),Se.Admins.authViaEmail(s,l).then(()=>{So("/")}).catch(()=>{$0("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,r,o,a,u]}class lE extends Ne{constructor(e){super(),Ie(this,e,sE,iE,Pe,{})}}function rE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S;return i=new He({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[aE,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[uE,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),a=new He({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[fE,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),B(a.$$.fragment),u=O(),f=_("div"),c=_("div"),d=O(),h=_("button"),g=_("span"),g.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(g,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=y=!n[3]||n[2],ne(h,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),V(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,h),m(h,g),b=!0,v||(S=X(h,"click",n[9]),v=!0)},p(C,M){const $={};M&12289&&($.$$scope={dirty:M,ctx:C}),i.$set($);const T={};M&12289&&(T.$$scope={dirty:M,ctx:C}),r.$set(T);const A={};M&12289&&(A.$$scope={dirty:M,ctx:C}),a.$set(A),(!b||M&12&&y!==(y=!C[3]||C[2]))&&(h.disabled=y),M&4&&ne(h,"btn-loading",C[2])},i(C){b||(E(i.$$.fragment,C),E(r.$$.fragment,C),E(a.$$.fragment,C),b=!0)},o(C){F(i.$$.fragment,C),F(r.$$.fragment,C),F(a.$$.fragment,C),b=!1},d(C){C&&k(e),z(i),z(r),z(a),v=!1,S()}}}function oE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function aE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Application name"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.appName),o||(a=X(l,"input",n[6]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&l.value!==u[0].meta.appName&&$e(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function uE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Application url"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.appUrl),o||(a=X(l,"input",n[7]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&l.value!==u[0].meta.appUrl&&$e(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function fE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Logs max days retention"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type
<div class="breadcrumb-item">Application</div></nav>`,l=O(),r=_("div"),o=_("form"),u.c(),p(s,"class","page-header"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(b,v){V(e,b,v),w(b,t,v),w(b,i,v),m(i,s),m(i,l),m(i,r),m(r,o),g[a].m(o,null),f=!0,c||(d=X(o,"submit",Jt(n[4])),c=!0)},p(b,[v]){let S=a;a=y(b),a===S?g[a].p(b,v):(Te(),F(g[S],1,1,()=>{g[S]=null}),De(),u=g[a],u?u.p(b,v):(u=g[a]=h[a](b),u.c()),E(u,1),u.m(o,null))},i(b){f||(E(e.$$.fragment,b),E(u),f=!0)},o(b){F(e.$$.fragment,b),F(u),f=!1},d(b){z(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function dE(n,e,t){let i,s={},l=!1,r=!1,o="";U.setDocumentTitle("Application settings"),a();async function a(){t(1,l=!0);try{const y=await Se.Settings.getAll()||{};f(y)}catch(y){Se.errorResponseHandler(y)}t(1,l=!1)}async function u(){if(!(r||!i)){t(2,r=!0);try{const y=await Se.Settings.update(U.filterRedactedProps(s));f(y),hn("Successfully saved application settings.")}catch(y){Se.errorResponseHandler(y)}t(2,r=!1)}}function f(y={}){t(0,s={meta:(y==null?void 0:y.meta)||{},logs:(y==null?void 0:y.logs)||{}}),t(5,o=JSON.stringify(s))}function c(){s.meta.appName=this.value,t(0,s)}function d(){s.meta.appUrl=this.value,t(0,s)}function h(){s.logs.maxDays=Tt(this.value),t(0,s)}const g=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=o!=JSON.stringify(s))},[s,l,r,i,u,o,c,d,h,g]}class pE extends Ne{constructor(e){super(),Ie(this,e,dE,cE,Pe,{})}}function hE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let r=0;r<s.length;r+=1)l=ct(l,s[r]);return{c(){e=_("input"),fi(e,l)},m(r,o){w(r,e,o),e.autofocus&&e.focus(),n[7](e),$e(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(r,o){fi(e,l=gn(s,[{type:"password"},{autocomplete:"new-password"},o&32&&r[5]])),o&1&&e.value!==r[0]&&$e(e,r[0])},d(r){r&&k(e),n[7](null),t=!1,i()}}}function mE(n){let e,t,i,s,l,r,o=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<o.length;u+=1)a=ct(a,o[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),fi(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(r=[Xe(St.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],l=!0)},p(u,f){fi(s,a=gn(o,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,lt(r)}}}function gE(n){let e;function t(l,r){return l[3]?mE:hE}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,[r]){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:re,o:re,d(l){s.d(l),l&&k(e)}}}function _E(n,e,t){const i=["value","mask"];let s=Yt(e,i),{value:l=""}=e,{mask:r="******"}=e,o,a=!1;async function u(){t(0,l=""),t(3,a=!1),await Ui(),o==null||o.focus()}const f=()=>u();function c(h){he[h?"unshift":"push"](()=>{o=h,t(2,o)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ct(ct({},e),ci(h)),t(5,s=Yt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,r=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===r&&t(3,a=!0)},[l,r,o,a,u,s,f,c,d]}class mf extends Ne{constructor(e){super(),Ie(this,e,_E,gE,Pe,{value:0,mask:1})}}function bE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C,M,$,T,A,D,P,L,N,R,J;i=new He({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[vE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[kE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),a=new He({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[wE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),f=new He({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[SE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),d=new He({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>`,v=O(),B(S.$$.fragment),C=O(),W&&W.c(),M=O(),$=_("div"),T=_("div"),A=O(),D=_("button"),P=_("span"),P.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid"),p(b,"class","content m-b-sm"),p(T,"class","flex-fill"),p(P,"class","txt"),p(D,"type","submit"),p(D,"class","btn btn-expanded"),D.disabled=L=!n[3]||n[2],ne(D,"btn-loading",n[2]),p($,"class","flex")},m(q,x){w(q,e,x),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),V(a,e,null),m(e,u),V(f,e,null),m(e,c),V(d,e,null),w(q,h,x),w(q,g,x),w(q,y,x),w(q,b,x),w(q,v,x),V(S,q,x),w(q,C,x),W&&W.m(q,x),w(q,M,x),w(q,$,x),m($,T),m($,A),m($,D),m(D,P),N=!0,R||(J=X(D,"click",n[18]),R=!0)},p(q,x){const K={};x&12582913&&(K.$$scope={dirty:x,ctx:q}),i.$set(K);const Y={};x&12582913&&(Y.$$scope={dirty:x,ctx:q}),r.$set(Y);const te={};x&12582913&&(te.$$scope={dirty:x,ctx:q}),a.$set(te);const fe={};x&12582913&&(fe.$$scope={dirty:x,ctx:q}),f.$set(fe);const ye={};x&12582913&&(ye.$$scope={dirty:x,ctx:q}),d.$set(ye);const se={};x&12582913&&(se.$$scope={dirty:x,ctx:q}),S.$set(se),q[0].smtp.enabled?W?(W.p(q,x),x&1&&E(W,1)):(W=Sg(q),W.c(),E(W,1),W.m(M.parentNode,M)):W&&(Te(),F(W,1,1,()=>{W=null}),De()),(!N||x&12&&L!==(L=!q[3]||q[2]))&&(D.disabled=L),x&4&&ne(D,"btn-loading",q[2])},i(q){N||(E(i.$$.fragment,q),E(r.$$.fragment,q),E(a.$$.fragment,q),E(f.$$.fragment,q),E(d.$$.fragment,q),E(S.$$.fragment,q),E(W),N=!0)},o(q){F(i.$$.fragment,q),F(r.$$.fragment,q),F(a.$$.fragment,q),F(f.$$.fragment,q),F(d.$$.fragment,q),F(S.$$.fragment,q),F(W),N=!1},d(q){q&&k(e),z(i),z(r),z(a),z(f),z(d),q&&k(h),q&&k(g),q&&k(y),q&&k(b),q&&k(v),z(S,q),q&&k(C),W&&W.d(q),q&&k(M),q&&k($),R=!1,J()}}}function yE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function vE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Sender name"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.senderName),o||(a=X(l,"input",n[7]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].meta.senderName&&$e(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function kE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Sender address"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","email"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.senderAddress),o||(a=X(l,"input",n[8]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].meta.senderAddress&&$e(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function wE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User verification page url"),s=O(),l=_("input"),o=O(),a=_("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(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userVerificationUrl),w(c,o,d),w(c,a,d),u||(f=X(l,"input",n[9]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userVerificationUrl&&$e(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function SE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User reset password page url"),s=O(),l=_("input"),o=O(),a=_("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(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userResetPasswordUrl),w(c,o,d),w(c,a,d),u||(f=X(l,"input",n[10]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&$e(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function CE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User confirm email change page url"),s=O(),l=_("input"),o=O(),a=_("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(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userConfirmEmailChangeUrl),w(c,o,d),w(c,a,d),u||(f=X(l,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&$e(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function ME(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[22]),e.required=!0,p(s,"for",r=n[22])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[12]),o=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&4194304&&r!==(r=u[22])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Sg(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C;return i=new He({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[$E,({uniqueId:M})=>({22:M}),({uniqueId:M})=>M?4194304:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[OE,({uniqueId:M})=>({22:M}),({uniqueId:M})=>M?4194304:0]},$$scope:{ctx:n}}}),u=new He({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[TE,({uniqueId:M})=>({22:M}),({uniqueId:M})=>M?4194304:0]},$$scope:{ctx:n}}}),d=new He({props:{class:"form-field",name:"smtp.username",$$slots:{default:[DE,({uniqueId:M})=>({22:M}),({uniqueId:M})=>M?4194304:0]},$$scope:{ctx:n}}}),y=new He({props:{class:"form-field",name:"smtp.password",$$slots:{default:[AE,({uniqueId:M})=>({22:M}),({uniqueId:M})=>M?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(d.$$.fragment),h=O(),g=_("div"),B(y.$$.fragment),b=O(),v=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(v,"class","col-lg-12"),p(e,"class","grid")},m(M,$){w(M,e,$),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),m(e,f),m(e,c),V(d,c,null),m(e,h),m(e,g),V(y,g,null),m(e,b),m(e,v),C=!0},p(M,$){const T={};$&12582913&&(T.$$scope={dirty:$,ctx:M}),i.$set(T);const A={};$&12582913&&(A.$$scope={dirty:$,ctx:M}),r.$set(A);const D={};$&12582913&&(D.$$scope={dirty:$,ctx:M}),u.$set(D);const P={};$&12582913&&(P.$$scope={dirty:$,ctx:M}),d.$set(P);const L={};$&12582913&&(L.$$scope={dirty:$,ctx:M}),y.$set(L)},i(M){C||(E(i.$$.fragment,M),E(r.$$.fragment,M),E(u.$$.fragment,M),E(d.$$.fragment,M),E(y.$$.fragment,M),M&&Dt(()=>{S||(S=ft(e,un,{duration:150},!0)),S.run(1)}),C=!0)},o(M){F(i.$$.fragment,M),F(r.$$.fragment,M),F(u.$$.fragment,M),F(d.$$.fragment,M),F(y.$$.fragment,M),M&&(S||(S=ft(e,un,{duration:150},!1)),S.run(0)),C=!1},d(M){M&&k(e),z(i),z(r),z(u),z(d),z(y),M&&S&&S.end()}}}function $E(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("SMTP server host"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.host),o||(a=X(l,"input",n[13]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].smtp.host&&$e(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function OE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Port"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.port),o||(a=X(l,"input",n[14]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&Tt(l.value)!==u[0].smtp.port&&$e(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function TE(n){let e,t,i,s,l,r,o;function a(f){n[15](f)}let u={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new ys({props:u}),he.push(()=>Fe(
<div class="breadcrumb-item">Mail settings</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){V(e,S,C),w(S,t,C),w(S,i,C),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Jt(n[19])),h=!0)},p(S,[C]){let M=f;f=v(S),f===M?b[f].p(S,C):(Te(),F(b[M],1,1,()=>{b[M]=null}),De(),c=b[f],c?c.p(S,C):(c=b[f]=y[f](S),c.c()),E(c,1),c.m(o,null))},i(S){d||(E(e.$$.fragment,S),E(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function PE(n,e,t){let i;const s=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let l={},r=!1,o=!1,a="";U.setDocumentTitle("Mail settings"),u();async function u(){t(1,r=!0);try{const P=await Se.Settings.getAll()||{};c(P)}catch(P){Se.errorResponseHandler(P)}t(1,r=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const P=await Se.Settings.update(U.filterRedactedProps(l));c(P),hn("Successfully saved mail settings.")}catch(P){Se.errorResponseHandler(P)}t(2,o=!1)}}function c(P={}){t(0,l={meta:(P==null?void 0:P.meta)||{},smtp:(P==null?void 0:P.smtp)||{}}),t(6,a=JSON.stringify(l))}function d(){l.meta.senderName=this.value,t(0,l)}function h(){l.meta.senderAddress=this.value,t(0,l)}function g(){l.meta.userVerificationUrl=this.value,t(0,l)}function y(){l.meta.userResetPasswordUrl=this.value,t(0,l)}function b(){l.meta.userConfirmEmailChangeUrl=this.value,t(0,l)}function v(){l.smtp.enabled=this.checked,t(0,l)}function S(){l.smtp.host=this.value,t(0,l)}function C(){l.smtp.port=Tt(this.value),t(0,l)}function M(P){n.$$.not_equal(l.smtp.tls,P)&&(l.smtp.tls=P,t(0,l))}function $(){l.smtp.username=this.value,t(0,l)}function T(P){n.$$.not_equal(l.smtp.password,P)&&(l.smtp.password=P,t(0,l))}const A=()=>f(),D=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,r,o,i,s,f,a,d,h,g,y,b,v,S,C,M,$,T,A,D]}class LE extends Ne{constructor(e){super(),Ie(this,e,PE,EE,Pe,{})}}function FE(n){let e,t,i,s,l,r,o,a,u,f,c,d;e=new He({props:{class:"form-field form-field-toggle",$$slots:{default:[NE,({uniqueId:g})=>({15:g}),({uniqueId:g})=>g?32768:0]},$$scope:{ctx:n}}});let h=n[0].enabled&&Cg(n);return{c(){B(e.$$.fragment),t=O(),h&&h.c(),i=O(),s=_("div"),l=_("div"),r=O(),o=_("button"),a=_("span"),a.textContent="Save changes",p(l,"class","flex-fill"),p(a,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[3]||n[2],ne(o,"btn-loading",n[2]),p(s,"class","flex")},m(g,y){V(e,g,y),w(g,t,y),h&&h.m(g,y),w(g,i,y),w(g,s,y),m(s,l),m(s,r),m(s,o),m(o,a),f=!0,c||(d=X(o,"click",n[12]),c=!0)},p(g,y){const b={};y&98305&&(b.$$scope={dirty:y,ctx:g}),e.$set(b),g[0].enabled?h?(h.p(g,y),y&1&&E(h,1)):(h=Cg(g),h.c(),E(h,1),h.m(i.parentNode,i)):h&&(Te(),F(h,1,1,()=>{h=null}),De()),(!f||y&12&&u!==(u=!g[3]||g[2]))&&(o.disabled=u),y&4&&ne(o,"btn-loading",g[2])},i(g){f||(E(e.$$.fragment,g),E(h),f=!0)},o(g){F(e.$$.fragment,g),F(h),f=!1},d(g){z(e,g),g&&k(t),h&&h.d(g),g&&k(i),g&&k(s),c=!1,d()}}}function IE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function NE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[15]),e.required=!0,p(s,"for",r=n[15])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[6]),o=!0)},p(u,f){f&32768&&t!==(t=u[15])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&32768&&r!==(r=u[15])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Cg(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,C;return i=new He({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[RE,({uniqueId:M})=>({15:M}),({uniqueId:M})=>M?32768:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[jE,({uniqueId:M})=>({15:M}),({uniqueId:M})=>M?32768:0]},$$scope:{
<div class="breadcrumb-item">Files storage</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("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>`,u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){V(e,S,C),w(S,t,C),w(S,i,C),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Jt(n[4])),h=!0)},p(S,[C]){let M=f;f=v(S),f===M?b[f].p(S,C):(Te(),F(b[M],1,1,()=>{b[M]=null}),De(),c=b[f],c?c.p(S,C):(c=b[f]=y[f](S),c.c()),E(c,1),c.m(o,null))},i(S){d||(E(e.$$.fragment,S),E(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function BE(n,e,t){let i,s={},l=!1,r=!1,o="";U.setDocumentTitle("Files storage"),a();async function a(){t(1,l=!0);try{const S=await Se.Settings.getAll()||{};f(S)}catch(S){Se.errorResponseHandler(S)}t(1,l=!1)}async function u(){if(!(r||!i)){t(2,r=!0);try{const S=await Se.Settings.update(U.filterRedactedProps({s3:s}));f(S),Wi({}),hn("Successfully saved Files storage settings.")}catch(S){Se.errorResponseHandler(S)}t(2,r=!1)}}function f(S={}){t(0,s=(S==null?void 0:S.s3)||{}),t(5,o=JSON.stringify(s))}function c(){s.enabled=this.checked,t(0,s)}function d(){s.endpoint=this.value,t(0,s)}function h(){s.bucket=this.value,t(0,s)}function g(){s.region=this.value,t(0,s)}function y(){s.accessKey=this.value,t(0,s)}function b(S){n.$$.not_equal(s.secret,S)&&(s.secret=S,t(0,s))}const v=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=o!=JSON.stringify(s))},[s,l,r,i,u,o,c,d,h,g,y,b,v]}class UE extends Ne{constructor(e){super(),Ie(this,e,BE,zE,Pe,{})}}function WE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",r=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[8]),o=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&r!==(r=u[16])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Mg(n){let e,t,i,s,l,r,o,a,u,f,c;return i=new He({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[YE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),r=new He({props:{class:"form-field "+(U.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[KE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new He({props:{class:"form-field "+(U.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[JE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const y={};h&1&&(y.class="form-field "+(U.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(y.$$scope={dirty:h,ctx:d}),r.$set(y);const b={};h&1&&(b.class="form-field "+(U.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(E(i.$$.fragment,d),E(r.$$.fragment,d),E(u.$$.fragment,d),d&&Dt(()=>{f||(f=ft(e,un,{duration:150},!0)),f.run(1)}),c=!0)},o(d){F(i.$$.fragment,d),F(r.$$.fragment,d),F(u.$$.fragment,d),d&&(f||(f=ft(e,un,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),z(i),z(r),z(u),d&&f&&f.end()}}}function YE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Minimum password length"),s=O(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",r=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].minPasswordLength),o||(a=X(l,"input",n[9]),o=!0)},p(u,f){f&65536&&i!==(i=u[16])&&p(e,"for",i),f&65536&&r!==(r=u[16])&&p(l,"id",r),f&1&&Tt(l.value)!==u[0].minPasswordLength&&$e(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&65536&&l!==(l=b[16]))&&p(e,"for",l);const S={};v&65536&&(S.id=b[16]),v&1&&(S.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&v&1&&(a=!0,S.value=b[0].exceptDomains,Re(()=>a=!1)),o.$set(S)},i(b){c||(E(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function JE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[11](b)}let y={id:n[16]+".config.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(y.value=n[0].onlyDomains),o=new vs({props:y}),he.push(()=>Fe(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const S={};v&65536&&(S.id=b[16]+".config.onlyDomains"),v&1&&(S.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&v&1&&(a=!0,S.value=b[0].onlyDomains,Re(()=>a=!1)),o.$set(S)},i(b){c||(E(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function xE(n){let e,t,i,s;e=new He({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[WE,({uniqueId:r})=>({16:r}),({uniqueId:r})=>r?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Mg(n);return{c(){B(e.$$.fragment),t=O(),l&&l.c(),i=rt()},m(r,o){V(e,r,o),w(r,t,o),l&&l.m(r,o),w(r,i,o),s=!0},p(r,o){const a={};o&196609&&(a.$$scope={dirty:o,ctx:r}),e.$set(a),r[0].enabled?l?(l.p(r,o),o&1&&E(l,1)):(l=Mg(r),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Te(),F(l,1,1,()=>{l=null}),De())},i(r){s||(E(e.$$.fragment,r),E(l),s=!0)},o(r){F(e.$$.fragment,r),F(l),s=!1},d(r){z(e,r),r&&k(t),l&&l.d(r),r&&k(i)}}}function GE(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ZE(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $g(n){let e,t,i,s,l,r;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,a){w(o,e,a),s=!0,l||(r=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){s||(Dt(()=>{i||(i=ft(e,Un,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(o){i||(i=ft(e,Un,{duration:150,start:.7},!1)),i.run(0),s=!1},d(o){o&&k(e),o&&i&&i.end(),l=!1,r()}}}function XE(n){let e,t,i,s,l,r,o;function a(d,h){return d[0].enabled?ZE:GE}let u=a(n),f=u(n),c=n[2]&&$g();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=O(),f.c(),i=O(),s=_("div"),l=O(),c&&c.c(),r=rt(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,r,h),o=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&E(c,1):(c=$g(),c.c(),E(c,1),c.m(r.parentNode,r)):c&&(Te(),F(c,1,1,()=>{c=null}),De())},i(d){o||(E(c),o=!0)},o(d){F(c),o=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(r)}}}function QE(n){let e,t;const i=[n[3]];let s={$$slots:{header:[XE],default:[xE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ct(s,i[l]);return e=new df({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){B(e.$$.fragment)},m(l,r){V(e,l,r),t=!0},p(l,[r]){const o=r&8?gn(i,[pi(l[3])]):{};r&131077&&(o.$$scope={dirty:r,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){F(e.$$.fragment,l),t=!1},d(l){n[12](null),z(e,l)}}}function eP(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Yt(e,s),r;pn(n,gs,M=>t(7,r=M));let{config:o={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){o.enabled=this.checked,t(0,o)}function h(){o.minPasswordLength=Tt(this.value),t(0,o)}function g(M){n.$$.not_equal(o.exceptDomains,M)&&(o.exceptDomains=M,t(0,o))}function y(M){n.$$.not_equal(o.onlyDomains,M)&&(o.onlyDomains=M,t(0,o))}function b(M){he[M?"unshift":"push"](()=>{a=M,t(1,a)})}function v(M){ut.call(this,n,M)}function S(M){ut.call(this,n,M)}function C(M){ut.call(this,n,M)}return n.$$set=M=>{e=ct(ct({},e),ci(M)),t(3,l=Yt(e,s)),"config"in M&&t(0,o=M.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!U.isEmpty(r==null?void 0:r.emailPassword))},[o,a,i,l,u,f,c,r,d,h,g,y,b,v,S,C]}class tP extends Ne{constructor(e){super(),Ie(this,e,eP,QE,Pe,{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 nP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"for",r=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[11]),o=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&r!==(r=u[22])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Og(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g;l=new He({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[iP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new He({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[sP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new He({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[lP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let y=n[4]&&Tg(n);return{c(){e=_("div"),t=_("div"),i=O(),s=_("div"),B(l.$$.fragment),r=O(),o=_("div"),B(a.$$.fragment),u=O(),f=_("div"),B(c.$$.fragment),d=O(),y&&y.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),V(l,s,null),m(e,r),m(e,o),V(a,o,null),m(e,u),m(e,f),V(c,f,null),m(e,d),y&&y.m(e,null),g=!0},p(b,v){const S={};v&2&&(S.name=b[1]+".clientId"),v&12582913&&(S.$$scope={dirty:v,ctx:b}),l.$set(S);const C={};v&2&&(C.name=b[1]+".clientSecret"),v&12582913&&(C.$$scope={dirty:v,ctx:b}),a.$set(C);const M={};v&2&&(M.name=b[1]+".allowRegistrations"),v&12582913&&(M.$$scope={dirty:v,ctx:b}),c.$set(M),b[4]?y?(y.p(b,v),v&16&&E(y,1)):(y=Tg(b),y.c(),E(y,1),y.m(e,null)):y&&(Te(),F(y,1,1,()=>{y=null}),De())},i(b){g||(E(l.$$.fragment,b),E(a.$$.fragment,b),E(c.$$.fragment,b),E(y),b&&Dt(()=>{h||(h=ft(e,un,{duration:200},!0)),h.run(1)}),g=!0)},o(b){F(l.$$.fragment,b),F(a.$$.fragment,b),F(c.$$.fragment,b),F(y),b&&(h||(h=ft(e,un,{duration:200},!1)),h.run(0)),g=!1},d(
<div class="breadcrumb-item">Auth providers</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){V(e,S,C),w(S,t,C),w(S,i,C),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Jt(n[5])),h=!0)},p(S,[C]){let M=f;f=v(S),f===M?b[f].p(S,C):(Te(),F(b[M],1,1,()=>{b[M]=null}),De(),c=b[f],c?c.p(S,C):(c=b[f]=y[f](S),c.c()),E(c,1),c.m(o,null))},i(S){d||(E(e.$$.fragment,S),E(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function bP(n,e,t){let i,s,l={},r=!1,o=!1,a="";U.setDocumentTitle("Auth providers"),u();async function u(){t(2,r=!0);try{const C=await Se.Settings.getAll()||{};c(C)}catch(C){Se.errorResponseHandler(C)}t(2,r=!1)}async function f(){if(!(o||!i)){t(3,o=!0);try{const C=await Se.Settings.update(U.filterRedactedProps(l));c(C),Wi({}),s==null||s.collapseSiblings(),hn("Successfully updated auth providers.")}catch(C){Se.errorResponseHandler(C)}t(3,o=!1)}}function c(C){C=C||{},t(0,l={}),t(0,l.emailAuth=Object.assign({enabled:!0},C.emailAuth),l);const M=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const $ of M)t(0,l[$]=Object.assign({enabled:!1,allowRegistrations:!0},C[$]),l);t(6,a=JSON.stringify(l))}function d(C){he[C?"unshift":"push"](()=>{s=C,t(1,s)})}function h(C){n.$$.not_equal(l.emailAuth,C)&&(l.emailAuth=C,t(0,l))}function g(C){n.$$.not_equal(l.googleAuth,C)&&(l.googleAuth=C,t(0,l))}function y(C){n.$$.not_equal(l.facebookAuth,C)&&(l.facebookAuth=C,t(0,l))}function b(C){n.$$.not_equal(l.githubAuth,C)&&(l.githubAuth=C,t(0,l))}function v(C){n.$$.not_equal(l.gitlabAuth,C)&&(l.gitlabAuth=C,t(0,l))}const S=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(l))},[l,s,r,o,i,f,a,d,h,g,y,b,v,S]}class yP extends Ne{constructor(e){super(),Ie(this,e,bP,_P,Pe,{})}}function Eg(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function vP(n){let e=[],t=new Map,i,s,l,r,o,a,u,f,c,d,h=n[4];const g=y=>y[12].key;for(let y=0;y<h.length;y+=1){let b=Eg(n,h,y),v=g(b);t.set(v,e[y]=Pg(v,b))}return{c(){for(let y=0;y<e.length;y+=1)e[y].c();i=O(),s=_("div"),l=_("div"),r=O(),o=_("button"),a=_("span"),a.textContent="Save changes",p(l,"class","flex-fill"),p(a,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[3]||n[2],ne(o,"btn-loading",n[2]),p(s,"class","flex")},m(y,b){for(let v=0;v<e.length;v+=1)e[v].m(y,b);w(y,i,b),w(y,s,b),m(s,l),m(s,r),m(s,o),m(o,a),f=!0,c||(d=X(o,"click",n[9]),c=!0)},p(y,b){b&32785&&(h=y[4],Te(),e=ot(e,b,g,1,y,h,t,i.parentNode,Lt,Pg,i,Eg),De()),(!f||b&12&&u!==(u=!y[3]||y[2]))&&(o.disabled=u),b&4&&ne(o,"btn-loading",y[2])},i(y){if(!f){for(let b=0;b<h.length;b+=1)E(e[b]);f=!0}},o(y){for(let b=0;b<e.length;b+=1)F(e[b]);f=!1},d(y){for(let b=0;b<e.length;b+=1)e[b].d(y);y&&k(i),y&&k(s),c=!1,d()}}}function kP(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function wP(n){let e,t=n[12].label+"",i,s,l,r,o,a,u,f,c,d,h;function g(){n[7].call(o,n[12])}function y(){return n[8](n[12])}return{c(){e=_("label"),i=H(t),s=H(" duration (in seconds)"),r=O(),o=_("input"),u=O(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[15]),p(o,"type","number"),p(o,"id",a=n[15]),o.required=!0,p(c,"class","link-primary"),ne(c,"txt-success",n[0][n[12].key].secret),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,i),m(e,s),w(b,r,v),w(b,o,v),$e(o,n[0][n[12].key].duration),w(b,u,v),w(b,f,v),m(f,c),d||(h=[X(o,"input",g),X(c,"click",y)],d=!0)},p(b,v){n=b,v&32768&&l!==(l=n[15])&&p(e,"for",l),v&32768&&a!==(a=n[15])&&p(o,"id",a),v&17&&Tt(o.value)!==n[0][n[12].key].duration&&$e(o,n[0][n[12].key].duration),v&17&&ne(c,"txt-success",n[0][n[12].key].secret)},d(b){b&&k(e),b&&k(r),b&&k(o),b&&k(u),b&&k(f),d=!1,lt(h)}}}function Pg(n,e){let t,i,s;return i=new He({props:{class:"form-field required"
2022-07-09 16:16:35 +08:00
<div class="breadcrumb-item">Token options</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML="<p>Adjust common token options.</p>",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content m-b-sm txt-xl"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){V(e,S,C),w(S,t,C),w(S,i,C),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Jt(n[5])),h=!0)},p(S,[C]){let M=f;f=v(S),f===M?b[f].p(S,C):(Te(),F(b[M],1,1,()=>{b[M]=null}),De(),c=b[f],c?c.p(S,C):(c=b[f]=y[f](S),c.c()),E(c,1),c.m(o,null))},i(S){d||(E(e.$$.fragment,S),E(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function CP(n,e,t){let i;const s=[{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 l={},r=!1,o=!1,a="";U.setDocumentTitle("Token options"),u();async function u(){t(1,r=!0);try{const y=await Se.Settings.getAll()||{};c(y)}catch(y){Se.errorResponseHandler(y)}t(1,r=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const y=await Se.Settings.update(U.filterRedactedProps(l));c(y),hn("Successfully saved tokens options.")}catch(y){Se.errorResponseHandler(y)}t(2,o=!1)}}function c(y){var b;y=y||{},t(0,l={});for(const v of s)t(0,l[v.key]={duration:((b=y[v.key])==null?void 0:b.duration)||0},l);t(6,a=JSON.stringify(l))}function d(y){l[y.key].duration=Tt(this.value),t(0,l)}const h=y=>{l[y.key].secret?(delete l[y.key].secret,t(0,l)):t(0,l[y.key].secret=U.randomString(50),l)},g=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,r,o,i,s,f,a,d,h,g]}class MP extends Ne{constructor(e){super(),Ie(this,e,CP,SP,Pe,{})}}const $P={"/_elements":Zt({asyncComponent:()=>bi(()=>import("./Elements.72ef4bd6.js"),[])}),"/login":Zt({component:lE,conditions:[n=>!Se.AuthStore.isValid]}),"/request-password-reset":Zt({asyncComponent:()=>bi(()=>import("./PageAdminRequestPasswordReset.ce8ba7e8.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>bi(()=>import("./PageAdminConfirmPasswordReset.0e8d33d0.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/collections":Zt({component:sA,conditions:[n=>Se.AuthStore.isValid]}),"/logs":Zt({component:m4,conditions:[n=>Se.AuthStore.isValid]}),"/users":Zt({component:TA,conditions:[n=>Se.AuthStore.isValid]}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>bi(()=>import("./PageUserConfirmPasswordReset.f9761e2a.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>bi(()=>import("./PageUserConfirmVerification.c9d05aa2.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>bi(()=>import("./PageUserConfirmEmailChange.3457a606.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/settings":Zt({component:pE,conditions:[n=>Se.AuthStore.isValid]}),"/settings/admins":Zt({component:GA,conditions:[n=>Se.AuthStore.isValid]}),"/settings/mail":Zt({component:LE,conditions:[n=>Se.AuthStore.isValid]}),"/settings/storage":Zt({component:UE,conditions:[n=>Se.AuthStore.isValid]}),"/settings/auth-providers":Zt({component:yP,conditions:[n=>Se.AuthStore.isValid]}),"/settings/tokens":Zt({component:MP,conditions:[n=>Se.AuthStore.isValid]}),"*":Zt({asyncComponent:()=>bi(()=>import("./NotFoundPage.b2ca941e.js"),[])})};function OP(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[r,o]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*r/t.width-(t.left+r),u=e.top+e.height*o/t.height-(t.top+o),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=To}=i;return{delay:f,duration:Kn(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const y=g*a,b=g*u,v=h+g*e.width/t.width,S=h+g*e.height/t.height;r
2022-07-09 05:53:10 +08:00
<span class="txt">Manage admins</span>`,t=O(),i=_("hr"),s=O(),l=_("div"),l.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(l,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),r||(o=[Xe(Mn.call(null,e)),X(l,"click",n[3])],r=!0)},p:re,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),r=!1,lt(o)}}}function qP(n){var c;let e,t,i,s,l,r,o,a,u,f=((c=n[0])==null?void 0:c.id)&&Ig(n);return s=new n1({props:{routes:$P}}),s.$on("routeLoading",n[1]),s.$on("conditionsFailed",n[2]),r=new LP({}),a=new jP({}),{c(){e=_("div"),f&&f.c(),t=O(),i=_("div"),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment),p(i,"class","app-body"),p(e,"class","app-layout")},m(d,h){w(d,e,h),f&&f.m(e,null),m(e,t),m(e,i),V(s,i,null),w(d,l,h),V(r,d,h),w(d,o,h),V(a,d,h),u=!0},p(d,[h]){var g;(g=d[0])!=null&&g.id?f?(f.p(d,h),h&1&&E(f,1)):(f=Ig(d),f.c(),E(f,1),f.m(e,t)):f&&(Te(),F(f,1,1,()=>{f=null}),De())},i(d){u||(E(f),E(s.$$.fragment,d),E(r.$$.fragment,d),E(a.$$.fragment,d),u=!0)},o(d){F(f),F(s.$$.fragment,d),F(r.$$.fragment,d),F(a.$$.fragment,d),u=!1},d(d){d&&k(e),f&&f.d(),z(s),d&&k(l),z(r,d),d&&k(o),z(a,d)}}}function VP(n,e,t){let i;pn(n,Vu,a=>t(0,i=a));let s;function l(a){var u,f;((u=a==null?void 0:a.detail)==null?void 0:u.location)!==s&&(s=(f=a==null?void 0:a.detail)==null?void 0:f.location,U.setDocumentTitle(""),Wi({}),Tb())}function r(){Se.AuthStore.isValid?So("/"):Se.logout()}function o(){Se.logout()}return[i,l,r,o]}class zP extends Ne{constructor(e){super(),Ie(this,e,VP,qP,Pe,{})}}new zP({target:document.getElementById("app")});export{ne as A,X as B,Jt as C,H as D,_e as E,QA as F,$e as G,U as H,lt as I,hn as J,So as K,rt as L,pn as M,Ks as N,ys as O,vn as P,Pn as Q,di as R,Ne as S,Ti as a,he as b,Fe as c,O as d,_ as e,B as f,p as g,w as h,Ie as i,m as j,Xe as k,Re as l,V as m,E as n,F as o,k as p,z as q,BP as r,Pe as s,St as t,re as u,Mn as v,Te as w,De as x,Se as y,He as z};