pocketbase/ui/dist/assets/index.e13041a6.js

662 lines
846 KiB
JavaScript
Raw Normal View History

(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 o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).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)}})();function se(){}const Sl=n=>n;function at(n,e){for(const t in e)n[t]=e[t];return n}function Hm(n){return n()}function su(){return Object.create(null)}function Ye(n){n.forEach(Hm)}function Jn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function ti(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function mb(n){return Object.keys(n).length===0}function jm(n,...e){if(n==null)return se;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function rt(n,e,t){n.$$.on_destroy.push(jm(e,t))}function $n(n,e,t,i){if(n){const s=qm(n,e,t,i);return n[0](s)}}function qm(n,e,t,i){return n[1]&&i?at(t.ctx.slice(),n[1](i(e))):t.ctx}function Sn(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=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Cn(n,e,t,i,s,l){if(s){const o=qm(e,t,i,l);n.p(o,s)}}function Mn(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 li(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Bt(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 lu(n){return n==null?"":n}function tn(n,e,t){return n.set(t),e}function We(n){return n&&Jn(n.destroy)?n.destroy:se}const Vm=typeof window<"u";let Ho=Vm?()=>window.performance.now():()=>Date.now(),ga=Vm?n=>requestAnimationFrame(n):se;const ws=new Set;function zm(n){ws.forEach(e=>{e.c(n)||(ws.delete(e),e.f())}),ws.size!==0&&ga(zm)}function jo(n){let e;return ws.size===0&&ga(zm),{promise:new Promise(t=>{ws.add(e={c:n,f:t})}),abort(){ws.delete(e)}}}function m(n,e){n.appendChild(e)}function Bm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function gb(n){const e=_("style");return _b(Bm(n),e),e.sheet}function _b(n,e){return m(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function nn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function N(n){return document.createTextNode(n)}function D(){return N(" ")}function Ue(){return N("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ni(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Um(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 mi(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 Pt(n){return n===""?null:+n}function bb(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function ou(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 Wm(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${vb(f)}_${r}`,d=Bm(n),{stylesheet:h,rules:g}=go.get(d)||yb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,_o+=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(", "),_o-=s,_o||kb())}function kb(){ga(()=>{_o||(go.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),go.clear())})}function wb(n,e,t,i){if(!e)return se;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return se;const{delay:l=0,duration:o=300,easing:r=Sl,start:a=Ho()+l,end:u=a+o,tick:f=se,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=dl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&pl(n,g),d=!1}return jo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const $=y-a,C=0+1*r($/o);f(C,1-C)}return!0}),v(),f(0,1),b}function $b(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,Ym(n,s)}}function Ym(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 hl;function il(n){hl=n}function qo(){if(!hl)throw new Error("Function called outside component initialization");return hl}function Nn(n){qo().$$.on_mount.push(n)}function Sb(n){qo().$$.after_update.push(n)}function Cb(n){qo().$$.on_destroy.push(n)}function Qt(){const n=qo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Wm(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function xe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Qs=[],me=[],uo=[],Hr=[],Km=Promise.resolve();let jr=!1;function Jm(){jr||(jr=!0,Km.then(Zm))}function Zn(){return Jm(),Km}function Tt(n){uo.push(n)}function He(n){Hr.push(n)}const or=new Set;let Vl=0;function Zm(){const n=hl;do{for(;Vl<Qs.length;){const e=Qs[Vl];Vl++,il(e),Mb(e.$$)}for(il(null),Qs.length=0,Vl=0;me.length;)me.pop()();for(let e=0;e<uo.length;e+=1){const t=uo[e];or.has(t)||(or.add(t),t())}uo.length=0}while(Qs.length);for(;Hr.length;)Hr.pop()();jr=!1,or.clear(),il(n)}function Mb(n){if(n.fragment!==null){n.update(),Ye(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let qs;function _a(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function ns(n,e,t){n.dispatchEvent(Wm(`${e?"intro":"outro"}${t}`))}const fo=new Set;let ci;function Ae(){ci={r:0,c:[],p:ci}}function Pe(){ci.r||Ye(ci.c),ci=ci.p}function A(n,e){n&&n.i&&(fo.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(fo.has(n))return;fo.add(n),ci.c.push(()=>{fo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function Gm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&pl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=Sl,tick:g=se,css:v}=i||ba;v&&(l=dl(n,0,1,d,c,h,v,r++)),g(0,1);const b=Ho()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ns(n,!0,"start")),o=jo($=>{if(s){if($>=y)return g(1,0),ns(n,!0,"end"),a(),s=!1;if($>=b){const C=h(($-b)/d);g(C,1-C)}}return s})}let f=!1;return{start(){f||(f=!0,pl(n),Jn(i)?(i=i(),_a().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Xm(n,e,t){let i=e(n,t),s=!0,l;const o=ci;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=Sl,tick:c=se,css:d}=i||ba;d&&(l=dl(n,1,0,u,a,f,d));const h=Ho()+a,g=h+u;Tt(()=>ns(n,!1,"start")),jo(v=>{if(s){if(v>=g)return c(0,1),ns(n,!1,"end"),--o.r||Ye(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Jn(i)?_a().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&pl(n,l),s=!1)}}}function nt(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&pl(n,a)}fu
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),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 x0(n){let e,t,i,s=!n[0]&&qu();const l=n[1].default,o=$n(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=qu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Cn(o,l,r,r[2],i?Sn(l,r[2],a,null):Mn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function ev(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[x0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function tv(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class o_ extends Ee{constructor(e){super(),Oe(this,e,tv,ev,De,{nobranding:0})}}function Vu(n,e,t){const i=n.slice();return i[11]=e[t],i}const nv=n=>({}),zu=n=>({uniqueId:n[3]});function iv(n){let e=(n[11]||wo)+"",t;return{c(){t=N(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||wo)+"")&&ue(t,e)},d(i){i&&k(t)}}}function sv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||wo)+"",i;return{c(){e=_("pre"),i=N(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||wo)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Bu(n){let e,t;function i(o,r){return typeof o[11]=="object"?sv:iv}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function lv(n){let e,t,i,s,l;const o=n[7].default,r=$n(o,n,n[6],zu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Bu(Vu(n,a,f));return{c(){e=_("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),ne(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=J(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Cn(r,o,f,f[6],i?Sn(o,f[6],c,nv):Mn(f[6]),zu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Vu(f,a,d);u[d]?u[d].p(h,c):(u[d]=Bu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),(!i||c&5)&&ne(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){L(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),nn(u,f),n[9](null),s=!1,l()}}}const wo="Invalid value";function ov(n,e,t){let i;rt(n,Vi,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+B.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Ea(r)}Nn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){xe.call(this,n,g)}function h(g){me[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=B.toArray(B.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Ne extends Ee{constructor(e){super(),Oe(this,e,ov,lv,De,{name:4,class:0})}}function rv(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Me(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function av(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("Password"),s=D(),l=_("input"),r=D(),a=
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ne(f,"btn-disabled",n[3]),ne(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),H(a,e,null),m(e,u),m(e,f),c=!0,d||(h=J(e,"submit",Yt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&1540&&($.$$scope={dirty:v,ctx:g}),a.$set($),(!c||v&8)&&ne(f,"btn-disabled",g[3]),(!c||v&8)&&ne(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),j(s),j(o),j(a),d=!1,h()}}}function cv(n,e,t){const i=Qt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await we.admins.create({email:s,password:l,passwordConfirm:o}),await we.admins.authViaEmail(s,l),i("submit")}catch(d){we.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class dv extends Ee{constructor(e){super(),Oe(this,e,cv,fv,De,{})}}function Uu(n){let e,t;return e=new o_({props:{$$slots:{default:[pv]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function pv(n){let e,t;return e=new dv({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:se,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hv(n){let e,t,i=n[0]&&Uu(n);return{c(){i&&i.c(),e=Ue()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Uu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Ae(),L(i,1,1,()=>{i=null}),Pe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function mv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){we.logout(!1),t(0,i=!0);return}we.authStore.isValid?Ci("/collections"):we.logout()}return[i,async()=>{t(0,i=!1),await Zn(),window.location.search=""}]}class gv extends Ee{constructor(e){super(),Oe(this,e,mv,hv,De,{})}}const Nt=Gn(""),$o=Gn(""),us=Gn(!1);function Zo(n){const e=n-1;return e*e*e+1}function So(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Wn(n,{delay:e=0,duration:t=400,easing:i=Zo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
2022-09-29 02:55:18 +08:00
opacity: ${a-f*d}`}}function on(n,{delay:e=0,duration:t=400,easing:i=Zo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=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*o}px;padding-top: ${h*r}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 Tn(n,{delay:e=0,duration:t=400,easing:i=Zo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function _v(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,o){w(l,e,o),n[13](e),Me(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Me(e,l[7])},i:se,o:se,d(l){l&&k(e),n[13](null),i=!1,s()}}}function bv(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],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 o&&(e=new o(r(n)),me.push(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=Ue()},m(a,u){e&&H(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],He(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&j(e,a)}}}function Wu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Yu();return{c(){r&&r.c(),e=D(),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){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=J(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Yu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Ae(),L(r,1,1,()=>{r=null}),Pe())},i(a){s||(A(r),a&&Tt(()=>{i||(i=nt(t,Wn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){L(r),a&&(i||(i=nt(t,Wn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Yu(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||(s&&Tt(()=>{t||(t=nt(e,Wn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=nt(e,Wn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function vv(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[bv,_v],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Wu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=D(),r.c(),a=D(),v&&v.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,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[J(t,"submit",Yt(n[10])),J(e,"click",ni(n[11]))],f=!0)},p(b,[y]){let $=o;o=g(b),o===$?h[o].p(b,y):(Ae(),L(h[$],1,1,()=>{h[$]=null}),Pe(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Wu(b),v.c(),A(v,1),v.m(t,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){u||(A(r),A(v),u=!0)},o(b){L(r),L(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Ye(c)}}}function yv(n,e,t){const i=Qt(),s="search_"+B.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new dn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(T=!0){t(7,d=""),T&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Pi(()=>import("./FilterAutocompleteInput.37739e76.js"),["FilterAutocompleteInput.37739e76.js","index.a9121ab1.js"],import.meta.url)).default),t(5,f=!1))}Nn(()=>{v()});function b(T){xe.call(this,n,T)}function y(T){d=T,t(7,d),t(0,l)}function $(T){me[T?"unshift":"push"](()=>{c=T,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const S=()=>{h(!1),g()};return n.$$set=T=>{"value"in T&&t(0,l=T.value),"placeholder"in T&&t(1,o=T.placeholder),"autocompleteCollection"in T&&t(2,r=T.autocompleteCollection),"extraAutocompleteKeys"in T&&t(3,a=T.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,
2022-09-29 02:55:18 +08:00
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Av(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Pv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Lv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Iv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Zu(n){let e;function t(l,o){return l[6]?Fv:Nv}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Nv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Gu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),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),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Gu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Fv(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:se,d(t){t&&k(e)}}}function Gu(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=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Xu(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 Qu(n,e){var ve,_e,ge;let t,i,s,l=((ve=e[21].method)==null?void 0:ve.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,$=(e[21].referer||"N/A")+"",C,S,T,M,O,E=e[21].status+"",P,I,F,V,X,te,Z,ee,U,Y,G=(((_e=e[21].meta)==null?void 0:_e.errorMessage)||((ge=e[21].meta)==null?void 0:ge.errorData))&&Xu();V=new Si({props:{date:e[21].created}});function de(){return e[16](e[21])}function x(...K){return e[17](e[21],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=N(l),a=D(),u=_("td"),f=_("span"),d=N(c),g=D(),G&&G.c(),v=D(),b=_("td"),y=_("span"),C=N($),T=D(),M=_("td"),O=_("span"),P=N(E),I=D(),F=_("td"),q(V.$$.fragment),X=D(),te=_("td"),te.innerHTML='<i class="ri-arrow-right-line"></i>',Z=D(),p(s,"class",r="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(y,"class","txt txt-ellipsis"),p(y,"title",S=e[21].referer),ne(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),ne(O,"label-danger",e[21].status>=400),p(M,"class","col-type-number col-field-status"),p(F,"class","col-type-date col-field-created"),p(te,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,ye){w(K,t,ye),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),G&&G.m(u,null),m(t,v),m(t,b),m(b,y),m(y,C),m(t,T),m(t,M),m(M,O),m(O,P),m(t,I),m(t,F),H(V,F,null),m(t,X),m(t,te),m(t,Z),ee=!0,U||(Y=[J(t,"click",de),J(t,"keydown",x)],U=!0)},p(K,ye){var W,ce,ae;e=K,(!ee||ye&8)&&l!==(l=((W=e[21].method)==null?void 0:W.toUpperCase())+"")&&ue(o,l),(!ee||ye&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!ee||ye&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!ee||ye&8&&h!==(h=e[21].url))&&p(f,"title",h),((ce=e[21].meta)==null?void 0:ce.errorMessage)||((ae=e[21].meta)==null?void 0:ae.errorData)?G||(G=Xu(),G.c(),G.m(u,null)):G&&(G.d(1),G=null),(!ee||ye&8)&&$!==($=(e[21].referer||"N/A")+"")&&ue(C,$),(!ee||ye&8&&S!==(S=e[21].referer))&&p(y,"title",S),(!ee||ye&8)&&ne(y,"txt-hint",!e[21].referer),(!ee||ye&8)&&E!==(E=e[21].status+"")&&ue(P,E),(!ee||ye&8)&&ne(O,"label-danger",e[21].status>=400);const oe={};ye&8&&(oe.date=e[21].created),V.$set(oe)},i(K){ee||(A(V.$$.fragment,K),ee=!0)},o(K){L(V.$$.fragment,K),ee=!1},d(K){K&&k(t),G&&G.d(),j(V),U=!1,Ye(Y)}}}function xu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function ef(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),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,o),m(i,r),a||(u=J(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,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 Rv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O=[],E=new Map,P,I,F,V;function X(W){n[11](W)}let te={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ev]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),l=new an({props:te}),me.push(()=>Re(l,"sort",X));function Z(W){n[12](W)}let ee={disable:!0,class:"col-type-text col-field-url",nam
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function _i(){}const qv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(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 mt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Kt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Hn(n,e){return Kt(n)?n:e}function vt(n,e){return typeof n>"u"?e:n}const Vv=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,a_=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(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(mt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function Co(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 Mo(n){if(It(n))return n.map(Mo);if(mt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=Mo(n[t[s]]);return e}return n}function u_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function zv(n,e,t,i){if(!u_(n))return;const s=e[n],l=t[n];mt(s)&&mt(l)?gl(s,l,i):e[n]=Mo(l)}function gl(n,e,t){const i=It(e)?e:[e],s=i.length;if(!mt(n))return n;t=t||{};const l=t.merger||zv;for(let o=0;o<s;++o){if(e=i[o],!mt(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function ol(n,e){return gl(n,e,{merger:Bv})}function Bv(n,e,t){if(!u_(n))return;const i=e[n],s=t[n];mt(i)&&mt(s)?ol(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Mo(s))}const tf={"":n=>n,x:n=>n.x,y:n=>n.y};function ji(n,e){return(tf[e]||(tf[e]=Uv(e)))(n)}function Uv(n){const e=Wv(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Wv(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Pa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Yn=n=>typeof n<"u",qi=n=>typeof n=="function",nf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Yv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Wt=Math.PI,At=2*Wt,Kv=At+Wt,To=Number.POSITIVE_INFINITY,Jv=Wt/180,zt=Wt/2,Ws=Wt/4,sf=Wt*2/3,Bn=Math.log10,pi=Math.sign;function lf(n){const e=Math.round(n);n=rl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Bn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Zv(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 Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function rl(n,e,t){return Math.abs(n-e)<t}function Gv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function f_(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 ei(n){return n*(Wt/180)}function La(n){return n*(180/Wt)}function of(n){if(!Kt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function c_(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*Wt&&(l+=At),{angle:l,distance:s}}function ea(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Xv(n,e){return(n-e+Kv)%At-Wt}function Pn(n){return(n%At+At)%At}function _l(n,e,t,i){const s=Pn(n),l=Pn(e),o=Pn(t),r=Pn(l-s),a=Pn(o-s),u=Pn(s-l),f=Pn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function cn(n,e,t){return Math.max(e,Math.min(t,n))}function Qv(n){return cn(n,-32768,32767)}function bl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ia(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const ts=(n,e,t,i)=>Ia(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),xv=(n,e,t)=>Ia(n,t,i=>n[i][e]>=t);function ey(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Ol(n){return n+.5|0}const Ni=(n,e,t)=>Math.max(Math.min(n,t),e);function tl(n){return Ni(Ol(n*2.55),0,255)}function Hi(n){return Ni(Ol(n*255),0,255)}function yi(n){return Ni(Ol(n/2.55)/100,0,1)}function cf(n){return Ni(Ol(n*100),0,100)}const Rn={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},ta=[..."0123456789ABCDEF"],sy=n=>ta[n&15],ly=n=>ta[(n&240)>>4]+ta[n&15],Zl=n=>(n&240)>>4===(n&15),oy=n=>Zl(n.r)&&Zl(n.g)&&Zl(n.b)&&Zl(n.a);function ry(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Rn[n[1]]*17,g:255&Rn[n[2]]*17,b:255&Rn[n[3]]*17,a:e===5?Rn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Rn[n[1]]<<4|Rn[n[2]],g:Rn[n[3]]<<4|Rn[n[4]],b:Rn[n[5]]<<4|Rn[n[6]],a:e===9?Rn[n[7]]<<4|Rn[n[8]]:255})),t}const ay=(n,e)=>n<255?e(n):"";function uy(n){var e=oy(n)?sy:ly;return n?"#"+e(n.r)+e(n.g)+e(n.b)+ay(n.a,e):void 0}const fy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function b_(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function cy(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 dy(n,e,t){const i=b_(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 py(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 Na(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=py(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Fa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Hi)}function Ra(n,e,t){return Fa(b_,n,e,t)}function hy(n,e,t){return Fa(dy,n,e,t)}function my(n,e,t){return Fa(cy,n,e,t)}function v_(n){return(n%360+360)%360}function gy(n){const e=fy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?tl(+e[5]):Hi(+e[5]));const s=v_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=hy(s,l,o):e[1]==="hsv"?i=my(s,l,o):i=Ra(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function _y(n,e){var t=Na(n);t[0]=v_(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function by(n){if(!n)return;const e=Na(n),t=e[0],i=cf(e[1]),s=cf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const df={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"},pf={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.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class kk{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],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=h_.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 o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(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 bi=new kk;const Cf="transparent",wk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=mf(n||Cf),s=i.valid&&mf(e||Cf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class $k{constructor(e,t,i,s){const l=t[i];s=Ql([e.to,s,l,e.from]);const o=Ql([e.from,l,s]);this._active=!0,this._fn=e.fn||wk[e.type||typeof o],this._easing=al[e.easing]||al.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=o,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,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Ql([e.to,t,s,e.from]),this._from=Ql([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,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,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 Sk=["x","y","borderWidth","radius","tension"],Ck=["color","borderColor","backgroundColor"];kt.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 Mk=Object.keys(kt.animation);kt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});kt.set("animations",{colors:{type:"color",properties:Ck},numbers:{type:"number",properties:Sk}});kt.describe("animations",{_fallback:"animation"});kt.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 I_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!mt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!mt(s))return;const l={};for(co
`)>-1?n.split(`
`):n}function zw(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function nc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Kn(e.padding);let v=g.height,b=0,y=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*S+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let $=0;const C=function(S){b=Math.max(b,t.measureText(S).width+$)};return t.save(),t.font=u.string,Et(n.title,C),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,Et(i,S=>{Et(S.before,C),Et(S.lines,C),Et(S.after,C)}),$=0,t.font=f.string,Et(n.footer,C),t.restore(),b+=g.width,{width:b,height:v}}function Bw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Uw(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function Ww(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),Uw(u,n,e,t)&&(u="center"),u}function ic(n,e,t){const i=t.yAlign||e.yAlign||Bw(n,t);return{xAlign:t.xAlign||e.xAlign||Ww(n,e,t,i),yAlign:i}}function Yw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Kw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function sc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=Ss(o);let g=Yw(e,r);const v=Kw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:cn(g,0,i.width-e.width),y:cn(v,0,i.height-e.height)}}function lo(n,e,t){const i=Kn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function lc(n){return fi([],vi(n))}function Jw(n,e,t){return zi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function oc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class fa extends Mi{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 I_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Jw(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]),o=i.afterTitle.apply(this,[e]);let r=[];return r=fi(r,vi(s)),r=fi(r,vi(l)),r=fi(r,vi(o)),r}getBeforeBody(e,t){return lc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Et(e,l=>{const o={before:[],lines:[],after:[]},r=oc(i,l);fi(o.before,vi(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.2.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const m$={datetime:Ge.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ge.TIME_WITH_SECONDS,minute:Ge.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};j_._date.override({_id:"luxon",_create:function(n){return Ge.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return m$},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Ge.fromFormat(n,e,t):n=Ge.fromISO(n,t):n instanceof Date?n=Ge.fromJSDate(n,t):i==="object"&&!(n instanceof Ge)&&(n=Ge.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):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 hc(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||(s&&Tt(()=>{t||(t=nt(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=nt(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function g$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=N(n[1]),t=D(),s=N(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function _$(n){let e;return{c(){e=N("Loading...")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function b$(n){let e,t,i,s,l,o=n[2]&&hc();function r(f,c){return f[2]?_$:g$}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=D(),i=_("canvas"),s=D(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),ou(i,"height","250px"),ou(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(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=hc(),o.c(),A(o,1),o.m(e,t)):o&&(Ae(),L(o,1,1,()=>{o=null}),Pe()),c&4&&ne(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){L(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function v$(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),we.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:B.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),we.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Nn(()=>(No.register(Bi,tr,xo,xa,Ll,Vw,Zw),t(6,o=new No(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,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}}}})),()=>o==null?void 0:o.destroy()));function d(h){me[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<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o
* 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,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function $(C){return C instanceof a?new a(C.type,$(C.content),C.alias):Array.isArray(C)?C.map($):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(C,S){S=S||{};var T,M;switch(r.util.type(C)){case"Object":if(M=r.util.objId(C),S[M])return S[M];T={},S[M]=T;for(var O in C)C.hasOwnProperty(O)&&(T[O]=$(C[O],S));return T;case"Array":return M=r.util.objId(C),S[M]?S[M]:(T=[],S[M]=T,C.forEach(function(E,P){T[P]=$(E,S)}),T);default:return C}},getLanguage:function($){for(;$;){var C=s.exec($.className);if(C)return C[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,C){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(T){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if($){var C=document.getElementsByTagName("script");for(var S in C)if(C[S].src==$)return C[S]}return null}},isActive:function($,C,S){for(var T="no-"+C;$;){var M=$.classList;if(M.contains(C))return!0;if(M.contains(T))return!1;$=$.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,C){var S=r.util.clone(r.languages[$]);for(var T in C)S[T]=C[T];return S},insertBefore:function($,C,S,T){T=T||r.languages;var M=T[$],O={};for(var E in M)if(M.hasOwnProperty(E)){if(E==C)for(var P in S)S.hasOwnProperty(P)&&(O[P]=S[P]);S.hasOwnProperty(E)||(O[E]=M[E])}var I=T[$];return T[$]=O,r.languages.DFS(r.languages,function(F,V){V===I&&F!=$&&(this[F]=O)}),O},DFS:function $(C,S,T,M){M=M||{};var O=r.util.objId;for(var E in C)if(C.hasOwnProperty(E)){S.call(C,E,C[E],T||E);var P=C[E],I=r.util.type(P);I==="Object"&&!M[O(P)]?(M[O(P)]=!0,$(P,S,null,M)):I==="Array"&&!M[O(P)]&&(M[O(P)]=!0,$(P,S,E,M))}}},plugins:{},highlightAll:function($,C){r.highlightAllUnder(document,$,C)},highlightAllUnder:function($,C,S){var T={callback:S,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),r.hooks.run("before-all-elements-highlight",T);for(var M=0,O;O=T.elements[M++];)r.highlightElement(O,C===!0,T.callback)},highlightElement:function($,C,S){var T=r.util.getLanguage($),M=r.languages[T];r.util.setLanguage($,T);var O=$.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,T);var E=$.textContent,P={element:$,language:T,grammar:M,code:E};function I(V){P.highlightedCode=V,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),S&&S.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),S&&S.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){I(r.util.encode(P.code));return}if(C&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(V){I(V.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else I(r.highlight(P.code,P.grammar,P.language))},highlight:function($,C,S){var T={code:$,grammar:C,language:S};if(r.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=r.tokenize(T.code,T.grammar),r.hooks.run("after-tokenize",T),a.stringify(r.util.encode(T.tokens),T.language)},tokenize:function($,C){var S=C.rest;if(S){for(var T in S)C[T]=S[T];delete C.rest}var M=new c;return d(M,M.head,$),f($,M,C,M.head,0),g(M)},hooks:{all:{},add:function
2022-09-29 02:55:18 +08:00
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}y.textContent=M,t.highlightElement(y)},function(M){b.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),$=0,C;C=y[$++];)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)}}()})(lb);const Xs=lb.exports;var k$={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
2022-09-02 15:12:36 +08:00
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var h=s(f[d]);c+=h,c>r&&(f[d]=`
`+f[d],c=h)}a[u]=f.join("")}return a.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(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",g="",v=!1,b=0;b<d.length;++b){var y=d[b];y==o.element?v=!0:y.nodeName==="#text"&&(v?g+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var $=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(k$);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function w$(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:se,o:se,d(s){s&&k(e)}}}function $$(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class bn extends Ee{constructor(e){super(),Oe(this,e,$$,w$,De,{class:0,content:2,language:3})}}const S$=n=>({}),gc=n=>({}),C$=n=>({}),_c=n=>({});function bc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C=n[4]&&!n[2]&&vc(n);const S=n[18].header,T=$n(S,n,n[17],_c);let M=n[4]&&n[2]&&yc(n);const O=n[18].default,E=$n(O,n,n[17],null),P=n[18].footer,I=$n(P,n,n[17],gc);return{c(){e=_("div"),t=_("div"),s=D(),l=_("div"),o=_("div"),C&&C.c(),r=D(),T&&T.c(),a=D(),M&&M.c(),u=D(),f=_("div"),E&&E.c(),c=D(),d=_("div"),I&&I.c(),
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const $={};y&16&&($.id=b[4]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function PS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),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,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=We(yt.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const $={};y&16&&($.id=b[4]+".options.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function LS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[AS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[PS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.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),H(i,t,null),m(e,s),m(e,l),H(o,l,null),r=!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}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function IS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class ub extends Ee{constructor(e){super(),Oe(this,e,IS,LS,De,{key:1,options:0})}}function NS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new ub({props:r}),me.push(()=>Re(e,"key",l)),me.push(()=>Re(e,"options",o)),{c(){q(e.$$.fragment)},m(a,u){H(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function FS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class RS extends Ee{constructor(e){super(),Oe(this,e,FS,NS,De,{key:0,options:1})}}var Or=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Cs={_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<"u"&&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.org/1999/x
<span class='flatpickr-weekday'>
`+z.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function de(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function x(R,z){z===void 0&&(z=!0);var ie=z?R:R-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ke("onYearChange"),X()),V(),Ke("onMonthChange"),ot())}function ve(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Lr(t.config),re=ie.hours,Le=ie.minutes,le=ie.seconds;h(re,Le,le)}t.redraw(),R&&Ke("onChange")}function _e(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ke("onClose")}function ge(){t.config!==void 0&&Ke("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].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 z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}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(ie){try{delete t[ie]}catch{}})}function K(R){return t.calendarContainer.contains(R)}function ye(R){if(t.isOpen&&!t.config.inline){var z=En(R),ie=K(z),re=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Le=!re&&!ie&&!K(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(pe){return pe.contains(z)});Le&&le&&(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 oe(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var z=R,ie=t.currentYear!==z;t.currentYear=z||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)),ie&&(t.redraw(),Ke("onYearChange"),X())}}function W(R,z){var ie;z===void 0&&(z=!0);var re=t.parseDate(R,void 0,z);if(t.config.minDate&&re&&An(re,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0
2022-09-29 02:55:18 +08:00
Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].mimeTypes,He(()=>a=!1)),r.$set(I);const F={};P&2049&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function f3(n){let e;return{c(){e=_("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function c3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;function M(E){n[9](E)}let O={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new hs({props:O}),me.push(()=>Re(r,"value",M)),$=new Ti({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[f3]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=D(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=D(),b=_("i"),y=D(),q($.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,P){w(E,e,P),m(e,t),m(e,i),m(e,s),w(E,o,P),H(r,E,P),w(E,u,P),w(E,f,P),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),H($,h,null),C=!0,S||(T=We(yt.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].thumbs,He(()=>a=!1)),r.$set(I);const F={};P&2048&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function d3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[o3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[r3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[u3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[c3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(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,v){w(g,e,v),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&2&&($.name="schema."+g[1]+".options.mimeTypes"),v&3073&&($.$$scope={dirty:v,ctx:g}),u.$set($);const C={};v&2&&(C.name="schema."+g[1]+".options.thumbs"),v&3073&&(C.$$scope={dirty:v,ctx:g}),d.$set(C)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),L(d.$$.fragment,g),h=!1},d(g){g&&k(e),j(i),j(o),j(u),j(d)}}}function p3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{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)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[T3,({uniqueId:V})=>({38:V}),({uniqueId:V})=>[0,V?128:0]]},$$scope:{ctx:n}}});const O=[H3,R3,F3,N3,I3,L3,P3,A3,E3,O3,D3],E=[];function P(V,X){return V[0].type==="text"?0:V[0].type==="number"?1:V[0].type==="bool"?2:V[0].type==="email"?3:V[0].type==="url"?4:V[0].type==="date"?5:V[0].type==="select"?6:V[0].type==="json"?7:V[0].type==="file"?8:V[0].type==="relation"?9:V[0].type==="user"?10:-1}~(f=P(n))&&(c=E[f]=O[f](n)),g=new Ne({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[j3,({uniqueId:V})=>({38:V}),({uniqueId:V})=>[0,V?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Kc(n),F=!n[0].toDelete&&Jc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),a=D(),u=_("div"),c&&c.c(),d=D(),h=_("div"),q(g.$$.fragment),v=D(),b=_("div"),I&&I.c(),y=D(),F&&F.c(),$=D(),C=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(C,"type","submit"),p(C,"class","hidden"),p(C,"tabindex","-1"),p(e,"class","field-form")},m(V,X){w(V,e,X),m(e,t),m(t,i),H(s,i,null),m(t,l),m(t,o),H(r,o,null),m(t,a),m(t,u),~f&&E[f].m(u,null),m(t,d),m(t,h),H(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),F&&F.m(t,null),m(e,$),m(e,C),S=!0,T||(M=J(e,"submit",Yt(n[31])),T=!0)},p(V,X){const te={};X[0]&1&&(te.class="form-field required "+(V[0].id?"disabled":"")),X[0]&2&&(te.name="schema."+V[1]+".type"),X[0]&1|X[1]&384&&(te.$$scope={dirty:X,ctx:V}),s.$set(te);const Z={};X[0]&33&&(Z.class=`
form-field
required
`+(V[5]?"":"invalid")+`
`+(V[0].id&&V[0].system?"disabled":"")+`
`),X[0]&2&&(Z.name="schema."+V[1]+".name"),X[0]&33|X[1]&384&&(Z.$$scope={dirty:X,ctx:V}),r.$set(Z);let ee=f;f=P(V),f===ee?~f&&E[f].p(V,X):(c&&(Ae(),L(E[ee],1,1,()=>{E[ee]=null}),Pe()),~f?(c=E[f],c?c.p(V,X):(c=E[f]=O[f](V),c.c()),A(c,1),c.m(u,null)):c=null);const U={};X[0]&1|X[1]&384&&(U.$$scope={dirty:X,ctx:V}),g.$set(U),V[0].type!=="file"?I?(I.p(V,X),X[0]&1&&A(I,1)):(I=Kc(V),I.c(),A(I,1),I.m(b,null)):I&&(Ae(),L(I,1,1,()=>{I=null}),Pe()),V[0].toDelete?F&&(Ae(),L(F,1,1,()=>{F=null}),Pe()):F?(F.p(V,X),X[0]&1&&A(F,1)):(F=Jc(V),F.c(),A(F,1),F.m(t,null))},i(V){S||(A(s.$$.fragment,V),A(r.$$.fragment,V),A(c),A(g.$$.fragment,V),A(I),A(F),S=!0)},o(V){L(s.$$.fragment,V),L(r.$$.fragment,V),L(c),L(g.$$.fragment,V),L(I),L(F),S=!1},d(V){V&&k(e),j(s),j(r),~f&&E[f].d(),j(g),I&&I.d(),F&&F.d(),T=!1,M()}}}function Gc(n){let e,t,i,s,l=n[0].system&&Xc(),o=!n[0].id&&Qc(n),r=n[0].required&&xc(),a=n[0].unique&&ed();return{c(){e=_("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Xc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=Qc(u),o.c(),o.m(e,i)),u[0].required?r||(r=xc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ed(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Xc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Qc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ne(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ne(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function xc(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 ed(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function td(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function nd(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",ni(n[15])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function B3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&Gc(n),$=n[7]&&!n[0].system&&td(),C=n[0].toDelete&&nd(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=D(),o=_("strong"),a=N(r),f=D(),y&&y.c(),c=D(),d=_("div"),h=D(),$&&$.c(),g=D(),C&&C.c(),v=Ue(),p(i,"class",s=lu(B.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ne(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(S,f,T),y&&y.m(S,T),w(S,c,T),w(S,d,T),w(S,h,T),$&&$.m(S,T),w(S,g,T),C&&C.m(S,T),w(S,v,T),b=!0},p(S,T){(!b||T[0]&1&&s!==(s=lu(B.getFieldTypeIcon(S[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||T[0]&1)&&r!==(r=(S[0].name||"-")+"")&&ue(a,r),(!b||T[0]&1&&u!==(u=S[0].name))&&p(o,"title",u),(!b||T[0]&1)&&ne(o,"txt-strikethrough",S[0].toDelete),S[0].toDelete?y&&(y.d(1),y=null):y?y.p(S,T):(y=Gc(S),y.c(),y.m(c.parentNode,c)),S[7]&&!S[0].system?$?T[0]&129&&A($,1):($=td(),$.c(),A($,1),$.m(g.parentNode,g)):$&&(Ae(),L($,1,1,()=>{$=null}),Pe()),S[0].toDelete?C?C.p(S,T):(C=nd(S),C.c(),C.m(v.parentNode,v)):C&&(C.d(1),C=null)},i(S){b||(A($),b=!0)},o(S){L($),b=!1},d(S){S&&k(e),S&&k(f),y&&y.d(S),S&&k(c),S&&k(d),S&&k(h),$&&$.d(S),S&&k(g),C&&C.d(S),S&&k(v)}}}function U3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0]
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,C=D(),S=_("hr"),T=D(),M=_("p"),M.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=D(),E=_("div"),E.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=D(),I=_("hr"),F=D(),V=_("p"),V.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p($,"class","inline-flex flex-gap-5"),p(S,"class","m-t-10 m-b-5"),p(M,"class","m-b-0"),p(E,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(U,Y){w(U,e,Y),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let G=0;G<ee.length;G+=1)ee[G].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,y),m(i,$),m(i,C),m(i,S),m(i,T),m(i,M),m(i,O),m(i,E),m(i,P),m(i,I),m(i,F),m(i,V),te=!0},p(U,Y){if(Y&1){Z=U[0].schema;let G;for(G=0;G<Z.length;G+=1){const de=od(U,Z,G);ee[G]?ee[G].p(de,Y):(ee[G]=ad(de),ee[G].c(),ee[G].m(o,null))}for(;G<ee.length;G+=1)ee[G].d(1);ee.length=Z.length}},i(U){te||(U&&Tt(()=>{X||(X=nt(e,on,{duration:150},!0)),X.run(1)}),te=!0)},o(U){U&&(X||(X=nt(e,on,{duration:150},!1)),X.run(0)),te=!1},d(U){U&&k(e),nn(ee,U),U&&X&&X.end()}}}function G3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=N(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function X3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=N(t),s=N(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function ad(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?X3:G3}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Q3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r<l.length;r+=1){let a=ld(n,l,r),u=o(a);t.set(u,e[r]=ud(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Ue()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&131163&&(l=Object.entries(r[6]),Ae(),e=ct(e,a,o,1,r,l,t,i.parentNode,Ut,ud,i,ld),Pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)L(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function x3(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:se,i:se,o:se,d(t){t&&k(e)}}}function eC(n){let e,t,i;function s(){return n[9](n[13])}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,o){w(l,e,o),t||(i=[We(yt.call(null,e,"Lock and set to Admins only")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ye(i)}}}function tC(n){let e,t,i;function s(){return n[8](n[13])}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,o){w(l,e,o),t||(i=[We(yt.call(null,e,"Unlock and set custom rule")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ye(i)}}}function nC(n){let e;return{c(){e=N("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function iC(n){let e;return{c(){e=N("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sC(n){let e,t=n[14]+"",i,s,l=Ii(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function $(E){n[11](E,n[13])}var C=n[4];function S(E){let P={id:E[17],baseCollection:E[0],disabled:Ii(E[0][E[13]])};return E[0][E[13]]!==void 0&&(P.value=E[0][E[13]]),{props:P}}C&&(u=new C(S(n)),b(),me.push(()=>Re(u,"value",$)));function T(E,P){return P&1&&(g=null),g==null&&(g=!!Ii(E[0][E[13]])),g?iC:nC}let M=T(n,-1),O=M(n);return{c(){e=_("label"),i=N(t),s=N(" - "),o=N(l),a=D(),u&&q(u.$$.fragment),d=D(),h=_("div"),O.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(E,P){w(E,e,P),m(e,i),m(e,s),m(e,o),w(E,a,P),u&&H(u,E,P),w(E,d,P),w(E,h,P),O.m(h,null),v=!0},p(E,P){n=E,(!v||P&1)&&l!==(l=Ii(n[0][n[13]])?"Admins only":"Custom rule")&&ue(
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
</a>.`,s=D(),l=_("span"),r=N(o),a=D(),b&&b.c(),u=D(),c.c(),d=Ue(),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(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(S,u,T),$[f].m(S,T),w(S,d,T),h=!0,g||(v=J(l,"click",n[7]),g=!0)},p(S,[T]){(!h||T&4)&&o!==(o=S[2]?"Hide available fields":"Show available fields")&&ue(r,o),S[2]?b?(b.p(S,T),T&4&&A(b,1)):(b=rd(S),b.c(),A(b,1),b.m(e,null)):b&&(Ae(),L(b,1,1,()=>{b=null}),Pe());let M=f;f=C(S),f===M?$[f].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),c=$[f],c?c.p(S,T):(c=$[f]=y[f](S),c.c()),A(c,1),c.m(d.parentNode,d))},i(S){h||(A(b),A(c),h=!0)},o(S){L(b),L(c),h=!1},d(S){S&&k(e),b&&b.d(),S&&k(u),$[f].d(S),S&&k(d),g=!1,v()}}}function Ii(n){return n===null}function oC(n,e,t){let{collection:i=new dn}=e,s={},l=!1,o={},r,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,r=(await Pi(()=>import("./FilterAutocompleteInput.37739e76.js"),["FilterAutocompleteInput.37739e76.js","index.a9121ab1.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Nn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await Zn(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){me[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class rC extends Ee{constructor(e){super(),Oe(this,e,oC,lC,De,{collection:0})}}function fd(n,e,t){const i=n.slice();return i[14]=e[t],i}function cd(n,e,t){const i=n.slice();return i[14]=e[t],i}function dd(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 pd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed collection
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(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,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function hd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed field
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(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,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function md(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=N("Removed field "),i=_("span"),l=N(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function aC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&dd(),g=n[5]&&pd(n),v=n[4],b=[];for(let C=0;C<v.length;C+=1)b[C]=hd(cd(n,v,C));let y=n[3],$=[];for(let C=0;C<y.length;C+=1)$[C]=md(fd(n,y,C));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),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!`,o=D(),h&&h.c(),r=D(),a=_("h6"),a.textContent="Changes:",u=D(),f=_("ul"),g&&g.c(),c=D();for(let C=0;C<b.length;C+=1)b[C].c();d=D();for(let C=0;C<$.length;C+=1)$[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,S){w(C,e,S),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),w(C,r,S),w(C,a,S),w(C,u,S),w(C,f,S),g&&g.m(f,null),m(f,c);for(let T=0;T<b.length;T+=1)b[T].m(f,null);m(f,d);for(let T=0;T<$.length;T+=1)$[T].m(f,null)},p(C,S){if(C[3].length?h||(h=dd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),C[5]?g?g.p(C,S):(g=pd(C),g.c(),g.m(f,c)):g&&(g.d(1),g=null),S&16){v=C[4];let T;for(T=0;T<v.length;T+=1){const M=cd(C,v,T);b[T]?b[T].p(M,S):(b[T]=hd(M),b[T].c(),b[T].m(f,d))}for(;T<b.length;T+=1)b[T].d(1);b.length=v.length}if(S&8){y=C[3];let T;for(T=0;T<y.length;T+=1){const M=fd(C,y,T);$[T]?$[T].p(M,S):($[T]=md(M),$[T].c(),$[T].m(f,null))}for(;T<$.length;T+=1)$[T].d(1);$.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(r),C&&k(a),C&&k(u),C&&k(f),g&&g.d(),nn(b,C),nn($,C)}}}function uC(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function fC(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),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(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[J(e,"click",n[8]),J(i,"click",n[9])],s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ye(l)}}}function cC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[fC],header:[uC],default:[aC]},$$scope:{ctx:n}};return e=new ui({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function dC(n,e,t){let i,s,l;const o=Qt();let r,a;async function u(y){t(1,a=y),await Zn(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){me[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){xe.call(this,n,y)}function b(y){xe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class pC extends Ee{constructor(e){super(),Oe(this,e,dC,cC,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function gd(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new rC({props:o}),me.push(()=>Re(t,"collection",l)),{c(){e=_("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),j(t)}}}function hC(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new Z3({props:a}),me.push(()=>Re(i,"collection",r));let u=n[9]===wl&&gd(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),l=D(),u&&u.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===rs),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),H(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),(!o||c[0]&512)&&ne(t,"active",f[9]===rs),f[9]===wl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=gd(f),u.c(),A(u,1),u.m(e,null)):u&&(Ae(),L(u,1,1,()=>{u=null}),Pe())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){L(i.$$.fragment,f),L(u),o=!1},d(f){f&&k(e),j(i),u&&u.d()}}}function _d(n){let e,t,i,s,l,o,r;return o=new Ti({props:{class:"dropdown dropdown-r
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[20]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function bd(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 gC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&bd();return{c(){e=_("label"),t=N("Name"),s=D(),l=_("input"),u=D(),h&&h.c(),f=Ue(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=J(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=bd(),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 vd(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=We(t=yt.call(null,e,n[12])),l=!0)},p(r,a){t&&Jn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=nt(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=nt(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function yd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function _C(n){var F,V,X,te,Z,ee;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!B.isEmpty((F=n[4])==null?void 0:F.schema),b,y,$,C,S=!B.isEmpty((V=n[4])==null?void 0:V.listRule)||!B.isEmpty((X=n[4])==null?void 0:X.viewRule)||!B.isEmpty((te=n[4])==null?void 0:te.createRule)||!B.isEmpty((Z=n[4])==null?void 0:Z.updateRule)||!B.isEmpty((ee=n[4])==null?void 0:ee.deleteRule),T,M,O,E=!n[2].isNew&&!n[2].system&&_d(n);r=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[gC,({uniqueId:U})=>({38:U}),({uniqueId:U})=>[0,U?128:0]]},$$scope:{ctx:n}}});let P=v&&vd(n),I=S&&yd();return{c(){e=_("h4"),i=N(t),s=D(),E&&E.c(),l=D(),o=_("form"),q(r.$$.fragment),a=D(),u=_("input"),f=D(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=D(),P&&P.c(),b=D(),y=_("button"),$=_("span"),$.textContent="API Rules",C=D(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===rs),p($,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ne(y,"active",n[9]===wl),p(c,"class","tabs-header stretched")},m(U,Y){w(U,e,Y),m(e,i),w(U,s,Y),E&&E.m(U,Y),w(U,l,Y),w(U,o,Y),H(r,o,null),m(o,a),m(o,u),w(U,f,Y),w(U,c,Y),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,y),m(y,$),m(y,C),I&&I.m(y,null),T=!0,M||(O=[J(o,"submit",Yt(n[22])),J(d,"click",n[23]),J(y,"click",n[24])],M=!0)},p(U,Y){var de,x,ve,_e,ge,K;(!T||Y[0]&4)&&t!==(t=U[2].isNew?"New collection":"Edit collection")&&ue(i,t),!U[2].isNew&&!U[2].system?E?(E.p(U,Y),Y[0]&4&&A(E,1)):(E=_d(U),E.c(),A(E,1),E.m(l.parentNode,l)):E&&(Ae(),L(E,1,1,()=>{E=null}),Pe());const G={};Y[0]&2048&&(G.class="form-field required m-b-0 "+(U[11]?"disabled":"")),Y[0]&2052|Y[1]&384&&(G.$$scope={dirty:Y,ctx:U}),r.$set(G),Y[0]&16&&(v=!B.isEmpty((de=U[4])==null?void 0:de.schema)),v?P?(P.p(U,Y),Y[0]&16&&A(P,1)):(P=vd(U),P.c(),A(P,1),P.m(d,null)):P&&(Ae(),L(P,1,1,()=>{P=null}),Pe()),(!T||Y[0]&512)&&ne(d,"active",U[9]===rs),Y[0]&16&&(S=!B.isEmpty((x=U[4])==null?void 0:x.listRule)||!B.isEmpty((ve=U[4])==null?void 0:ve.viewRule)||!B.isEmpty((_e=U[4])==null?void 0:_e.create
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),m(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:se,d(l){l&&k(e),i=!1,s()}}}function $C(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,$,C,S=n[3];const T=P=>P[14].id;for(let P=0;P<S.length;P+=1){let I=kd(n,S,P),F=T(I);h.set(F,d[P]=Sd(F,I))}let M=null;S.length||(M=wd(n));let O=!n[6]&&Cd(n),E={};return b=new nu({props:E}),n[13](b),{c(){e=_("aside"),t=_("header"),i=_("div"),s=_("div"),l=_("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=_("input"),a=D(),u=_("hr"),f=D(),c=_("div");for(let P=0;P<d.length;P+=1)d[P].c();M&&M.c(),g=D(),O&&O.c(),v=D(),q(b.$$.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(r,"type","text"),p(r,"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(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Me(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let F=0;F<d.length;F+=1)d[F].m(c,null);M&&M.m(c,null),m(e,g),O&&O.m(e,null),w(P,v,I),H(b,P,I),y=!0,$||(C=[J(l,"click",n[9]),J(r,"input",n[10])],$=!0)},p(P,[I]){(!y||I&16)&&ne(l,"hidden",!P[4]),I&1&&r.value!==P[0]&&Me(r,P[0]),(!y||I&16)&&ne(i,"active",P[4]),I&170&&(S=P[3],d=ct(d,I,T,1,P,S,h,c,pn,Sd,null,kd),!S.length&&M?M.p(P,I):S.length?M&&(M.d(1),M=null):(M=wd(P),M.c(),M.m(c,null))),P[6]?O&&(O.d(1),O=null):O?O.p(P,I):(O=Cd(P),O.c(),O.m(e,null));const F={};b.$set(F)},i(P){y||(A(b.$$.fragment,P),y=!0)},o(P){L(b.$$.fragment,P),y=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();M&&M.d(),O&&O.d(),P&&k(v),n[13](null),j(b,P),$=!1,Ye(C)}}}function SC(n,e,t){let i,s,l,o,r,a;rt(n,hi,y=>t(5,o=y)),rt(n,Ps,y=>t(8,r=y)),rt(n,us,y=>t(6,a=y));let u,f="";function c(y){tn(hi,o=y,o)}const d=()=>t(0,f="");function h(){f=this.value,t(0,f)}const g=y=>c(y),v=()=>u==null?void 0:u.show();function b(y){me[y?"unshift":"push"](()=>{u=y,t(2,u)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=f!==""),n.$$.dirty&259&&t(3,l=r.filter(y=>y.name!="profiles"&&(y.id==f||y.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,u,l,s,o,a,c,r,d,h,g,v,b]}class CC extends Ee{constructor(e){super(),Oe(this,e,SC,$C,De,{})}}function MC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge,K,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut;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=D(),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=D(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=N(` - is one of:
`),u=_("br"),f=D(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=D(),v=_("span"),v.textContent="Equal",b=D(),y=_("li"),$=_("code"),$.textContent="!=",C=D(),S=_("span"),S.textContent="NOT equal",T=D(),M=_("li"),O=_("code"),O.textContent=">",E=D(),P=_("span"),P.textContent="Greater than",I=D(),F=_("li"),V=_("code"),V.textContent=">=",X=D(),te=_("span"),te.textContent="Greater than or equal",Z=D(),ee=_("li"),U=_("code"),U.textContent="<",Y=D(),G=_("span"),G.textContent="Less than or equal",de=D(),x=_("li"),ve=_("code"),ve.textContent="<=",_e=D(),ge=_("span"),ge.textContent="Less than or equal",K=D(),ye=_("li"),oe=_("code"),oe.textContent="~",W=D(),ce=_("span"),ce.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,ae=D(),Se=_("li"),Q=_("code"),Q.textContent="!~",$e=D(),Be=_("span"),Be.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
2022-09-29 02:55:18 +08:00
wildcard match)`,Xe=D(),ut=_("p"),ut.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p($,"class","filter-op svelte-1w7s5nw"),p(S,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(V,"class","filter-op svelte-1w7s5nw"),p(te,"class","txt-hint"),p(U,"class","filter-op svelte-1w7s5nw"),p(G,"class","txt-hint"),p(ve,"class","filter-op svelte-1w7s5nw"),p(ge,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint"),p(Q,"class","filter-op svelte-1w7s5nw"),p(Be,"class","txt-hint")},m(it,Je){w(it,e,Je),w(it,t,Je),w(it,i,Je),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,$),m(y,C),m(y,S),m(c,T),m(c,M),m(M,O),m(M,E),m(M,P),m(c,I),m(c,F),m(F,V),m(F,X),m(F,te),m(c,Z),m(c,ee),m(ee,U),m(ee,Y),m(ee,G),m(c,de),m(c,x),m(x,ve),m(x,_e),m(x,ge),m(c,K),m(c,ye),m(ye,oe),m(ye,W),m(ye,ce),m(c,ae),m(c,Se),m(Se,Q),m(Se,$e),m(Se,Be),w(it,Xe,Je),w(it,ut,Je)},p:se,i:se,o:se,d(it){it&&k(e),it&&k(t),it&&k(i),it&&k(Xe),it&&k(ut)}}}class TC extends Ee{constructor(e){super(),Oe(this,e,null,MC,De,{})}}function Md(n,e,t){const i=n.slice();return i[5]=e[t],i}function Td(n,e,t){const i=n.slice();return i[5]=e[t],i}function Dd(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=N(s),o=D(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=J(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ne(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function Od(n,e){let t,i,s,l;return i=new bn({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),(!l||r&3)&&ne(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function DC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=Td(n,f,g),b=c(v);s.set(b,i[g]=Dd(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=Md(n,d,g),b=h(v);a.set(b,r[g]=Od(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=D(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(g,v){w(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=ct(i,v,c,1,g,f,s,t,pn,Dd,null,Td)),v&3&&(d=g[1],Ae(),r=ct(r,v,h,1,g,d,a,o,Ut,Od,null,Md),Pe())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)L(r[v]);u=!1},d(g){g&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const Ed="pb_sdk_preference";function OC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(Ed)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(Ed,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class js extends Ee{constructor(e){super(),Oe(this,e,OC,DC,De,{js:2,dart:3})}}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ld(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 Id(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c()
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(gi=n[0])==null?void 0:gi.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
2022-09-29 02:55:18 +08:00
const records = await client.records.getFullList('${(Il=n[0])==null?void 0:Il.name}', 200 /* batch size */, {
sort: '-created',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(ms=n[0])==null?void 0:ms.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
2022-09-29 02:55:18 +08:00
final records = await client.records.getFullList('${(Nl=n[0])==null?void 0:Nl.name}', batch: 200, sort: '-created');
`}}),Q=new bn({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),Ve=new bn({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),tt=new TC({}),_t=new bn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let gt=n[4];const un=je=>je[6].code;for(let je=0;je<gt.length;je+=1){let Qe=Pd(n,gt,je),Gt=un(Qe);Le.set(Gt,re[je]=Id(Gt,Qe))}let jt=n[4];const Di=je=>je[6].code;for(let je=0;je<jt.length;je+=1){let Qe=Ad(n,jt,je),Gt=Di(Qe);fe.set(Gt,ke[je]=Nd(Gt,Qe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),Ie&&Ie.c(),d=D(),h=_("div"),g=_("p"),v=N("Fetch a paginated "),b=_("strong"),$=N(y),C=N(" records list."),S=D(),T=_("div"),T.textContent="Client SDKs example",M=D(),q(O.$$.fragment),E=D(),P=_("div"),P.textContent="Query parameters",I=D(),F=_("table"),V=_("thead"),V.innerHTML=`<tr><th>Param</th>
<th>Type</th>
2022-09-29 02:55:18 +08:00
<th width="60%">Description</th></tr>`,X=D(),te=_("tbody"),Z=_("tr"),Z.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,ee=D(),U=_("tr"),U.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,Y=D(),G=_("tr"),de=_("td"),de.textContent="sort",x=D(),ve=_("td"),ve.innerHTML='<span class="label">String</span>',_e=D(),ge=_("td"),K=N("Specify the records order attribute(s). "),ye=_("br"),oe=N(`
Add `),W=_("code"),W.textContent="-",ce=N(" / "),ae=_("code"),ae.textContent="+",Se=N(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),q(Q.$$.fragment),$e=D(),Be=_("tr"),Xe=_("td"),Xe.textContent="filter",ut=D(),it=_("td"),it.innerHTML='<span class="label">String</span>',Je=D(),et=_("td"),Te=N(`Filter the returned records. Ex.:
`),q(Ve.$$.fragment),Ze=D(),q(tt.$$.fragment),dt=D(),be=_("tr"),Fe=_("td"),Fe.textContent="expand",pt=D(),Dt=_("td"),Dt.innerHTML='<span class="label">String</span>',ht=D(),st=_("td"),Lt=N(`Auto expand record relations. Ex.:
2022-09-29 02:55:18 +08:00
`),q(_t.$$.fragment),Ft=N(`
Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Ke=N(`
The expanded relations will be appended to each individual record under the
`),Ce=_("code"),Ce.textContent="@expand",ze=N(" property (eg. "),lt=_("code"),lt.textContent='"@expand": {"rel1": {...}, ...}',ot=N(`). Only the
relations that the user has permissions to `),Ht=_("strong"),Ht.textContent="view",Ct=N(" will be expanded."),ft=D(),xt=_("div"),xt.textContent="Responses",R=D(),z=_("div"),ie=_("div");for(let je=0;je<re.length;je+=1)re[je].c();le=D(),pe=_("div");for(let je=0;je<ke.length;je+=1)ke[je].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(T,"class","section-title"),p(P,"class","section-title"),p(F,"class","table-compact table-border m-b-lg"),p(xt,"class","section-title"),p(ie,"class","tabs-header compact left"),p(pe,"class","tabs-content"),p(z,"class","tabs")},m(je,Qe){w(je,e,Qe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ie&&Ie.m(e,null),w(je,d,Qe),w(je,h,Qe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),w(je,S,Qe),w(je,T,Qe),w(je,M,Qe),H(O,je,Qe),w(je,E,Qe),w(je,P,Qe),w(je,I,Qe),w(je,F,Qe),m(F,V),m(F,X),m(F,te),m(te,Z),m(te,ee),m(te,U),m(te,Y),m(te,G),m(G,de),m(G,x),m(G,ve),m(G,_e),m(G,ge),m(ge,K),m(ge,ye),m(ge,oe),m(ge,W),m(ge,ce),m(ge,ae),m(ge,Se),H(Q,ge,null),m(te,$e),m(te,Be),m(Be,Xe),m(Be,ut),m(Be,it),m(Be,Je),m(Be,et),m(et,Te),H(Ve,et,null),m(et,Ze),H(tt,et,null),m(te,dt),m(te,be),m(be,Fe),m(be,pt),m(be,Dt),m(be,ht),m(be,st),m(st,Lt),H(_t,st,null),m(st,Ft),m(st,Ot),m(st,Ke),m(st,Ce),m(st,ze),m(st,lt),m(st,ot),m(st,Ht),m(st,Ct),w(je,ft,Qe),w(je,xt,Qe),w(je,R,Qe),w(je,z,Qe),m(z,ie);for(let Gt=0;Gt<re.length;Gt+=1)re[Gt].m(ie,null);m(z,le),m(z,pe);for(let Gt=0;Gt<ke.length;Gt+=1)ke[Gt].m(pe,null);he=!0},p(je,[Qe]){var Fl,Rl,Hl,jl;(!he||Qe&1)&&a!==(a=je[0].name+"")&&ue(u,a),je[1]?Ie||(Ie=Ld(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!he||Qe&1)&&y!==(y=je[0].name+"")&&ue($,y);const Gt={};Qe&9&&(Gt.js=`
import PocketBase from 'pocketbase';
2022-09-29 02:55:18 +08:00
const client = new PocketBase('${je[3]}');
...
// fetch a paginated records list
2022-09-29 02:55:18 +08:00
const resultList = await client.records.getList('${(Fl=je[0])==null?void 0:Fl.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
2022-09-29 02:55:18 +08:00
const records = await client.records.getFullList('${(Rl=je[0])==null?void 0:Rl.name}', 200 /* batch size */, {
sort: '-created',
});
`),Qe&9&&(Gt.dart=`
import 'package:pocketbase/pocketbase.dart';
2022-09-29 02:55:18 +08:00
final client = PocketBase('${je[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
2022-09-29 02:55:18 +08:00
'${(Hl=je[0])==null?void 0:Hl.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
2022-09-29 02:55:18 +08:00
final records = await client.records.getFullList('${(jl=je[0])==null?void 0:jl.name}', batch: 200, sort: '-created');
`),O.$set(Gt),Qe&20&&(gt=je[4],re=ct(re,Qe,un,1,je,gt,Le,ie,pn,Id,null,Pd)),Qe&20&&(jt=je[4],Ae(),ke=ct(ke,Qe,Di,1,je,jt,fe,pe,Ut,Nd,null,Ad),Pe())},i(je){if(!he){A(O.$$.fragment,je),A(Q.$$.fragment,je),A(Ve.$$.fragment,je),A(tt.$$.fragment,je),A(_t.$$.fragment,je);for(let Qe=0;Qe<jt.length;Qe+=1)A(ke[Qe]);he=!0}},o(je){L(O.$$.fragment,je),L(Q.$$.fragment,je),L(Ve.$$.fragment,je),L(tt.$$.fragment,je),L(_t.$$.fragment,je);for(let Qe=0;Qe<ke.length;Qe+=1)L(ke[Qe]);he=!1},d(je){je&&k(e),Ie&&Ie.d(),je&&k(d),je&&k(h),je&&k(S),je&&k(T),je&&k(M),j(O,je),je&&k(E),je&&k(P),je&&k(I),je&&k(F),j(Q),j(Ve),j(tt),j(_t),je&&k(ft),je&&k(xt),je&&k(R),je&&k(z);for(let Qe=0;Qe<re.length;Qe+=1)re[Qe].d();for(let Qe=0;Qe<ke.length;Qe+=1)ke[Qe].d()}}}function AC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[B.dummyCollectionRecord(l),B.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class PC extends Ee{constructor(e){super(),Oe(this,e,AC,EC,De,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hd(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 jd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function qd(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&ne(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function LC(n){var Ot,Ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge,K,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut,it,Je,et,Te,Ve,Ze=[],tt=new Map,dt,be,Fe=[],pt=new Map,Dt,ht=n[1]&&Hd();E=new js({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
2022-09-29 02:55:18 +08:00
final record = await client.records.getOne('${(Ke=n[0])==null?void 0:Ke.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`}}),oe=new bn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let st=n[4];const Lt=Ce=>Ce[6].code;for(let Ce=0;Ce<st.length;Ce+=1){let ze=Rd(n,st,Ce),lt=Lt(ze);tt.set(lt,Ze[Ce]=jd(lt,ze))}let _t=n[4];const Ft=Ce=>Ce[6].code;for(let Ce=0;Ce<_t.length;Ce+=1){let ze=Fd(n,_t,Ce),lt=Ft(ze);pt.set(lt,Fe[Ce]=qd(lt,ze))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),ht&&ht.c(),h=D(),g=_("div"),v=_("p"),b=N("Fetch a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path Parameters",F=D(),V=_("table"),V.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>
2022-09-29 02:55:18 +08:00
<td>ID of the record to view.</td></tr></tbody>`,X=D(),te=_("div"),te.textContent="Query parameters",Z=D(),ee=_("table"),U=_("thead"),U.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Y=D(),G=_("tbody"),de=_("tr"),x=_("td"),x.textContent="expand",ve=D(),_e=_("td"),_e.innerHTML='<span class="label">String</span>',ge=D(),K=_("td"),ye=N(`Auto expand record relations. Ex.:
2022-09-29 02:55:18 +08:00
`),q(oe.$$.fragment),W=N(`
Supports up to 6-levels depth nested relations expansion. `),ce=_("br"),ae=N(`
The expanded relations will be appended to the record under the
`),Se=_("code"),Se.textContent="@expand",Q=N(" property (eg. "),$e=_("code"),$e.textContent='"@expand": {"rel1": {...}, ...}',Be=N(`). Only the
relations that the user has permissions to `),Xe=_("strong"),Xe.textContent="view",ut=N(" will be expanded."),it=D(),Je=_("div"),Je.textContent="Responses",et=D(),Te=_("div"),Ve=_("div");for(let Ce=0;Ce<Ze.length;Ce+=1)Ze[Ce].c();dt=D(),be=_("div");for(let Ce=0;Ce<Fe.length;Ce+=1)Fe[Ce].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(M,"class","section-title"),p(I,"class","section-title"),p(V,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Je,"class","section-title"),p(Ve,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(Te,"class","tabs")},m(Ce,ze){w(Ce,e,ze),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ht&&ht.m(e,null),w(Ce,h,ze),w(Ce,g,ze),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w(Ce,T,ze),w(Ce,M,ze),w(Ce,O,ze),H(E,Ce,ze),w(Ce,P,ze),w(Ce,I,ze),w(Ce,F,ze),w(Ce,V,ze),w(Ce,X,ze),w(Ce,te,ze),w(Ce,Z,ze),w(Ce,ee,ze),m(ee,U),m(ee,Y),m(ee,G),m(G,de),m(de,x),m(de,ve),m(de,_e),m(de,ge),m(de,K),m(K,ye),H(oe,K,null),m(K,W),m(K,ce),m(K,ae),m(K,Se),m(K,Q),m(K,$e),m(K,Be),m(K,Xe),m(K,ut),w(Ce,it,ze),w(Ce,Je,ze),w(Ce,et,ze),w(Ce,Te,ze),m(Te,Ve);for(let lt=0;lt<Ze.length;lt+=1)Ze[lt].m(Ve,null);m(Te,dt),m(Te,be);for(let lt=0;lt<Fe.length;lt+=1)Fe[lt].m(be,null);Dt=!0},p(Ce,[ze]){var ot,Ht;(!Dt||ze&1)&&a!==(a=Ce[0].name+"")&&ue(u,a),Ce[1]?ht||(ht=Hd(),ht.c(),ht.m(e,null)):ht&&(ht.d(1),ht=null),(!Dt||ze&1)&&$!==($=Ce[0].name+"")&&ue(C,$);const lt={};ze&9&&(lt.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${Ce[3]}');
...
const record = await client.records.getOne('${(ot=Ce[0])==null?void 0:ot.name}', 'RECORD_ID', {
expand: 'some_relation'
});
2022-09-29 02:55:18 +08:00
`),ze&9&&(lt.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${Ce[3]}');
...
final record = await client.records.getOne('${(Ht=Ce[0])==null?void 0:Ht.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`),E.$set(lt),ze&20&&(st=Ce[4],Ze=ct(Ze,ze,Lt,1,Ce,st,tt,Ve,pn,jd,null,Rd)),ze&20&&(_t=Ce[4],Ae(),Fe=ct(Fe,ze,Ft,1,Ce,_t,pt,be,Ut,qd,null,Fd),Pe())},i(Ce){if(!Dt){A(E.$$.fragment,Ce),A(oe.$$.fragment,Ce);for(let ze=0;ze<_t.length;ze+=1)A(Fe[ze]);Dt=!0}},o(Ce){L(E.$$.fragment,Ce),L(oe.$$.fragment,Ce);for(let ze=0;ze<Fe.length;ze+=1)L(Fe[ze]);Dt=!1},d(Ce){Ce&&k(e),ht&&ht.d(),Ce&&k(h),Ce&&k(g),Ce&&k(T),Ce&&k(M),Ce&&k(O),j(E,Ce),Ce&&k(P),Ce&&k(I),Ce&&k(F),Ce&&k(V),Ce&&k(X),Ce&&k(te),Ce&&k(Z),Ce&&k(ee),j(oe),Ce&&k(it),Ce&&k(Je),Ce&&k(et),Ce&&k(Te);for(let ze=0;ze<Ze.length;ze+=1)Ze[ze].d();for(let ze=0;ze<Fe.length;ze+=1)Fe[ze].d()}}}function IC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class NC extends Ee{constructor(e){super(),Oe(this,e,IC,LC,De,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[6]=e[t],i}function zd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Bd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ud(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 FC(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 RC(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 HC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function jC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function qC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function VC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function zC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function BC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function UC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function WC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Wd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?RC:FC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return WC;if(O[11].type==="number")return UC;if(O[11].type==="json")return BC;if(O[11].type==="email")return zC;if(O[11].type==="url")return VC;if(O[11].type==="file")return qC;if(O[11].type==="relation")return jC;if(O[11].type==="user")return HC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function Yd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Kd(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),(!l||r&6)&&ne(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function YC(n){var ie,re,Le;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x=[],ve=new Map,_e,ge,K,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut,it,Je,et,Te,Ve,Ze,tt,dt,be,Fe,pt,Dt,ht,st,Lt,_t=[],Ft=new Map,Ot,Ke,Ce=[],ze=new Map,lt,ot=n[4]&&Ud();F=new js({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.create('${(ie=n[0])==null?void 0:ie.name}', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(re=n[0])==null?void 0:re.name}', body: body);
`}});let Ht=(Le=n[0])==null?void 0:Le.schema;const Ct=le=>le[11].name;for(let le=0;le<Ht.length;le+=1){let pe=Bd(n,Ht,le),ke=Ct(pe);ve.set(ke,x[le]=Wd(ke,pe))}it=new bn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let ft=n[2];const xt=le=>le[6].code;for(let le=0;le<ft.length;le+=1){let pe=zd(n,ft,le),ke=xt(pe);Ft.set(ke,_t[le]=Yd(ke,pe))}let R=n[2];const z=le=>le[6].code;for(let le=0;le<R.length;le+=1){let pe=Vd(n,R,le),ke=z(pe);ze.set(ke,Ce[le]=Kd(ke,pe))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),ot&&ot.c(),d=D(),h=_("div"),g=_("p"),v=N("Create a new "),b=_("strong"),$=N(y),C=N(" record."),S=D(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
2022-09-29 02:55:18 +08:00
<code>multipart/form-data</code>.`,M=D(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=D(),P=_("div"),P.textContent="Client SDKs example",I=D(),q(F.$$.fragment),V=D(),X=_("div"),X.textContent="Body Parameters",te=D(),Z=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,U=D(),Y=_("tbody"),G=_("tr"),G.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,de=D();for(let le=0;le<x.length;le+=1)x[le].c();_e=D(),ge=_("div"),ge.textContent="Query parameters",K=D(),ye=_("table"),oe=_("thead"),oe.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,W=D(),ce=_("tbody"),ae=_("tr"),Se=_("td"),Se.textContent="expand",Q=D(),$e=_("td"),$e.innerHTML='<span class="label">String</span>',Be=D(),Xe=_("td"),ut=N(`Auto expand relations when returning the created record. Ex.:
2022-09-29 02:55:18 +08:00
`),q(it.$$.fragment),Je=N(`
Supports up to 6-levels depth nested relations expansion. `),et=_("br"),Te=N(`
The expanded relations will be appended to the record under the
`),Ve=_("code"),Ve.textContent="@expand",Ze=N(" property (eg. "),tt=_("code"),tt.textContent='"@expand": {"rel1": {...}, ...}',dt=N(`). Only the
relations that the user has permissions to `),be=_("strong"),be.textContent="view",Fe=N(" will be expanded."),pt=D(),Dt=_("div"),Dt.textContent="Responses",ht=D(),st=_("div"),Lt=_("div");for(let le=0;le<_t.length;le+=1)_t[le].c();Ot=D(),Ke=_("div");for(let le=0;le<Ce.length;le+=1)Ce[le].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(X,"class","section-title"),p(Z,"class","table-compact table-border m-b-lg"),p(ge,"class","section-title"),p(ye,"class","table-compact table-border m-b-lg"),p(Dt,"class","section-title"),p(Lt,"class","tabs-header compact left"),p(Ke,"class","tabs-content"),p(st,"class","tabs")},m(le,pe){w(le,e,pe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),ot&&ot.m(e,null),w(le,d,pe),w(le,h,pe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),m(h,S),m(h,T),m(h,M),m(h,O),w(le,E,pe),w(le,P,pe),w(le,I,pe),H(F,le,pe),w(le,V,pe),w(le,X,pe),w(le,te,pe),w(le,Z,pe),m(Z,ee),m(Z,U),m(Z,Y),m(Y,G),m(Y,de);for(let ke=0;ke<x.length;ke+=1)x[ke].m(Y,null);w(le,_e,pe),w(le,ge,pe),w(le,K,pe),w(le,ye,pe),m(ye,oe),m(ye,W),m(ye,ce),m(ce,ae),m(ae,Se),m(ae,Q),m(ae,$e),m(ae,Be),m(ae,Xe),m(Xe,ut),H(it,Xe,null),m(Xe,Je),m(Xe,et),m(Xe,Te),m(Xe,Ve),m(Xe,Ze),m(Xe,tt),m(Xe,dt),m(Xe,be),m(Xe,Fe),w(le,pt,pe),w(le,Dt,pe),w(le,ht,pe),w(le,st,pe),m(st,Lt);for(let ke=0;ke<_t.length;ke+=1)_t[ke].m(Lt,null);m(st,Ot),m(st,Ke);for(let ke=0;ke<Ce.length;ke+=1)Ce[ke].m(Ke,null);lt=!0},p(le,[pe]){var fe,he,Ie;(!lt||pe&1)&&a!==(a=le[0].name+"")&&ue(u,a),le[4]?ot||(ot=Ud(),ot.c(),ot.m(e,null)):ot&&(ot.d(1),ot=null),(!lt||pe&1)&&y!==(y=le[0].name+"")&&ue($,y);const ke={};pe&9&&(ke.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${le[3]}');
...
const data = { ... };
const record = await client.records.create('${(fe=le[0])==null?void 0:fe.name}', data);
`),pe&9&&(ke.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${le[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(he=le[0])==null?void 0:he.name}', body: body);
`),F.$set(ke),pe&1&&(Ht=(Ie=le[0])==null?void 0:Ie.schema,x=ct(x,pe,Ct,1,le,Ht,ve,Y,pn,Wd,null,Bd)),pe&6&&(ft=le[2],_t=ct(_t,pe,xt,1,le,ft,Ft,Lt,pn,Yd,null,zd)),pe&6&&(R=le[2],Ae(),Ce=ct(Ce,pe,z,1,le,R,ze,Ke,Ut,Kd,null,Vd),Pe())},i(le){if(!lt){A(F.$$.fragment,le),A(it.$$.fragment,le);for(let pe=0;pe<R.length;pe+=1)A(Ce[pe]);lt=!0}},o(le){L(F.$$.fragment,le),L(it.$$.fragment,le);for(let pe=0;pe<Ce.length;pe+=1)L(Ce[pe]);lt=!1},d(le){le&&k(e),ot&&ot.d(),le&&k(d),le&&k(h),le&&k(E),le&&k(P),le&&k(I),j(F,le),le&&k(V),le&&k(X),le&&k(te),le&&k(Z);for(let pe=0;pe<x.length;pe+=1)x[pe].d();le&&k(_e),le&&k(ge),le&&k(K),le&&k(ye),j(it),le&&k(pt),le&&k(Dt),le&&k(ht),le&&k(st);for(let pe=0;pe<_t.length;pe+=1)_t[pe].d();for(let pe=0;pe<Ce.length;pe+=1)Ce[pe].d()}}}function KC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}])},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class JC extends Ee{constructor(e){super(),Oe(this,e,KC,YC,De,{collection:0})}}function Jd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Xd(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 ZC(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 GC(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 XC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function QC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function xC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function e4(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function t4(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function n4(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function i4(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function s4(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Qd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?GC:ZC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return s4;if(O[11].type==="number")return i4;if(O[11].type==="json")return n4;if(O[11].type==="email")return t4;if(O[11].type==="url")return e4;if(O[11].type==="file")return xC;if(O[11].type==="relation")return QC;if(O[11].type==="user")return XC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function xd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function ep(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),(!l||r&6)&&ne(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function l4(n){var le,pe,ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge=[],K=new Map,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut,it,Je,et,Te,Ve,Ze,tt,dt,be,Fe,pt,Dt,ht,st,Lt,_t,Ft,Ot,Ke=[],Ce=new Map,ze,lt,ot=[],Ht=new Map,Ct,ft=n[4]&&Xd();V=new js({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.update('${(le=n[0])==null?void 0:le.name}', 'RECORD_ID', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(pe=n[0])==null?void 0:pe.name}', 'RECORD_ID', body: body);
`}});let xt=(ke=n[0])==null?void 0:ke.schema;const R=fe=>fe[11].name;for(let fe=0;fe<xt.length;fe+=1){let he=Gd(n,xt,fe),Ie=R(he);K.set(Ie,ge[fe]=Qd(Ie,he))}Te=new bn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let z=n[2];const ie=fe=>fe[6].code;for(let fe=0;fe<z.length;fe+=1){let he=Zd(n,z,fe),Ie=ie(he);Ce.set(Ie,Ke[fe]=xd(Ie,he))}let re=n[2];const Le=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=Jd(n,re,fe),Ie=Le(he);Ht.set(Ie,ot[fe]=ep(Ie,he))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),ft&&ft.c(),h=D(),g=_("div"),v=_("p"),b=N("Update a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
2022-09-29 02:55:18 +08:00
<code>multipart/form-data</code>.`,O=D(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=D(),I=_("div"),I.textContent="Client SDKs example",F=D(),q(V.$$.fragment),X=D(),te=_("div"),te.textContent="Path parameters",Z=D(),ee=_("table"),ee.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>`,U=D(),Y=_("div"),Y.textContent="Body Parameters",G=D(),de=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,ve=D(),_e=_("tbody");for(let fe=0;fe<ge.length;fe+=1)ge[fe].c();ye=D(),oe=_("div"),oe.textContent="Query parameters",W=D(),ce=_("table"),ae=_("thead"),ae.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Se=D(),Q=_("tbody"),$e=_("tr"),Be=_("td"),Be.textContent="expand",Xe=D(),ut=_("td"),ut.innerHTML='<span class="label">String</span>',it=D(),Je=_("td"),et=N(`Auto expand relations when returning the updated record. Ex.:
2022-09-29 02:55:18 +08:00
`),q(Te.$$.fragment),Ve=N(`
Supports up to 6-levels depth nested relations expansion. `),Ze=_("br"),tt=N(`
The expanded relations will be appended to the record under the
`),dt=_("code"),dt.textContent="@expand",be=N(" property (eg. "),Fe=_("code"),Fe.textContent='"@expand": {"rel1": {...}, ...}',pt=N(`). Only the
relations that the user has permissions to `),Dt=_("strong"),Dt.textContent="view",ht=N(" will be expanded."),st=D(),Lt=_("div"),Lt.textContent="Responses",_t=D(),Ft=_("div"),Ot=_("div");for(let fe=0;fe<Ke.length;fe+=1)Ke[fe].c();ze=D(),lt=_("div");for(let fe=0;fe<ot.length;fe+=1)ot[fe].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(I,"class","section-title"),p(te,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Y,"class","section-title"),p(de,"class","table-compact table-border m-b-lg"),p(oe,"class","section-title"),p(ce,"class","table-compact table-border m-b-lg"),p(Lt,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(lt,"class","tabs-content"),p(Ft,"class","tabs")},m(fe,he){w(fe,e,he),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ft&&ft.m(e,null),w(fe,h,he),w(fe,g,he),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),m(g,T),m(g,M),m(g,O),m(g,E),w(fe,P,he),w(fe,I,he),w(fe,F,he),H(V,fe,he),w(fe,X,he),w(fe,te,he),w(fe,Z,he),w(fe,ee,he),w(fe,U,he),w(fe,Y,he),w(fe,G,he),w(fe,de,he),m(de,x),m(de,ve),m(de,_e);for(let Ie=0;Ie<ge.length;Ie+=1)ge[Ie].m(_e,null);w(fe,ye,he),w(fe,oe,he),w(fe,W,he),w(fe,ce,he),m(ce,ae),m(ce,Se),m(ce,Q),m(Q,$e),m($e,Be),m($e,Xe),m($e,ut),m($e,it),m($e,Je),m(Je,et),H(Te,Je,null),m(Je,Ve),m(Je,Ze),m(Je,tt),m(Je,dt),m(Je,be),m(Je,Fe),m(Je,pt),m(Je,Dt),m(Je,ht),w(fe,st,he),w(fe,Lt,he),w(fe,_t,he),w(fe,Ft,he),m(Ft,Ot);for(let Ie=0;Ie<Ke.length;Ie+=1)Ke[Ie].m(Ot,null);m(Ft,ze),m(Ft,lt);for(let Ie=0;Ie<ot.length;Ie+=1)ot[Ie].m(lt,null);Ct=!0},p(fe,[he]){var gt,un,jt;(!Ct||he&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?ft||(ft=Xd(),ft.c(),ft.m(e,null)):ft&&(ft.d(1),ft=null),(!Ct||he&1)&&$!==($=fe[0].name+"")&&ue(C,$);const Ie={};he&9&&(Ie.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${fe[3]}');
...
const data = { ... };
const record = await client.records.update('${(gt=fe[0])==null?void 0:gt.name}', 'RECORD_ID', data);
`),he&9&&(Ie.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${fe[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(un=fe[0])==null?void 0:un.name}', 'RECORD_ID', body: body);
`),V.$set(Ie),he&1&&(xt=(jt=fe[0])==null?void 0:jt.schema,ge=ct(ge,he,R,1,fe,xt,K,_e,pn,Qd,null,Gd)),he&6&&(z=fe[2],Ke=ct(Ke,he,ie,1,fe,z,Ce,Ot,pn,xd,null,Zd)),he&6&&(re=fe[2],Ae(),ot=ct(ot,he,Le,1,fe,re,Ht,lt,Ut,ep,null,Jd),Pe())},i(fe){if(!Ct){A(V.$$.fragment,fe),A(Te.$$.fragment,fe);for(let he=0;he<re.length;he+=1)A(ot[he]);Ct=!0}},o(fe){L(V.$$.fragment,fe),L(Te.$$.fragment,fe);for(let he=0;he<ot.length;he+=1)L(ot[he]);Ct=!1},d(fe){fe&&k(e),ft&&ft.d(),fe&&k(h),fe&&k(g),fe&&k(P),fe&&k(I),fe&&k(F),j(V,fe),fe&&k(X),fe&&k(te),fe&&k(Z),fe&&k(ee),fe&&k(U),fe&&k(Y),fe&&k(G),fe&&k(de);for(let he=0;he<ge.length;he+=1)ge[he].d();fe&&k(ye),fe&&k(oe),fe&&k(W),fe&&k(ce),j(Te),fe&&k(st),fe&&k(Lt),fe&&k(_t),fe&&k(Ft);for(let he=0;he<Ke.length;he+=1)Ke[he].d();for(let he=0;he<ot.length;he+=1)ot[he].d()}}}function o4(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.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": {}
}
`}])},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class r4 extends Ee{constructor(e){super(),Oe(this,e,o4,l4,De,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[6]=e[t],i}function np(n,e,t){const i=n.slice();return i[6]=e[t],i}function ip(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 sp(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function lp(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&ne(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function a4(n){var ae,Se;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y=[],G=new Map,de,x,ve=[],_e=new Map,ge,K=n[1]&&ip();E=new js({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
await client.records.delete('${(ae=n[0])==null?void 0:ae.name}', 'RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
await client.records.delete('${(Se=n[0])==null?void 0:Se.name}', 'RECORD_ID');
`}});let ye=n[4];const oe=Q=>Q[6].code;for(let Q=0;Q<ye.length;Q+=1){let $e=np(n,ye,Q),Be=oe($e);G.set(Be,Y[Q]=sp(Be,$e))}let W=n[4];const ce=Q=>Q[6].code;for(let Q=0;Q<W.length;Q+=1){let $e=tp(n,W,Q),Be=ce($e);_e.set(Be,ve[Q]=lp(Be,$e))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),K&&K.c(),h=D(),g=_("div"),v=_("p"),b=N("Delete a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path parameters",F=D(),V=_("table"),V.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>`,X=D(),te=_("div"),te.textContent="Responses",Z=D(),ee=_("div"),U=_("div");for(let Q=0;Q<Y.length;Q+=1)Y[Q].c();de=D(),x=_("div");for(let Q=0;Q<ve.length;Q+=1)ve[Q].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(M,"class","section-title"),p(I,"class","section-title"),p(V,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(U,"class","tabs-header compact left"),p(x,"class","tabs-content"),p(ee,"class","tabs")},m(Q,$e){w(Q,e,$e),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),K&&K.m(e,null),w(Q,h,$e),w(Q,g,$e),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w(Q,T,$e),w(Q,M,$e),w(Q,O,$e),H(E,Q,$e),w(Q,P,$e),w(Q,I,$e),w(Q,F,$e),w(Q,V,$e),w(Q,X,$e),w(Q,te,$e),w(Q,Z,$e),w(Q,ee,$e),m(ee,U);for(let Be=0;Be<Y.length;Be+=1)Y[Be].m(U,null);m(ee,de),m(ee,x);for(let Be=0;Be<ve.length;Be+=1)ve[Be].m(x,null);ge=!0},p(Q,[$e]){var Xe,ut;(!ge||$e&1)&&a!==(a=Q[0].name+"")&&ue(u,a),Q[1]?K||(K=ip(),K.c(),K.m(e,null)):K&&(K.d(1),K=null),(!ge||$e&1)&&$!==($=Q[0].name+"")&&ue(C,$);const Be={};$e&9&&(Be.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${Q[3]}');
...
2022-09-29 02:55:18 +08:00
await client.records.delete('${(Xe=Q[0])==null?void 0:Xe.name}', 'RECORD_ID');
`),$e&9&&(Be.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${Q[3]}');
...
2022-09-29 02:55:18 +08:00
await client.records.delete('${(ut=Q[0])==null?void 0:ut.name}', 'RECORD_ID');
`),E.$set(Be),$e&20&&(ye=Q[4],Y=ct(Y,$e,oe,1,Q,ye,G,U,pn,sp,null,np)),$e&20&&(W=Q[4],Ae(),ve=ct(ve,$e,ce,1,Q,W,_e,x,Ut,lp,null,tp),Pe())},i(Q){if(!ge){A(E.$$.fragment,Q);for(let $e=0;$e<W.length;$e+=1)A(ve[$e]);ge=!0}},o(Q){L(E.$$.fragment,Q);for(let $e=0;$e<ve.length;$e+=1)L(ve[$e]);ge=!1},d(Q){Q&&k(e),K&&K.d(),Q&&k(h),Q&&k(g),Q&&k(T),Q&&k(M),Q&&k(O),j(E,Q),Q&&k(P),Q&&k(I),Q&&k(F),Q&&k(V),Q&&k(X),Q&&k(te),Q&&k(Z),Q&&k(ee);for(let $e=0;$e<Y.length;$e+=1)Y[$e].d();for(let $e=0;$e<ve.length;$e+=1)ve[$e].d()}}}function u4(n,e,t){let i,s,{collection:l=new dn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
null
`}),r.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&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class f4 extends Ee{constructor(e){super(),Oe(this,e,u4,a4,De,{collection:0})}}function c4(n){var h,g,v,b,y,$,C,S;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new js({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(C=n[0])==null?void 0:C.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}/RECORD_ID') // remove only the record subscription
`}}),c=new bn({props:{content:JSON.stringify({action:"create",record:B.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=D(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
<p>Events are sent 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
2022-09-29 02:55:18 +08:00
the event message.</p></div></div>`,s=D(),l=_("div"),l.textContent="Client SDKs example",o=D(),q(r.$$.fragment),a=D(),u=_("div"),u.textContent="Event data format",f=D(),q(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(T,M){w(T,e,M),w(T,t,M),w(T,i,M),w(T,s,M),w(T,l,M),w(T,o,M),H(r,T,M),w(T,a,M),w(T,u,M),w(T,f,M),H(c,T,M),d=!0},p(T,[M]){var P,I,F,V,X,te,Z,ee;const O={};M&3&&(O.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${T[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(P=T[0])==null?void 0:P.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(I=T[0])==null?void 0:I.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(F=T[0])==null?void 0:F.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(V=T[0])==null?void 0:V.name}/RECORD_ID') // remove only the record subscription
`),M&3&&(O.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${T[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
2022-09-29 02:55:18 +08:00
client.realtime.subscribe('${(X=T[0])==null?void 0:X.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(te=T[0])==null?void 0:te.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
2022-09-29 02:55:18 +08:00
client.realtime.unsubscribe('${(Z=T[0])==null?void 0:Z.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(ee=T[0])==null?void 0:ee.name}/RECORD_ID') // remove only the record subscription
`),r.$set(O);const E={};M&1&&(E.content=JSON.stringify({action:"create",record:B.dummyCollectionRecord(T[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(E)},i(T){d||(A(r.$$.fragment,T),A(c.$$.fragment,T),d=!0)},o(T){L(r.$$.fragment,T),L(c.$$.fragment,T),d=!1},d(T){T&&k(e),T&&k(t),T&&k(i),T&&k(s),T&&k(l),T&&k(o),j(r,T),T&&k(a),T&&k(u),T&&k(f),j(c,T)}}}function d4(n,e,t){let i,{collection:s=new dn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=B.getApiExampleUrl(we.baseUrl)),[s,i]}class p4 extends Ee{constructor(e){super(),Oe(this,e,d4,c4,De,{collection:0})}}function op(n,e,t){const i=n.slice();return i[14]=e[t],i}function rp(n,e,t){const i=n.slice();return i[14]=e[t],i}function ap(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&q(t.$$.fragment),i=D(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&H(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Ae();const f=t;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(t=new l(o(r)),q(t.$$.fragment),A(t.$$.fragment,1),H(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&L(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&j(t)}}}function up(n,e){let t,i,s,l=e[4]===e[14].id&&ap(e);return{key:n,first:null,c(){t=Ue(),l&&l.c(),i=Ue(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=ap(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function h4(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=op(n,l,r),u=o(a);i.set(u,t[r]=up(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Ae(),t=ct(t,a,o,1,r,l,i,e,Ut,up,null,op),Pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)L(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function fp(n,e){let t,i,s=e[14].label+"",l,o,r,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=N(s),o=D(),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,o),r||(a=[J(t,"click",u),J(t,"keydown",Um(f))],r=!0)},p(c,d){e=c,d&48&&ne(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Ye(a)}}}function m4(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=rp(n,f,d),g=c(h);u.set(g,a[d]=fp(g,h))}return{c(){e=_("h4"),t=_("strong"),s=N(i),l=N(" records API"),o=D(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,o,h),w(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ue(s,i),h&114&&(f=d[5],a=ct(a,h,c,1,d,f,u,r,pn,fp,null,rp))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function g4(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=J(e,"click",n[8]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function _4(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[g4],header:[m4],default:[h4]},$$scope:{ctx:n}};return e=new ui({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function b4(n,e,t){const i=[{id:"list",label:"List",component:PC},{id:"view",label:"View",component:NC},{id:"create",label:"Create",component:JC},{id:"update",label:"Update",component:r4},{id:"delete",label:"Delete",
<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(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[J(t,"change",n[17]),J(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Ye(o)}}}function bM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=M=>M[25];for(let M=0;M<b.length;M+=1){let O=pp(n,b,M),E=y(O);d.set(E,c[M]=hp(E,O))}let $=n[0],C=[];for(let M=0;M<$.length;M+=1)C[M]=mp(dp(n,$,M));const S=M=>L(C[M],1,1,()=>{C[M]=null});let T=!n[8]&&gp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("div");for(let M=0;M<c.length;M+=1)c[M].c();h=D();for(let M=0;M<C.length;M+=1)C[M].c();g=D(),T&&T.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(M,O){w(M,e,O),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,O),w(M,f,O);for(let E=0;E<c.length;E+=1)c[E].m(f,null);m(f,h);for(let E=0;E<C.length;E+=1)C[E].m(f,null);m(f,g),T&&T.m(f,null),n[19](f),v=!0},p(M,O){if((!v||O&8&&i!==(i=B.getFieldTypeIcon(M[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=M[3].name+"")&&ue(r,o),(!v||O&2097152&&a!==(a=M[21]))&&p(e,"for",a),O&1558&&(b=M[4],Ae(),c=ct(c,O,y,1,M,b,d,f,Ut,hp,h,pp),Pe()),O&2049){$=M[0];let E;for(E=0;E<$.length;E+=1){const P=dp(M,$,E);C[E]?(C[E].p(P,O),A(C[E],1)):(C[E]=mp(P),C[E].c(),A(C[E],1),C[E].m(f,g))}for(Ae(),E=$.length;E<C.length;E+=1)S(E);Pe()}M[8]?T&&(T.d(1),T=null):T?T.p(M,O):(T=gp(M),T.c(),T.m(f,null))},i(M){if(!v){for(let O=0;O<b.length;O+=1)A(c[O]);for(let O=0;O<$.length;O+=1)A(C[O]);v=!0}},o(M){for(let O=0;O<c.length;O+=1)L(c[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)L(C[O]);v=!1},d(M){M&&k(e),M&&k(u),M&&k(f);for(let O=0;O<c.length;O+=1)c[O].d();nn(C,M),T&&T.d(),n[19](null)}}}function vM(n){let e,t;return e=new Ne({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[bM,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function yM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(E){B.removeByValue(u,E),t(1,u)}function g(E){B.pushUnique(u,E),t(1,u)}function v(E){B.isEmpty(a[E])||a.splice(E,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>h(E),$=E=>g(E),C=E=>v(E);function S(E){me[E?"unshift":"push"](()=>{c=E,t(6,c)})}const T=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},M=()=>c==null?void 0:c.click();function O(E){me[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,P;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=B.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&B.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=B.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,$,C,S,T,M,O]}class kM extends Ee{constructor(e){super(),Oe(this,e,yM,vM,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function _p(n){let e,t;return{c(){e=_("small"),t=N(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function wM(n){let e,t,i,s,l,o=n[0].id
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function UM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new zM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function WM(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new PM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function YM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(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 kM({props:u}),me.push(()=>Re(e,"value",o)),me.push(()=>Re(e,"uploadedFiles",r)),me.push(()=>Re(e,"deletedFileIndexes",a)),{c(){q(e.$$.fragment)},m(f,c){H(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],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function KM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new eM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function JM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new G4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ZM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new Y4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function GM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new z4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function XM(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new H4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new I4({props:l}),me.push(()=>Re(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=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function iT(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&Tp(n);return{c(){e=_("h4"),i=N(t),s=D(),o=N(l),r=N(" record"),a=D(),c&&c.c(),u=Ue()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),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")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=Tp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function sT(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=N(o),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[9]||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,r),u||(f=J(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||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 lT(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[sT],header:[iT],default:[tT]},$$scope:{ctx:n}};return e=new ui({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[33](null),j(e,s)}}}function Dp(n){return JSON.stringify(n)}function oT(n,e,t){let i,s,l,o;const r=Qt(),a="record_"+B.randomString(5);let{collection:u}=e,f,c=null,d=new bo,h=!1,g=!1,v={},b={},y="";function $(oe){return S(oe),t(8,g=!0),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function S(oe){ri({}),c=oe||{},t(2,d=oe!=null&&oe.clone?oe.clone():new bo),t(3,v={}),t(4,b={}),await Zn(),t(15,y=Dp(d))}function T(){if(h||!l)return;t(7,h=!0);const oe=O();let W;d.isNew?W=we.records.create(u==null?void 0:u.id,oe):W=we.records.update(u==null?void 0:u.id,d.id,oe),W.then(async ce=>{sn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),C(),r("save",ce)}).catch(ce=>{we.errorResponseHandler(ce)}).finally(()=>{t(7,h=!1)})}function M(){!(c!=null&&c.id)||si("Do you really want to delete the selected record?",()=>we.records.delete(c["@collectionId"],c.id).then(()=>{C(),sn("Successfully deleted record."),r("delete",c)}).catch(oe=>{we.errorResponseHandler(oe)}))}function O(){const oe=(d==null?void 0:d.export())||{},W=new FormData,ce={};for(const ae of(u==null?void 0:u.schema)||[])ce[ae.name]=ae;for(const ae in oe)!ce[ae]||(typeof oe[ae]>"u"&&(oe[ae]=null),B.addValueToFormData(W,ae,oe[ae]));for(const ae in v){const Se=B.toArray(v[ae]);for(const Q of Se)W.append(ae,Q)}for(const ae in b){const Se=B.toArray(b[ae]);for(const Q of Se)W.append(ae+"."+Q,"")}return W}const E=()=>C(),P=()=>M();function I(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function F(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function V(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function X(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function te(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function Z(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function ee(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function U(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function Y(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function G(oe,W){n.$$.not_equal(v[W.name],oe)&&(v[W.name]=oe,t(3,v))}function de(oe,W){n.$$.not_equ
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function qp(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=J(e,"click",n[29]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Vp(n,e){let t,i,s;return i=new hb({props:{record:e[36],field:e[39]}}),{key:n,first:null,c(){t=Ue(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[36]),o[0]&4096&&(r.field=e[39]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function zp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,$,C,S,T,M,O,E,P,I,F,V;function X(){return e[26](e[36])}h=new lr({props:{id:e[36].id}});let te=e[12];const Z=Y=>Y[39].name;for(let Y=0;Y<te.length;Y+=1){let G=Fp(e,te,Y),de=Z(G);b.set(de,v[Y]=Vp(de,G))}C=new Si({props:{date:e[36].created}}),M=new Si({props:{date:e[36].updated}});function ee(){return e[27](e[36])}function U(...Y){return e[28](e[36],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=D(),u=_("label"),c=D(),d=_("td"),q(h.$$.fragment),g=D();for(let Y=0;Y<v.length;Y+=1)v[Y].c();y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[36].id),l.checked=r=e[5][e[36].id],p(u,"for",f="checkbox_"+e[36].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,G){w(Y,t,G),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),H(h,d,null),m(t,g);for(let de=0;de<v.length;de+=1)v[de].m(t,null);m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(V=[J(l,"change",X),J(s,"click",ni(e[20])),J(t,"click",ee),J(t,"keydown",U)],F=!0)},p(Y,G){e=Y,(!I||G[0]&8&&o!==(o="checkbox_"+e[36].id))&&p(l,"id",o),(!I||G[0]&40&&r!==(r=e[5][e[36].id]))&&(l.checked=r),(!I||G[0]&8&&f!==(f="checkbox_"+e[36].id))&&p(u,"for",f);const de={};G[0]&8&&(de.id=e[36].id),h.$set(de),G[0]&4104&&(te=e[12],Ae(),v=ct(v,G,Z,1,e,te,b,t,Ut,Vp,y,Fp),Pe());const x={};G[0]&8&&(x.date=e[36].created),C.$set(x);const ve={};G[0]&8&&(ve.date=e[36].updated),M.$set(ve)},i(Y){if(!I){A(h.$$.fragment,Y);for(let G=0;G<te.length;G+=1)A(v[G]);A(C.$$.fragment,Y),A(M.$$.fragment,Y),I=!0}},o(Y){L(h.$$.fragment,Y);for(let G=0;G<v.length;G+=1)L(v[G]);L(C.$$.fragment,Y),L(M.$$.fragment,Y),I=!1},d(Y){Y&&k(t),j(h);for(let G=0;G<v.length;G+=1)v[G].d();j(C),j(M),F=!1,Ye(V)}}}function Bp(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Up(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),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,o),m(i,r),a||(u=J(t,"click",n[30]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,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 Wp(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,y,$;return{c(){e=_("div"),t=_("div"),i=N("Selected "),s=_("strong"),l=N(n[6]),o=D(),a=N(r),u=D(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=_("div"),h=D(),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-disabled",n[9]),p(d,
<span class="txt">API Preview</span>`,v=D(),b=_("button"),b.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,y=D(),q($.$$.fragment),C=D(),q(S.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(b,"type","button"),p(b,"class","btn btn-expanded"),p(h,"class","btns-group"),p(e,"class","page-header")},m(te,Z){w(te,e,Z),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),I&&I.m(u,null),m(u,f),H(c,u,null),m(e,d),m(e,h),m(h,g),m(h,v),m(h,b),w(te,y,Z),H($,te,Z),w(te,C,Z),H(S,te,Z),O=!0,E||(P=[J(g,"click",n[15]),J(b,"click",n[16])],E=!0)},p(te,Z){(!O||Z[0]&4)&&o!==(o=te[2].name+"")&&ue(r,o),te[9]?I&&(I.d(1),I=null):I?I.p(te,Z):(I=Yp(te),I.c(),I.m(u,f));const ee={};Z[0]&1&&(ee.value=te[0]),Z[0]&4&&(ee.autocompleteCollection=te[2]),$.$set(ee);const U={};Z[0]&4&&(U.collection=te[2]),!T&&Z[0]&1&&(T=!0,U.filter=te[0],He(()=>T=!1)),!M&&Z[0]&2&&(M=!0,U.sort=te[1],He(()=>M=!1)),S.$set(U)},i(te){O||(A(c.$$.fragment,te),A($.$$.fragment,te),A(S.$$.fragment,te),O=!0)},o(te){L(c.$$.fragment,te),L($.$$.fragment,te),L(S.$$.fragment,te),O=!1},d(te){te&&k(e),I&&I.d(),j(c),te&&k(y),j($,te),te&&k(C),n[18](null),j(S,te),E=!1,Ye(P)}}}function RT(n){let e,t,i,s,l;return{c(){e=_("h1"),e.textContent="Create your first collection to add records!",t=D(),i=_("button"),i.innerHTML=`<i class="ri-add-line"></i>
2022-09-29 02:55:18 +08:00
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=J(i,"click",n[12]),s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function HT(n){let e;return{c(){e=_("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function jT(n){let e,t,i;function s(r,a){return r[9]?HT:RT}let l=s(n),o=l(n);return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),m(e,t),m(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function qT(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:se,d(t){t&&k(e)}}}function VT(n){let e,t,i,s,l,o,r,a,u;const f=[NT,IT,LT],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new nu({props:h}),n[22](s);let g={};o=new v4({props:g}),n[23](o);let v={collection:n[2]};return a=new pb({props:v}),n[24](a),a.$on("save",n[25]),a.$on("delete",n[26]),{c(){t.c(),i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),H(s,b,y),w(b,l,y),H(o,b,y),w(b,r,y),H(a,b,y),u=!0},p(b,y){let $=e;e=d(b),e===$?c[e].p(b,y):(Ae(),L(c[$],1,1,()=>{c[$]=null}),Pe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const S={};o.$set(S);const T={};y[0]&4&&(T.collection=b[2]),a.$set(T)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){L(t),L(s.$$.fragment,b),L(o.$$.fragment,b),L(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[22](null),j(s,b),b&&k(l),n[23](null),j(o,b),b&&k(r),n[24](null),j(a,b)}}}function zT(n,e,t){let i,s,l,o,r,a,u;rt(n,hi,Y=>t(2,s=Y)),rt(n,Ps,Y=>t(11,l=Y)),rt(n,zo,Y=>t(27,o=Y)),rt(n,Nt,Y=>t(28,r=Y)),rt(n,pa,Y=>t(8,a=Y)),rt(n,us,Y=>t(9,u=Y)),tn(Nt,r="Collections",r);const f=new URLSearchParams(o);let c,d,h,g,v=f.get("filter")||"",b=f.get("sort")||"-created",y=f.get("collectionId")||"";function $(){t(10,y=s.id),t(1,b="-created"),t(0,v="")}W$(y);const C=()=>c==null?void 0:c.show(),S=()=>c==null?void 0:c.show(s),T=()=>g==null?void 0:g.load(),M=()=>d==null?void 0:d.show(s),O=()=>h==null?void 0:h.show(),E=Y=>t(0,v=Y.detail);function P(Y){me[Y?"unshift":"push"](()=>{g=Y,t(6,g)})}function I(Y){v=Y,t(0,v)}function F(Y){b=Y,t(1,b)}const V=Y=>h==null?void 0:h.show(Y==null?void 0:Y.detail);function X(Y){me[Y?"unshift":"push"](()=>{c=Y,t(3,c)})}function te(Y){me[Y?"unshift":"push"](()=>{d=Y,t(4,d)})}function Z(Y){me[Y?"unshift":"push"](()=>{h=Y,t(5,h)})}const ee=()=>g==null?void 0:g.reloadLoadedPages(),U=()=>g==null?void 0:g.reloadLoadedPages();return n.$$.update=()=>{if(n.$$.dirty[0]&2048&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty[0]&1028&&(s==null?void 0:s.id)&&y!=s.id&&$(),n.$$.dirty[0]&7&&(b||v||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:b}).toString();Ci("/collections?"+Y)}},[v,b,s,c,d,h,g,i,a,u,y,l,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U]}class BT extends Ee{constructor(e){super(),Oe(this,e,zT,VT,De,{},null,[-1,-1])}}const $l={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",selfHosted:!0},discordAuth:{title:"Discord",icon:"ri-discord-fill"}};function Kp(n,e,t){const i=n.slice();return i[9]=e[t],i}function UT(n){let e;return{c(){e=_("p"),e.textContent="No authorized OAuth2 providers.",p(e,"class","txt-hint txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function WT(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=Jp(Kp(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();p(e,"class","list")},m(s,l){w(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&58){t=s[1];let o;for(o=0;o<t.length;o+=1){const r=Kp(s,t,o);i[o]?i[o].p(r,l):(i[o]=Jp(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){s&&k(e),nn(i,s)}}}function YT(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Jp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,h,g,v,b,y;function $(){return n[6](n[9])}return{c(){e=_("div"),t=_("i"),s=D(),l=_("span"),r=N(o),a=D(),u=_("div"),f=N("ID: "),d=N(c),h=D(),g=_("button"),g.innerHTML='<i class="ri-close-line"></i>',v=D(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-secondary link-hint btn-circle btn-sm m-l-auto"),p(
2022-09-29 02:55:18 +08:00
<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=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function iD(n){let e,t,i,s,l=!n[1].verified&&n[1].email&&ih(n);return{c(){l&&l.c(),e=D(),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(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=J(t,"click",n[19]),i=!0)},p(o,r){!o[1].verified&&o[1].email?l?l.p(o,r):(l=ih(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function sD(n){let e,t=n[1].isNew?"New user":"Edit user",i,s,l,o,r=!n[1].isNew&&nh(n);return{c(){e=_("h4"),i=N(t),s=D(),r&&r.c(),l=Ue()},m(a,u){w(a,e,u),m(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u[0]&2)&&t!==(t=a[1].isNew?"New user":"Edit user")&&ue(i,t),a[1].isNew?r&&(Ae(),L(r,1,1,()=>{r=null}),Pe()):r?(r.p(a,u),u[0]&2&&A(r,1)):(r=nh(a),r.c(),A(r,1),r.m(l.parentNode,l))},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&k(e),a&&k(s),r&&r.d(a),a&&k(l)}}}function sh(n){let e,t,i=n[1].isNew?"Create":"Save changes",s,l;return{c(){e=_("button"),t=_("span"),s=N(i),p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[12]),p(e,"class","btn btn-expanded"),e.disabled=l=!n[11]||n[5],ne(e,"btn-loading",n[5])},m(o,r){w(o,e,r),m(e,t),m(t,s)},p(o,r){r[0]&2&&i!==(i=o[1].isNew?"Create":"Save changes")&&ue(s,i),r[0]&2080&&l!==(l=!o[11]||o[5])&&(e.disabled=l),r[0]&32&&ne(e,"btn-loading",o[5])},d(o){o&&k(e)}}}function lD(n){let e,t,i,s,l,o,r=n[10]===wi&&sh(n);return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),r&&r.c(),s=Ue(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[5]},m(a,u){w(a,e,u),m(e,t),w(a,i,u),r&&r.m(a,u),w(a,s,u),l||(o=J(e,"click",n[17]),l=!0)},p(a,u){u[0]&32&&(e.disabled=a[5]),a[10]===wi?r?r.p(a,u):(r=sh(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(a){a&&k(e),a&&k(i),r&&r.d(a),a&&k(s),l=!1,o()}}}function oD(n){let e,t,i={class:"user-panel",popup:n[1].isNew,beforeHide:n[27],$$slots:{footer:[lD],header:[sD],default:[nD]},$$scope:{ctx:n}};return e=new ui({props:i}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2&&(o.popup=s[1].isNew),l[0]&2112&&(o.beforeHide=s[27]),l[0]&4014|l[1]&16&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[28](null),j(e,s)}}}const wi="account",Ls="providers";function rD(n,e,t){let i;const s=Qt(),l="user_"+B.randomString(5);let o,r=new Ts,a=!1,u=!1,f="",c="",d="",h=!1,g=!0,v=wi;function b(x){return $(x),t(6,u=!0),t(10,v=r.isNew||r.email?wi:Ls),o==null?void 0:o.show()}function y(){return o==null?void 0:o.hide()}function $(x){ri({}),t(1,r=x!=null&&x.clone?x.clone():new Ts),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const x={email:f};(r.isNew||h)&&(x.password=c,x.passwordConfirm=d);let ve;r.isNew?ve=we.users.create(x):ve=we.users.update(r.id,x),ve.then(async _e=>{t(1,r=_e),g&&M(!1),t(6,u=!1),y(),sn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",_e)}).catch(_e=>{we.errorResponseHandler(_e)}).finally(()=>{t(5,a=!1)})}function T(){!(r!=null&&r.id)||si("Do you really want to delete the selected user?",()=>we.users.delete(r.id).then(()=>{t(6,u=!1),y(),sn("Successfully deleted user."),s("delete",r)}).catch(x=>{we.errorResponseHandler(x)}))}function M(x=!0){return we.users.requestVerification(r.email||f).then(()=>{t(6,u=!1),y(),x&&sn(`Successfully sent verification email to ${r.email}.`)}).catch(ve=>{we.errorResponseHandler(ve)})}const O=()=>y(),E=()=>M(),P=()=>T(),I=()=>t(10,v=wi),F=()=>t(10,v=Ls);function V(){f=this.value,t(2,f)}function X(){h=this.checked,t(3,h)}function te(){c=this.value,t(7,c)}function Z(){d=this.value,t(8,d)}function ee(){g=this.checked,t(9,g)}const U=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),y()}),!1):!0;function Y(x){me[x?"unshift":"push"](()=>{o=x,t(4,o)})}function G(x){xe.call(this,n,x)}function de(x){xe.call(this,n,x)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(11,i=r.isNew&&f!=""||h||f!==r.email)},[y,r,f,h,o,a,u,c,d,g,v,i,l,S,T,M,b,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de]}class aD extends Ee{constructor(e){super(
<span class="txt">New user</span>`,d=D(),q(h.$$.fragment),g=D(),v=_("div"),b=_("table"),y=_("thead"),$=_("tr"),q(C.$$.fragment),T=D(),q(M.$$.fragment),E=D();for(let be=0;be<P.length;be+=1)P[be].c();F=D(),q(V.$$.fragment),te=D(),q(Z.$$.fragment),U=D(),Y=_("th"),G=D(),de=_("tbody");for(let be=0;be<x.length;be+=1)x[be].c();Ze&&Ze.c(),_e=D(),tt&&tt.c(),ge=D(),dt&&dt.c(),K=Ue(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(e,"class","page-header"),p(Y,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[10]),p(v,"class","table-wrapper")},m(be,Fe){w(be,e,Fe),m(e,t),m(t,i),m(i,s),m(e,l),ce&&ce.m(e,null),m(e,o),H(r,e,null),m(e,a),m(e,u),m(e,f),m(e,c),w(be,d,Fe),H(h,be,Fe),w(be,g,Fe),w(be,v,Fe),m(v,b),m(b,y),m(y,$),H(C,$,null),m($,T),H(M,$,null),m($,E);for(let pt=0;pt<P.length;pt+=1)P[pt].m($,null);m($,F),H(V,$,null),m($,te),H(Z,$,null),m($,U),m($,Y),m(b,G),m(b,de);for(let pt=0;pt<x.length;pt+=1)x[pt].m(de,null);Ze&&Ze.m(de,null),w(be,_e,Fe),tt&&tt.m(be,Fe),w(be,ge,Fe),dt&&dt.m(be,Fe),w(be,K,Fe),ye=!0,oe||(W=J(c,"click",n[19]),oe=!0)},p(be,Fe){(!ye||Fe[0]&16384)&&ue(s,be[14]),be[15]?ce&&(ce.d(1),ce=null):ce?ce.p(be,Fe):(ce=ah(be),ce.c(),ce.m(e,o));const pt={};Fe[0]&8&&(pt.value=be[3]),h.$set(pt);const Dt={};Fe[1]&262144&&(Dt.$$scope={dirty:Fe,ctx:be}),!S&&Fe[0]&16&&(S=!0,Dt.sort=be[4],He(()=>S=!1)),C.$set(Dt);const ht={};Fe[1]&262144&&(ht.$$scope={dirty:Fe,ctx:be}),!O&&Fe[0]&16&&(O=!0,ht.sort=be[4],He(()=>O=!1)),M.$set(ht),Fe[0]&4096&&(Be=be[12],P=ct(P,Fe,Xe,1,be,Be,I,$,pn,uh,F,rh));const st={};Fe[1]&262144&&(st.$$scope={dirty:Fe,ctx:be}),!X&&Fe[0]&16&&(X=!0,st.sort=be[4],He(()=>X=!1)),V.$set(st);const Lt={};Fe[1]&262144&&(Lt.$$scope={dirty:Fe,ctx:be}),!ee&&Fe[0]&16&&(ee=!0,Lt.sort=be[4],He(()=>ee=!1)),Z.$set(Lt),Fe[0]&5450&&(Te=be[1],Ae(),x=ct(x,Fe,Ve,1,be,Te,ve,de,Ut,hh,null,lh),Pe(),!Te.length&&Ze?Ze.p(be,Fe):Te.length?Ze&&(Ze.d(1),Ze=null):(Ze=fh(be),Ze.c(),Ze.m(de,null))),(!ye||Fe[0]&1024)&&ne(b,"table-loading",be[10]),be[1].length?tt?tt.p(be,Fe):(tt=mh(be),tt.c(),tt.m(ge.parentNode,ge)):tt&&(tt.d(1),tt=null),be[1].length&&be[13]?dt?dt.p(be,Fe):(dt=gh(be),dt.c(),dt.m(K.parentNode,K)):dt&&(dt.d(1),dt=null)},i(be){if(!ye){A(r.$$.fragment,be),A(h.$$.fragment,be),A(C.$$.fragment,be),A(M.$$.fragment,be),A(V.$$.fragment,be),A(Z.$$.fragment,be);for(let Fe=0;Fe<Te.length;Fe+=1)A(x[Fe]);ye=!0}},o(be){L(r.$$.fragment,be),L(h.$$.fragment,be),L(C.$$.fragment,be),L(M.$$.fragment,be),L(V.$$.fragment,be),L(Z.$$.fragment,be);for(let Fe=0;Fe<x.length;Fe+=1)L(x[Fe]);ye=!1},d(be){be&&k(e),ce&&ce.d(),j(r),be&&k(d),j(h,be),be&&k(g),be&&k(v),j(C),j(M);for(let Fe=0;Fe<P.length;Fe+=1)P[Fe].d();j(V),j(Z);for(let Fe=0;Fe<x.length;Fe+=1)x[Fe].d();Ze&&Ze.d(),be&&k(_e),tt&&tt.d(be),be&&k(ge),dt&&dt.d(be),be&&k(K),oe=!1,W()}}}function fD(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:se,i:se,o:se,d(t){t&&k(e)}}}function ah(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle")},m(s,l){w(s,e,l),t||(i=[We(yt.call(null,e,{text:"Edit profile collection",position:"right"})),J(e,"click",n[17])],t=!0)},p:se,d(s){s&&k(e),t=!1,Ye(i)}}}function cD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function dD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function uh(n,e){let t,i,s,l,o,r,a,u=e[44].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=D(),r=_("span"),a=N("profile."),f=N(u),p(s,"class",l=B.getFieldTypeIcon(e[44].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[44].type+" col-field-"+e[44].name),p(t,"name",d=e[44].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=B.getFieldTypeIcon(e[44].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[44].name+"")&&ue(f,u),g[0]&4096&&c!==(c="col-type-"+e[44].type+" col-field-"+e[44].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[44].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function pD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function hD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function fh(n){let e;function t(l,o){return l[10]?gD:mD}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function mD(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&ch(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=D(),o&&o.c(),l=D(),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),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=ch(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function gD(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:se,d(t){t&&k(e)}}}function ch(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=J(e,"click",n[27]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function _D(n){let e,t,i,s=n[41].verified&&dh();return{c(){e=_("div"),e.textContent="N/A",t=D(),s&&s.c(),i=Ue(),p(e,"class","txt-hint")},m(l,o){w(l,e,o),w(l,t,o),s&&s.m(l,o),w(l,i,o)},p(l,o){l[41].verified?s||(s=dh(),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(l){l&&k(e),l&&k(t),s&&s.d(l),l&&k(i)}}}function bD(n){let e,t=n[41].email+"",i,s,l,o,r=n[41].verified?"Verified":"Unverified",a;return{c(){e=_("span"),i=N(t),l=D(),o=_("span"),a=N(r),p(e,"class","txt"),p(e,"title",s=n[41].email),p(o,"class","label"),ne(o,"label-success",n[41].verified),ne(o,"label-warning",!n[41].verified)},m(u,f){w(u,e,f),m(e,i),w(u,l,f),w(u,o,f),m(o,a)},p(u,f){f[0]&2&&t!==(t=u[41].email+"")&&ue(i,t),f[0]&2&&s!==(s=u[41].email)&&p(e,"title",s),f[0]&2&&r!==(r=u[41].verified?"Verified":"Unverified")&&ue(a,r),f[0]&2&&ne(o,"label-success",u[41].verified),f[0]&2&&ne(o,"label-warning",!u[41].verified)},d(u){u&&k(e),u&&k(l),u&&k(o)}}}function dh(n){let e;return{c(){e=_("span"),e.textContent="OAuth2 verified",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ph(n,e){let t,i,s;return i=new hb({props:{field:e[44],record:e[41].profile||{}}}),{key:n,first:null,c(){t=Ue(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[44]),o[0]&2&&(r.record=e[41].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function hh(n,e){let t,i,s,l,o,r,a,u=[],f=new Map,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P;s=new lr({props:{id:e[41].id}});function I(U,Y){return U[41].email?bD:_D}let F=I(e),V=F(e),X=e[12];const te=U=>U[44].name;for(let U=0;U<X.length;U+=1){let Y=oh(e,X,U),G=te(Y);f.set(G,u[U]=ph(G,Y))}h=new Si({props:{date:e[41].created}}),b=new Si({props:{date:e[41].updated}});function Z(){return e[25](e[41])}function ee(){return e[26](e[41])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),q(s.$$.fragment),l=D(),o=_("td"),r=_("div"),V.c(),a=D();for(let U=0;U<u.length;U+=1)u[U].c();c=D(),d=_("td"),q(h.$$.fragment),g=D(),v=_("td"),q(b.$$.fragment),y=D(),$=_("td"),C=_("button"),C.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,S=D(),T=_("button"),T.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,M=D(),p(i,"class","col-type-text col-field-id"),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p(d,"class","col-type-date col-field-created"),p(v,"class","col-type-date col-field-updated"),p(C,"type","button"),p(C,"class","btn btn-sm btn-outline"),p(T,"type","button"),p(T,"class","btn btn-sm m-l-10"),p($,"class","col-type-action min-width"),this.first=t},m(U,Y){w(U,t,Y),m(t,i),H(s,i,null),m(t,l),m(t,o),m(o,r),V.m(r,null),m(t,a);for(let G=0;G<u.length;G+=1)u[G].m(t,null);m(t,c),m(t,d),H(h,d,null),m(t,g),m(t,v),H(b,v,null),m(t,y),m(t,$),m($,C),m($,S),m($,T),m(t,M),O=!0,E||(P=[J(C,"click",ni(Z)),J(T,"click",ni(ee))],E=!0)},p(U,Y){e=U;const G={};Y[0]&2&&(G.id=e[41].id),s.$set(G),F===(F=I(e))&&V?V.p(e,Y):(V.d(1),V=F(e),V&&(V.c(),V.m(r,null))),Y[0]&4098&&(X=e[12],Ae(),u=ct(u,Y,te,1,e,X,f,t,Ut,ph,c,oh),Pe());const de={};Y[0]&2&&(de.date=e[41].created),h.$set(de);const x={};Y[0]&2&&(x.date=e[41].updated),b.$set(x)},i(U){if(!O){A(s.$$.fragment,U);for(let Y=0;Y<X.length;Y+=1)A(u[Y]);A(h.$$.fragment,U),A(b.$$.fragment,U),O=!0}},o(U){L(s.$$.fragment,U);for(let Y=0;Y<u.length;Y+=1)L(u[Y]);L(h.$$.fragment,U),L(b.$$.fragment,U),O=!1},d(U){U&&k(t),j(s),V.d();for(let Y=0;Y<u.length;Y+=1)u[Y].d();j(h),j(b),E=!1,Ye(P)}}}function mh(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function gh(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),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,o),m(i,r),a||(u=J(t,"click",n[28]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(o,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 vD(n){let e,t,i,s;const l=[fD,uD],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ue()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Ae(),L(o[f],1,1,()=>{o[f]=null}),Pe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function yD(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[vD]},$$scope:{ctx:n}}});let u={};i=new aD({props:u}),n[29](i),i.$on("save",n[30]),i.$on("delete",n[31]);let f={};l=new nu({props:f}),n[32](l),l.$on("save",n[33]);let c={collection:n[5]};return r=new pb({props:c}),n[34](r),r.$on("save",n[35]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment),o=D(),q(r.$$.fragment)},m(d,h){H(e,d,h),w(d,t,h),H(i,d,h),w(d,s,h),H(l,d,h),w(d,o,h),H(r,d,h),a=!0},p(d,h){const g={};h[0]&65534|h[1]&262144&&(g.$$scope={dirty:h,ctx:d}),e.$set(g);const v={};i.$set(v);const b={};l.$set(b);const y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},i(d){a||(A(e.$$.fragment,d),A(i.$$.fragment,d),A(l.$$.fragment,d),A(r.$$.fragment,d),a=!0)},o(d){L(e.$$.fragment,d),L(i.$$.fragment,d),L(l.$$.fragment,d),L(r.$$.fragment,d),a=!1},d(d){j(e,d),d&&k(t),n[29](null),j(i,d),d&&k(s),n[32](null),j(l,d),d&&k(o),n[34](null),j(r,d)}}}function kD(n,e,t){let i,s,l,o,r;rt(n,zo,W=>t(36,l=W)),rt(n,Nt,W=>t(14,o=W)),rt(n,us,W=>t(15,r=W)),tn(Nt,o="Users",o);const a=new URLSearchParams(l),u=["id","userId","created","updated"];let f,c,d,h=[],g=1,v=0,b=!1,y=a.get("filter")||"",$=a.get("sort")||"-created",C=new dn,S=!1;E();async function T(W=1){return t(10,b=!0),W<=1&&M(),we.users.getList(W,50,{sort:$||"-created",filter:y}).then(ce=>{t(10,b=!1),t(1,h=h.concat(ce.items)),t(9,g=ce.page),t(2,v=ce.totalItems)}).catch(ce=>{ce!=null&&ce.isAbort||(t(10,b=!1),console.warn(ce),M(),we.errorResponseHandler(ce,!1))})}function M(){t(1,h=[]),t(9,g=1),t(2,v=0)}function
<span class="txt">Application</span>`,o=D(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=_("div"),c.innerHTML=`<span class="txt">Sync</span>
<small class="label label-danger label-sm">Experimental</small>`,d=D(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,g=D(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=D(),y=_("div"),y.textContent="Authentication",$=D(),C=_("a"),C.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,S=D(),T=_("a"),T.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,M=D(),O=_("a"),O.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(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(C,"href","/settings/auth-providers"),p(C,"class","sidebar-list-item"),p(T,"href","/settings/tokens"),p(T,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,$),m(t,C),m(t,S),m(t,T),m(t,M),m(t,O),E||(P=[We(qn.call(null,l,{path:"/settings"})),We(gn.call(null,l)),We(qn.call(null,r,{path:"/settings/mail/?.*"})),We(gn.call(null,r)),We(qn.call(null,u,{path:"/settings/storage/?.*"})),We(gn.call(null,u)),We(qn.call(null,h,{path:"/settings/export-collections/?.*"})),We(gn.call(null,h)),We(qn.call(null,v,{path:"/settings/import-collections/?.*"})),We(gn.call(null,v)),We(qn.call(null,C,{path:"/settings/auth-providers/?.*"})),We(gn.call(null,C)),We(qn.call(null,T,{path:"/settings/tokens/?.*"})),We(gn.call(null,T)),We(qn.call(null,O,{path:"/settings/admins/?.*"})),We(gn.call(null,O))],E=!0)},p:se,i:se,o:se,d(I){I&&k(e),E=!1,Ye(P)}}}class Ui extends Ee{constructor(e){super(),Oe(this,e,null,$D,De,{})}}function _h(n,e,t){const i=n.slice();return i[31]=e[t],i}function bh(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[SD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function SD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="ID",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function vh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=D(),ti(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[J(e,"click",a),J(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Ye(r)}}}function CD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Email",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Me(r,n[3]),u||(f=J(r,"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(r,"id",a),d[0]&8&&r.value!==c[3]&&Me(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function yh(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[MD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function PD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&wh(n);return{c(){h&&h.c(),e=D(),t=_("button"),i=_("span"),i.textContent="Cancel",s=D(),l=_("button"),o=_("span"),a=N(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(o,"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,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=J(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Ae(),L(h,1,1,()=>{h=null}),Pe()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=wh(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),(!f||v[0]&64)&&ne(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){L(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 LD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[PD],header:[ED],default:[OD]},$$scope:{ctx:n}};return e=new ui({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),j(e,s)}}}function ID(n,e,t){let i;const s=Qt(),l="admin_"+B.randomString(5);let o,r=new as,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(U){return y(U),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(U){ri({}),t(1,r=U!=null&&U.clone?U.clone():new as),$()}function $(){t(4,g=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,h="")}function C(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||g)&&(U.password=d,U.passwordConfirm=h);let Y;r.isNew?Y=we.admins.create(U):Y=we.admins.update(r.id,U),Y.then(async G=>{var de;t(7,u=!1),b(),sn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",G),((de=we.authStore.model)==null?void 0:de.id)===G.id&&we.authStore.save(we.authStore.token,G)}).catch(G=>{we.errorResponseHandler(G)}).finally(()=>{t(6,a=!1)})}function S(){!(r!=null&&r.id)||si("Do you really want to delete the selected admin?",()=>we.admins.delete(r.id).then(()=>{t(7,u=!1),b(),sn("Successfully deleted admin."),s("delete",r)}).catch(U=>{we.errorResponseHandler(U)}))}const T=()=>S(),M=()=>b(),O=U=>t(2,f=U),E=(U,Y)=>{(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),t(2,f=U))};function P(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function F(){d=this.value,t(8,d)}function V(){h=this.value,t(9,h)}const X=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function te(U){me[U?"unshift":"push"](()=>{o=U,t(5,o)})}function Z(U){xe.call(this,n,U)}function ee(U){xe.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,h,i,l,C,S,v,T,M,O,E,P,I,F,V,X,te,Z,ee]}class ND extends Ee{constructor(e){super(),Oe(this,e,ID,LD,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function $h(n,e,t){const i=n.slice();return i[24]=e[t],i}function FD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function RD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function HD(n){let e,t,i,s;return{
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Ch(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=J(e,"click",n[17]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Mh(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 Th(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,y,$,C,S,T,M,O,E,P,I,F,V;u=new lr({props:{id:e[24].id}});let X=e[24].id===e[7].id&&Mh();C=new Si({props:{date:e[24].created}}),M=new Si({props:{date:e[24].updated}});function te(){return e[15](e[24])}function Z(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=D(),a=_("td"),q(u.$$.fragment),f=D(),X&&X.c(),c=D(),d=_("td"),h=_("span"),v=N(g),y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),ti(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),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[24].email),p(d,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,U){w(ee,t,U),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),H(u,a,null),m(a,f),X&&X.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(V=[J(t,"click",te),J(t,"keydown",Z)],F=!0)},p(ee,U){e=ee,(!I||U&16&&!ti(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Y={};U&16&&(Y.id=e[24].id),u.$set(Y),e[24].id===e[7].id?X||(X=Mh(),X.c(),X.m(a,null)):X&&(X.d(1),X=null),(!I||U&16)&&g!==(g=e[24].email+"")&&ue(v,g),(!I||U&16&&b!==(b=e[24].email))&&p(h,"title",b);const G={};U&16&&(G.date=e[24].created),C.$set(G);const de={};U&16&&(de.date=e[24].updated),M.$set(de)},i(ee){I||(A(u.$$.fragment,ee),A(C.$$.fragment,ee),A(M.$$.fragment,ee),I=!0)},o(ee){L(u.$$.fragment,ee),L(C.$$.fragment,ee),L(M.$$.fragment,ee),I=!1},d(ee){ee&&k(t),j(u),X&&X.d(),j(C),j(M),F=!1,Ye(V)}}}function Dh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),r=N(o),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,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function zD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x=[],ve=new Map,_e,ge,K,ye,oe;a=new Xo({}),a.$on("refresh",n[8]),g=new Go({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function W(Te){n[11](Te)}let ce={class:"col-type-text",name:"id",$$slots:{default:[FD]},$$scope:{ctx:n}};n[2]!==void 0&&(ce.sort=n[2]),M=new an({props:ce}),me.push(()=>Re(M,"sort",W));function ae(Te){n[12](Te)}let Se={class:"col-type-email col-field-email",name:"email",$$slots:{default:[RD]},$$scope:{ctx:n}};n[2]!==void 0&&(Se.sort=n[2]),P=new an({props:Se}),me.push(()=>Re(P,"sort",ae));function Q(Te){n[13](Te)}let $e={class:"col-type-date col-field-created",name:"created",$$slots:{default:[HD]},$$scope:{ctx:n}};n[2]!==void 0&&($e.sort=n[2]),V=new an({props:$e}),me.push(()=>Re(V,"sort",Q));function Be(Te){n[14](Te)}let Xe={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[jD]},$$scope:{ctx:n}};n[2]!==void 0&&(Xe.sort=n[2]),Z=new an({props:Xe}),me.push(()=>Re(Z,"sort",Be));let ut=n[4];const it=Te=>Te[24].id;for(let Te=0;Te<ut.length;Te+=1){let Ve=$h(n,ut,Te),Ze=it(Ve);ve.set(Ze,x[Te]=Th(Ze,Ve))}let Je=null;ut.length||(Je=Sh(n));let et=n[4].length&&Dh(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="
<span class="txt">New admin</span>`,h=D(),q(g.$$.fragment),v=D(),b=_("div"),y=_("table"),$=_("thead"),C=_("tr"),S=_("th"),T=D(),q(M.$$.fragment),E=D(),q(P.$$.fragment),F=D(),q(V.$$.fragment),te=D(),q(Z.$$.fragment),U=D(),Y=_("th"),G=D(),de=_("tbody");for(let Te=0;Te<x.length;Te+=1)x[Te].c();Je&&Je.c(),_e=D(),et&&et.c(),ge=Ue(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(S,"class","min-width"),p(Y,"class","col-type-action min-width"),p(y,"class","table"),ne(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Te,Ve){w(Te,e,Ve),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),H(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Te,h,Ve),H(g,Te,Ve),w(Te,v,Ve),w(Te,b,Ve),m(b,y),m(y,$),m($,C),m(C,S),m(C,T),H(M,C,null),m(C,E),H(P,C,null),m(C,F),H(V,C,null),m(C,te),H(Z,C,null),m(C,U),m(C,Y),m(y,G),m(y,de);for(let Ze=0;Ze<x.length;Ze+=1)x[Ze].m(de,null);Je&&Je.m(de,null),w(Te,_e,Ve),et&&et.m(Te,Ve),w(Te,ge,Ve),K=!0,ye||(oe=J(d,"click",n[9]),ye=!0)},p(Te,Ve){(!K||Ve&64)&&ue(o,Te[6]);const Ze={};Ve&2&&(Ze.value=Te[1]),g.$set(Ze);const tt={};Ve&134217728&&(tt.$$scope={dirty:Ve,ctx:Te}),!O&&Ve&4&&(O=!0,tt.sort=Te[2],He(()=>O=!1)),M.$set(tt);const dt={};Ve&134217728&&(dt.$$scope={dirty:Ve,ctx:Te}),!I&&Ve&4&&(I=!0,dt.sort=Te[2],He(()=>I=!1)),P.$set(dt);const be={};Ve&134217728&&(be.$$scope={dirty:Ve,ctx:Te}),!X&&Ve&4&&(X=!0,be.sort=Te[2],He(()=>X=!1)),V.$set(be);const Fe={};Ve&134217728&&(Fe.$$scope={dirty:Ve,ctx:Te}),!ee&&Ve&4&&(ee=!0,Fe.sort=Te[2],He(()=>ee=!1)),Z.$set(Fe),Ve&186&&(ut=Te[4],Ae(),x=ct(x,Ve,it,1,Te,ut,ve,de,Ut,Th,null,$h),Pe(),!ut.length&&Je?Je.p(Te,Ve):ut.length?Je&&(Je.d(1),Je=null):(Je=Sh(Te),Je.c(),Je.m(de,null))),(!K||Ve&32)&&ne(y,"table-loading",Te[5]),Te[4].length?et?et.p(Te,Ve):(et=Dh(Te),et.c(),et.m(ge.parentNode,ge)):et&&(et.d(1),et=null)},i(Te){if(!K){A(a.$$.fragment,Te),A(g.$$.fragment,Te),A(M.$$.fragment,Te),A(P.$$.fragment,Te),A(V.$$.fragment,Te),A(Z.$$.fragment,Te);for(let Ve=0;Ve<ut.length;Ve+=1)A(x[Ve]);K=!0}},o(Te){L(a.$$.fragment,Te),L(g.$$.fragment,Te),L(M.$$.fragment,Te),L(P.$$.fragment,Te),L(V.$$.fragment,Te),L(Z.$$.fragment,Te);for(let Ve=0;Ve<x.length;Ve+=1)L(x[Ve]);K=!1},d(Te){Te&&k(e),j(a),Te&&k(h),j(g,Te),Te&&k(v),Te&&k(b),j(M),j(P),j(V),j(Z);for(let Ve=0;Ve<x.length;Ve+=1)x[Ve].d();Je&&Je.d(),Te&&k(_e),et&&et.d(Te),Te&&k(ge),ye=!1,oe()}}}function BD(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[zD]},$$scope:{ctx:n}}});let r={};return l=new ND({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[18](null),j(l,a)}}}function UD(n,e,t){let i,s,l;rt(n,zo,F=>t(21,i=F)),rt(n,Nt,F=>t(6,s=F)),rt(n,Aa,F=>t(7,l=F)),tn(Nt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),we.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),we.errorResponseHandler(F,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}const T=F=>r==null?void 0:r.show(F),M=(F,V)=>{(V.code==="Enter"||V.code==="Space")&&(V.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function E(F){me[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Ci("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,$,C,S,T,M,O,E,P
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ne(a,"btn-disabled",n[2]),ne(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),m(e,a),u=!0,f||(c=J(e,"submit",Yt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),(!u||h&4)&&ne(a,"btn-disabled",d[2]),(!u||h&4)&&ne(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),j(s),j(o),f=!1,c()}}}function ZD(n){let e,t;return e=new o_({props:{$$slots:{default:[JD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function GD(n,e,t){let i;rt(n,zo,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),we.admins.authViaEmail(l,o).then(()=>{Ci("/")}).catch(()=>{ml("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class XD extends Ee{constructor(e){super(),Oe(this,e,GD,ZD,De,{})}}function QD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;i=new Ne({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[eO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[tO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[nO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new Ne({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[iO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Oh(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),c=D(),d=_("div"),h=_("div"),g=D(),M&&M.c(),v=D(),b=_("button"),y=_("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],ne(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),H(a,e,null),m(e,u),H(f,e,null),m(e,c),m(e,d),m(d,h),m(d,g),M&&M.m(d,null),m(d,v),m(d,b),m(b,y),C=!0,S||(T=J(b,"click",n[13]),S=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&1572865&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),a.$set(F);const V={};E&1572865&&(V.$$scope={dirty:E,ctx:O}),f.$set(V),O[3]?M?M.p(O,E):(M=Oh(O),M.c(),M.m(d,v)):M&&(M.d(1),M=null),(!C||E&12&&$!==($=!O[3]||O[2]))&&(b.disabled=$),(!C||E&4)&&ne(b,"btn-loading",O[2])},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),C=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),C=!1},d(O){O&&k(e),j(i),j(o),j(a),j(f),M&&M.d(),S=!1,T()}}}function xD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function eO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application name"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Me(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function tO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application url"),s=D(),l=_("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=J(s,"submit",Yt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Ae(),L(c[v],1,1,()=>{c[v]=null}),Pe(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function lO(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[sO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function oO(n,e,t){let i,s,l,o;rt(n,us,M=>t(14,s=M)),rt(n,$o,M=>t(15,l=M)),rt(n,Nt,M=>t(16,o=M)),tn(Nt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await we.settings.getAll()||{};g(M)}catch(M){we.errorResponseHandler(M)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const M=await we.settings.update(B.filterRedactedProps(a));g(M),sn("Successfully saved application settings.")}catch(M){we.errorResponseHandler(M)}t(2,f=!1)}}function g(M={}){var O,E;tn($o,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),tn(us,s=!!((E=M==null?void 0:M.meta)!=null&&E.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function v(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=Pt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const S=()=>v(),T=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,v,r,c,b,y,$,C,S,T]}class rO extends Ee{constructor(e){super(),Oe(this,e,oO,lO,De,{})}}function aO(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=at(l,s[o]);return{c(){e=_("input"),mi(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){mi(e,l=hn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Me(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function uO(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=at(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),mi(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||(o=[We(yt.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){mi(s,a=hn(r,[{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,Ye(o)}}}function fO(n){let e;function t(l,o){return l[3]?uO:aO}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:se,o:se,d(l){s.d(l),l&&k(e)}}}function cO(n,e,t){const i=["value","mask"];let s=Bt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await Zn(),r==null||r.focus()}const f=()=>u();function c(h){me[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=at(at({},e),li(h)),t(5,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class iu extends Ee{constructor(e){super(),Oe(this,e,cO,fO,De,{value:0,mask:1})}}function dO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=N("Subject"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder para
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=N(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=N("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Me(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[J(l,"input",n[13]),J(f,"click",n[14]),J(d,"click",n[15])],g=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&Me(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Ye(v)}}}function pO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=N("Action URL"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder parameters:
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=N(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=N(`,
`),g=_("span"),g.textContent="{TOKEN}",v=N("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m($,C){w($,e,C),m(e,t),w($,s,C),w($,l,C),Me(l,n[0].actionUrl),w($,r,C),w($,a,C),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[J(l,"input",n[16]),J(f,"click",n[17]),J(d,"click",n[18]),J(g,"click",n[19])],b=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&p(e,"for",i),C[1]&1&&o!==(o=$[31])&&p(l,"id",o),C[0]&1&&l.value!==$[0].actionUrl&&Me(l,$[0].actionUrl)},d($){$&&k(e),$&&k(s),$&&k(l),$&&k(r),$&&k(a),b=!1,Ye(y)}}}function hO(n){let e,t,i,s;return{c(){e=_("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),Me(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&Me(e,l[0].body)},i:se,o:se,d(l){l&&k(e),i=!1,s()}}}function mO(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=new o(r(n)),me.push(()=>Re(e,"value",l))),{c(){e&&q(e.$$.fragment),i=Ue()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,He(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&j(e,a)}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S;const T=[mO,hO],M=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=M[l]=T[l](n),{c(){e=_("label"),t=N("Body (HTML)"),s=D(),o.c(),r=D(),a=_("div"),u=N(`Available placeholder parameters:
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=N(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=N(`,
`),g=_("span"),g.textContent=`{TOKEN}
`,v=N(`,
`),b=_("span"),b.textContent=`{ACTION_URL}
`,y=N("."),p(e,"for",i=n[31]),p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(E,P){w(E,e,P),m(e,t),w(E,s,P),M[l].m(E,P),w(E,r,P),w(E,a,P),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),$=!0,C||(S=[J(f,"click",n[22]),J(d,"click",n[23]),J(g,"click",n[24]),J(b,"click",n[25])],C=!0)},p(E,P){(!$||P[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let I=l;l=O(E),l===I?M[l].p(E,P):(Ae(),L(M[I],1,1,()=>{M[I]=null}),Pe(),o=M[l],o?o.p(E,P):(o=M[l]=T[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){$||(A(o),$=!0)},o(E){L(o),$=!1},d(E){E&&k(e),E&&k(s),M[l].d(E),E&&k(r),E&&k(a),C=!1,Ye(S)}}}function _O(n){let e,t,i,s,l,o;return e=new Ne({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[dO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new Ne({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[pO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new Ne({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[gO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&k(t),j(i,r),r&&k(s),j(l,r)}}}function Eh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function bO(n){let e,t,i,s,l,o,r,a,u,f,c=n[6]&&Eh();return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),l=N(n[2]),o=D(),r=_("div"),a=D(),c&&c.c(),u=Ue(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&ue(l,d[2]),d[6]?c?h[0]&64&&A(c,1):(c=Eh(),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(a),c&&c.d(d),d&&k(u)}}}function vO(n){let e,t;const i=[n[8]];let s={$$slots:{header:[bO],default:[_O]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new sr({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){const r=o[0]&256?hn(i,[oi(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}function yO(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;rt(n,Vi,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function v(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await Pi(()=>import("./CodeEditor.0b64cb4e.js"),["CodeEditor.0b64cb4e.js","index.a9121ab1.js"],import.meta.url)).default),t(5,d=!1))}function y(G){B.copyToClipboard(G),s_(`Copied ${G} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),S=()=>y("{APP_URL}");function T(){u.actionUrl=this.value,t(0,u)}const M=()=>y("{APP_NAME}"),O=()=>y("{APP_UR
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[24]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function qO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],ne(s,"btn-loading",n[3])},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),m(s,l),r||(a=[J(e,"click",n[22]),J(s,"click",n[23])],r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f&8&&ne(s,"btn-loading",u[3])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,Ye(a)}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[EO,OO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[5]),r=D(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Yt(n[25])),v=!0)},p(S,T){(!g||T&32)&&ue(o,S[5]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function zO(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[VO]},$$scope:{ctx:n}}});let r={};return l=new DO({props:r}),n[26](l),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&1073741887&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[26](null),j(l,a)}}}function BO(n,e,t){let i,s,l;rt(n,Nt,ee=>t(5,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}];tn(Nt,l="Mail settings",l);let r,a={},u={},f=!1,c=!1;d();async function d(){t(2,f=!0);try{const ee=await we.settings.getAll()||{};g(ee)}catch(ee){we.errorResponseHandler(ee)}t(2,f=!1)}async function h(){if(!(c||!s)){t(3,c=!0);try{const ee=await we.settings.update(B.filterRedactedProps(u));g(ee),ri({}),sn("Successfully saved mail settings.")}catch(ee){we.errorResponseHandler(ee)}t(3,c=!1)}}function g(ee={}){t(0,u={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),t(9,a=JSON.parse(JSON.stringify(u)))}function v(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function b(){u.meta.senderName=this.value,t(0,u)}function y(){u.meta.senderAddress=this.value,t(0,u)}function $(ee){n.$$.not_equal(u.meta.verificationTemplate,ee)&&(u.meta.verificationTemplate=ee,t(0,u))}function C(ee){n.$$.not_equal(u.meta.resetPasswordTemplate,ee)&&(u.meta.resetPasswordTemplate=ee,t(0,u))}function S(ee){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,ee)&&(u.meta.confirmEmailChangeTemplate=ee,t(0,u))}function T(){u.smtp.enabled=this.checked,t(0,u)}function M(){u.smtp.host=this.value,t(0,u)}function O(){u.smtp.port=Pt(this.value),t(0,u)}function E(ee){n.$$.not_equal(u.smtp.tls,ee)&&(u.smtp.tls=ee,t(0,u))}function P(){u.smtp.username=this.value,t(0,u)}function I(ee){n.$$.not_equal(u.smtp.password,ee)&&(u.smtp.password=ee,t(0,u))}const F=()=>v(),V=()=>h(),X=()=>r==null?void 0:r.show(),te=()=>h();function Z(ee){me[ee?"unshift":"push"](()=>{r=ee,t(1,r)})}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(4,s=i!=JSON.stringify(u))},[u,r,f,c,s,l,o,h,v,a,i,b,y,$
the
`),r=_("strong"),u=N(a),f=N(`
to the
`),c=_("strong"),h=N(d),g=N(`.
`),v=_("br"),b=N(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,$=N(`,
`),C=_("a"),C.textContent=`s5cmd
`,S=N(", etc."),T=D(),M=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,v),m(l,b),m(l,y),m(l,$),m(l,C),m(l,S),m(e,T),m(e,M),E=!0},p(I,F){var V;(!E||F&1)&&a!==(a=(V=I[0].s3)!=null&&V.enabled?"S3 storage":"local file system")&&ue(u,a),(!E||F&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){E||(I&&Tt(()=>{O||(O=nt(e,on,{duration:150},!0)),O.run(1)}),E=!0)},o(I){I&&(O||(O=nt(e,on,{duration:150},!1)),O.run(0)),E=!1},d(I){I&&k(e),I&&O&&O.end()}}}function Fh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M;return i=new Ne({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[JO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[ZO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"s3.region",$$slots:{default:[GO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[XO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[QO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),$=new Ne({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[xO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(d.$$.fragment),h=D(),g=_("div"),q(v.$$.fragment),b=D(),y=_("div"),q($.$$.fragment),C=D(),S=_("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(y,"class","col-lg-12"),p(S,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),m(e,h),m(e,g),H(v,g,null),m(e,b),m(e,y),H($,y,null),m(e,C),m(e,S),M=!0},p(O,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&100663298&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const V={};E&100663298&&(V.$$scope={dirty:E,ctx:O}),d.$set(V);const X={};E&100663298&&(X.$$scope={dirty:E,ctx:O}),v.$set(X);const te={};E&100663298&&(te.$$scope={dirty:E,ctx:O}),$.$set(te)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(v.$$.fragment,O),A($.$$.fragment,O),O&&Tt(()=>{T||(T=nt(e,on,{duration:150},!0)),T.run(1)}),M=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(v.$$.fragment,O),L($.$$.fragment,O),O&&(T||(T=nt(e,on,{duration:150},!1)),T.run(0)),M=!1},d(O){O&&k(e),j(i),j(o),j(u),j(d),j(v),j($),O&&T&&T.end()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Endpoint"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&Me(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function ZO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Bucket"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function tE(n){let e,t,i,s;return{c(){e=_("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=We(t=yt.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Jn(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function nE(n){let e;return{c(){e=_("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Hh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),m(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function iE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[YO,WO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[7]),r=D(),a=_("div"),u=_("form"),f=_("div"),f.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>`,c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Yt(n[20])),v=!0)},p(S,T){(!g||T&128)&&ue(o,S[7]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function sE(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[iE]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}const Rr="s3_test_request";function lE(n,e,t){let i,s,l;rt(n,Nt,V=>t(7,l=V)),tn(Nt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;h();async function h(){t(2,a=!0);try{const V=await we.settings.getAll()||{};b(V)}catch(V){we.errorResponseHandler(V)}t(2,a=!1)}async function g(){if(t(5,c=null),!!r.s3.enabled){t(4,f=!0);try{await we.settings.testS3({$cancelKey:Rr})}catch(V){t(5,c=V)}t(4,f=!1)}}async function v(){if(!(u||!s)){t(3,u=!0),clearTimeout(d),d=setTimeout(()=>{we.cancelRequest(Rr),addErrorToast("S3 test connection timeout.")},3e4);try{we.cancelRequest(Rr);const V=await we.settings.update(B.filterRedactedProps(r));ri({}),await b(V),Z0(),c?J0("Successfully saved but failed to establish S3 connection."):sn("Successfully saved files storage settings.")}catch(V){we.errorResponseHandler(V)}clearTimeout(d),t(3,u=!1)}}async function b(V={}){t(1,r={s3:(V==null?void 0:V.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await g()}async function y(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await g()}function $(){r.s3.enabled=this.checked,t(1,r)}function C(){r.s3.endpoint=this.value,t(1,r)}function S(){r.s3.bucket=this.value,t(1,r)}function T(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function O(V){n.$$.not_equal(r.s3.secret,V)&&(r.s3.secret=V,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>y(),I=()=>v(),F=()=>v();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,v,y,i,$,C,S,T,M,O,E,P,I,F]}class oE extends Ee{constructor(e){super(),Oe(this,e,lE,sE,De,{})}}function rE(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=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),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function jh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Ne({props:{class:"form-field required",name:"emailAuth.minPasswordLength",$$slots:{default:[aE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailAuth.exceptDomains",$$slots:{default:[uE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailAuth.onlyDomains",$$slots:{default:[fE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(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),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null)
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function fE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),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,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=We(yt.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,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]+".config.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function cE(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[rE,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&jh(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Ue()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=jh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){j(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function dE(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 pE(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 qh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function hE(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?pE:dE}let u=a(n),f=u(n),c=n[2]&&qh();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=D(),f.c(),i=D(),s=_("div"),l=D(),c&&c.c(),o=Ue(),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,o,h),r=!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&&A(c,1):(c=qh(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){r||(A(c),r=!0)},o(d){L(c),r=!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(o)}}}function mE(n){let e,t;const i=[n[3]];let s={$$slots:{header:[hE],default:[cE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new sr({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&8?hn(i,[oi(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[12](null),j(e,l)}}}function gE(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;rt(n,Vi,S=>t(7,o=S));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=Pt(this.value),t(0,r)}function g(S){n.$$.not_equal(r.exceptDomains,S)&&(r.exceptDomains=S,t(0,r))}function v(S){n.$$.not_equal(r.onlyDomains,S)&&(r.onlyDomains=S,t(0,r))}function b(S){me[S?"unshift":"push"](()=>{a=S,t(1,a)})}function y(S){xe.call(this,n,S)}function $(S){xe.call(this,n,S)}function C(S){xe.call(this,n,S)}return n.$$set=S=>{e=at(at({},e),li(S)),t(3,l=Bt(e,s)),"config"in S&&t(0,r=S.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!B.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,$,C]}class _E extends Ee{constructor(e){super(),Oe(this,e,gE,mE,De,{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 bE(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[12]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Vh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Ne({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[vE,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[yE,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),c=new Ne({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[kE,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}});let v=n[4]&&zh(n);return{c(){e=_("div"),t=_("div"),i=D(),s=_("div"),q(l.$$.fragment),o=D(),r=_("div"),q(a.$$.fragment),u=D(),f=_("div"),q(c.$$.fragment),d=D(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),H(l,s,null),m(e,o),m(e,r),H(a,r,null),m(e,u),m(e,f),H(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const $={};y&2&&($.name=b[1]+".clientId"),y&25165825&&($.$$scope={dirty:y,ctx:b}),l.$set($);const C={};y&2&&(C.name=b[1]+".clientSecret"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),a.$set(C);const S={};y&2&&(S.name=b[1]+".allowRegistrations"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),c.$set(S),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=zh(b),v.c(),A(v,1),v.m(e,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{h||(h=nt(e,on,{duration:200},!0)),h.run(1)}),g=!0)},o(b){L(l.$$.fragment,b),L(a.$$.fragment,b),L(c.$$.fragment,b),L(v),b&&(h||(h=nt(e,on,{duration:200},!1)),h.run(0)),g=!1},d(b){b
another PocketBase environment.</p>`,t=D(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),q(o.$$.fragment),r=D(),a=_("div"),u=_("div"),f=D(),c=_("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-secondary fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(v,b){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),H(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){L(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),j(o),n[8](null),v&&k(r),v&&k(a),h=!1,Ye(g)}}}function YE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function KE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[YE,WE],g=[];function v(b,y){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[3]),r=D(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ue(o,b[3]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function JE(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[KE]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function ZE(n,e,t){let i,s;rt(n,Nt,b=>t(3,s=b)),tn(Nt,s="Export collections",s);const l="export_"+B.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await we.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){we.errorResponseHandler(b)}t(1,a=!1)}function f(){B.downloadJson(r,"pb_schema")}function c(){B.copyToClipboard(i),s_("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){me[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),$=document.createRange();$.selectNodeContents(o),y.removeAllRanges(),y.addRange($)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class GE extends Ee{constructor(e){super(),Oe(this,e,ZE,JE,De,{})}}function Xh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function xh(n,e,t){const i=n.slice();return i[14]=e[t],i}function em(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function tm(n,e,t){const i=n.slice();return i[14]=e[t],i}function nm(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function im(n,e,t){const i=n.slice();return i[30]=e[t],i}function XE(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&sm(),a=n[0].name!==n[1].name&&lm(n);return{c(){e=_("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=_("strong"),o=N(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=sm(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=lm(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function QE(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=D(),i=_("strong"),l=N(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?vo
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=_("tbody");for(let S=0;S<g.length;S+=1)g[S].c();r=D(),v&&v.c(),a=D();for(let S=0;S<y.length;S+=1)y[S].c();u=D();for(let S=0;S<C.length;S+=1)C[S].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(S,T){w(S,e,T),d.m(e,null),w(S,t,T),w(S,i,T),m(i,s),m(i,l),m(i,o);for(let M=0;M<g.length;M+=1)g[M].m(o,null);m(o,r),v&&v.m(o,null),m(o,a);for(let M=0;M<y.length;M+=1)y[M].m(o,null);m(o,u);for(let M=0;M<C.length;M+=1)C[M].m(o,null)},p(S,T){if(c===(c=f(S))&&d?d.p(S,T):(d.d(1),d=c(S),d&&(d.c(),d.m(e,null))),T[0]&7203){h=S[11];let M;for(M=0;M<h.length;M+=1){const O=im(S,h,M);g[M]?g[M].p(O,T):(g[M]=om(O),g[M].c(),g[M].m(o,r))}for(;M<g.length;M+=1)g[M].d(1);g.length=h.length}if(S[2]||S[5]?v?v.p(S,T):(v=rm(S),v.c(),v.m(o,a)):v&&(v.d(1),v=null),T[0]&4248){b=S[7];let M;for(M=0;M<b.length;M+=1){const O=xh(S,b,M);y[M]?y[M].p(O,T):(y[M]=dm(O),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=b.length}if(T[0]&4352){$=S[8];let M;for(M=0;M<$.length;M+=1){const O=Xh(S,$,M);C[M]?C[M].p(O,T):(C[M]=hm(O),C[M].c(),C[M].m(o,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},i:se,o:se,d(S){S&&k(e),d.d(),S&&k(t),S&&k(i),nn(g,S),v&&v.d(),nn(y,S),nn(C,S)}}}function Vn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function yn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function t5(n,e,t){let i,s,l,{collectionA:o=new dn}=e,{collectionB:r=new dn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const g=Object.keys(new dn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find($=>y.id==$.id))))}function b(y){return typeof y>"u"?"":B.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find($=>y.id==$.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find($=>$.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find($=>$.id==y.id))),n.$$.dirty[0]&7&&t(9,l=B.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,b]}class n5 extends Ee{constructor(e){super(),Oe(this,e,t5,e5,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function mm(n,e,t){const i=n.slice();return i[17]=e[t],i}function gm(n){let e,t;return e=new n5({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function i5(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=gm(mm(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Ue()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=mm(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=gm(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(Ae(),a=i.length;a<s.length;a+=1)l(a);Pe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){nn(s,o),o&&k(e)}}}function s5(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function l5(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=N("Close"),i=D(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=
- ${S.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await we.collections.import(o,a),sn("Successfully imported collections configuration."),i("submit")}catch(S){we.errorResponseHandler(S)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y(S){me[S?"unshift":"push"](()=>{s=S,t(1,s)})}function $(S){xe.call(this,n,S)}function C(S){xe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,$,C]}class a5 extends Ee{constructor(e){super(),Oe(this,e,r5,o5,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function _m(n,e,t){const i=n.slice();return i[32]=e[t],i}function bm(n,e,t){const i=n.slice();return i[35]=e[t],i}function vm(n,e,t){const i=n.slice();return i[32]=e[t],i}function u5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O;a=new Ne({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[c5,({uniqueId:X})=>({40:X}),({uniqueId:X})=>[0,X?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&km(),I=n[6]&&n[1].length&&n[7]&&wm(n),F=n[13].length&&Lm(n),V=!!n[0]&&Im(n);return{c(){e=_("input"),t=D(),i=_("div"),s=_("p"),l=N(`Paste below the collections configuration you want to import or
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),q(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),I&&I.c(),d=D(),F&&F.c(),h=D(),g=_("div"),V&&V.c(),v=D(),b=_("div"),y=D(),$=_("button"),C=_("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ne(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(C,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=S=!n[14],p(g,"class","flex m-t-base")},m(X,te){w(X,e,te),n[19](e),w(X,t,te),w(X,i,te),m(i,s),m(s,l),m(s,o),w(X,r,te),H(a,X,te),w(X,u,te),w(X,f,te),P&&P.m(X,te),w(X,c,te),I&&I.m(X,te),w(X,d,te),F&&F.m(X,te),w(X,h,te),w(X,g,te),V&&V.m(g,null),m(g,v),m(g,b),m(g,y),m(g,$),m($,C),T=!0,M||(O=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(X,te){(!T||te[0]&4096)&&ne(o,"btn-loading",X[12]);const Z={};te[0]&64&&(Z.class="form-field "+(X[6]?"":"field-error")),te[0]&65|te[1]&1536&&(Z.$$scope={dirty:te,ctx:X}),a.$set(Z),X[6]&&X[1].length&&!X[7]?P||(P=km(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),X[6]&&X[1].length&&X[7]?I?I.p(X,te):(I=wm(X),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),X[13].length?F?F.p(X,te):(F=Lm(X),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),X[0]?V?V.p(X,te):(V=Im(X),V.c(),V.m(g,v)):V&&(V.d(1),V=null),(!T||te[0]&16384&&S!==(S=!X[14]))&&($.disabled=S)},i(X){T||(A(a.$$.fragment,X),A(E),T=!0)},o(X){L(a.$$.fragment,X),L(E),T=!1},d(X){X&&k(e),n[19](null),X&&k(t),X&&k(i),X&&k(r),j(a,X),X&&k(u),X&&k(f),P&&P.d(X),X&&k(c),I&&I.d(X),X&&k(d),F&&F.d(X),X&&k(h),X&&k(g),V&&V.d(),M=!1,Ye(O)}}}function f5(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function ym(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function c5(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&ym();return{c(){e=_("label"),t=N("Collections"),s=D(),l=_("textarea"),r=D(),c&&c.c(),a=Ue(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Me(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=J(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Me(l,d[0]),!!d[0]&&!d[6]?c||(c=ym(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function km(n){let e;return{c(){e=_("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wm(n){let e,t,i,s,l,o=n[9].length&&$m(n),r=n[4].length&&Mm(n),a=n[8].length&&Em(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=D(),i=_("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=$m(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Mm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Em(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function $m(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=vm(n,s,o),a=l(r);t.set(a,e[o]=Cm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ue()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=ct(e,r,l,1,o,s,t,i.parentNode,pn,Cm,i,vm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Sm(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Cm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Sm(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=D(),l=_("strong"),r=N(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=Sm(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Mm(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=bm(n,s,o),a=l(r);t.set(a,e[o]=Om(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ue()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=ct(e,r,l,1,o,s,t,i.parentNode,pn,Om,i,bm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Tm(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function Dm(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Om(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&Tm(e),h=e[35].new.id&&Dm(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=D(),l=_("div"),d&&d.c(),o=D(),r=_("strong"),u=N(a),f=D(),h&&h.c(),c=D(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(g,v){w(g,t,v),m(t,i),m(t,s),m(t,l),d&&d.m(l,null),m(l,o),m(l,r),m(r,u),m(l,f),h&&h.m(l,null),m(t,c)},p(g,v){e=g,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=Tm(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ue(u,a),e[35].new.id?h?h.p(e,v):(h=Dm(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&k(t),d&&d.d(),h&&h.d()}}}function Em(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=_m(n,s,o),a=l(r);t.set(a,e[o]=Pm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ue()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=ct(e,r,l,1,o,s,t,i.parentNode,pn,Pm,i,_m))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Am(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=_("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:se,d(u){u&&k(e),r=!1,a()}}}function Im(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function d5(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[f5,u5],g=[];function v(b,y){return b[5]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[15]),r=D(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ue(o,b[15]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function p5(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[d5]},$$scope:{ctx:n}}});let r={};return l=new a5({props:r}),n[27](l),l.$on("submit",n[28]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[27](null),j(l,a)}}}function h5(n,e,t){let i,s,l,o,r,a,u;rt(n,Nt,G=>t(15,u=G)),tn(Nt,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],$=!1;C();async function C(){t(5,$=!0);try{t(2,v=await we.collections.getFullList(200));for(let G of v)delete G.created,delete G.updated}catch(G){we.errorResponseHandler(G)}t(5,$=!1)}function S(){if(t(4,y=[]),!!i)for(let G of g){const de=B.findByKey(v,"id",G.id);!(de!=null&&de.id)||!B.hasCollectionChanges(de,G,b)||y.push({new:G,old:de})}}function T(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=B.filterDuplicatesByKey(g)):t(1,g=[]);for(let G of g)delete G.created,delete G.updated,G.schema=B.filterDuplicatesByKey(G.schema)}function M(){var G,de;for(let x of g){const ve=B.findByKey(v,"name",x.name)||B.findByKey(v,"id",x.id);if(!ve)continue;const _e=x.id,ge=ve.id;x.id=ge;const K=Array.isArray(ve.schema)?ve.schema:[],ye=Array.isArray(x.schema)?x.schema:[];for(const oe of ye){const W=B.findByKey(K,"name",oe.name);W&&W.id&&(oe.id=W.id)}for(let oe of g)if(!!Array.isArray(oe.schema))for(let W of oe.schema)((G=W.options)==null?void 0:G.collectionId)&&((de=W.options)==null?void 0:de.collectionId)===_e&&(W.options.collectionId=ge)}t(0,d=JSON.stringify(g,null,4))}function O(G){t(12,h=!0);const de=new FileReader;de.onload=async x=>{t(12,h=!1),t(10,f.value="",f),t(0,d=x.target.result),await Zn(),g.length||(ml("Invalid collections configuration."),E())},de.onerror=x=>{console.warn(x),ml("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},de.readAsText(G)}function E(){t(0,d=""),t(10,f.value="",f),ri({})}function P(G){me[G?"unshift":"push"](()=>{f=G,t(10,f)})}const I=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function V(){d=this.value,t(0,d)}function X(){b=this.checked,t(3,b)}const te=()=>M(),Z=()=>E(),ee=()=>c==null?void 0:c.show(v,g,b);function U(G){me[G?"unshift":"push"](()=>{c=G,t(11,c)})}const Y=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&T(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(G=>i&&b&&!B.findByKey(g,"id"
<span class="txt">Manage admins</span>`,t=D(),i=_("hr"),s=D(),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),o||(r=[We(gn.call(null,e)),J(l,"click",n[6])],o=!0)},p:se,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Ye(r)}}}function A5(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=B.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&Rm(n);return o=new Nb({props:{routes:g5}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new S5({}),f=new O5({}),{c(){t=D(),i=_("div"),d&&d.c(),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),H(o,l,null),m(l,r),H(a,l,null),w(g,u,v),H(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=B.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=Rm(g),d.c(),A(d,1),d.m(i,s)):d&&(Ae(),L(d,1,1,()=>{d=null}),Pe())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){L(d),L(o.$$.fragment,g),L(a.$$.fragment,g),L(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),j(o),j(a),g&&k(u),j(f,g)}}}function P5(n,e,t){let i,s,l,o;rt(n,us,h=>t(8,i=h)),rt(n,$o,h=>t(2,s=h)),rt(n,Aa,h=>t(0,l=h)),rt(n,Nt,h=>t(3,o=h));let r,a=!1;function u(h){var g,v,b,y;((g=h==null?void 0:h.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((b=(v=h==null?void 0:h.detail)==null?void 0:v.userData)!=null&&b.showAppSidebar)),r=(y=h==null?void 0:h.detail)==null?void 0:y.location,tn(Nt,o="",o),ri({}),rb())}function f(){Ci("/")}async function c(){var h,g;if(!!(l!=null&&l.id))try{const v=await we.settings.getAll({$cancelKey:"initialAppSettings"});tn($o,s=((h=v==null?void 0:v.meta)==null?void 0:h.appName)||"",s),tn(us,i=!!((g=v==null?void 0:v.meta)!=null&&g.hideControls),i)}catch(v){console.warn("Failed to load app settings.",v)}}function d(){we.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class L5 extends Ee{constructor(e){super(),Oe(this,e,P5,A5,De,{})}}new L5({target:document.getElementById("app")});export{Ye as A,sn as B,B as C,Ci as D,Ue as E,o_ as F,ya as G,rt as H,Ps as I,Qt as J,dn as K,Nn as L,me as M,ou as N,Ee as S,L as a,D as b,q as c,j as d,_ as e,p as f,w as g,m as h,Oe as i,We as j,Ae as k,gn as l,H as m,Pe as n,k as o,we as p,Ne as q,ne as r,De as s,A as t,J as u,Yt as v,N as w,ue as x,se as y,Me as z};