184 lines
852 KiB
JavaScript
184 lines
852 KiB
JavaScript
|
(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 X(){}const kl=n=>n;function Ge(n,e){for(const t in e)n[t]=e[t];return n}function bb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Nm(n){return n()}function su(){return Object.create(null)}function Le(n){n.forEach(Nm)}function Zt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function jn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function vb(n){return Object.keys(n).length===0}function Fm(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ke(n,e,t){n.$$.on_destroy.push(Fm(e,t))}function Nt(n,e,t,i){if(n){const s=Rm(n,e,t,i);return n[0](s)}}function Rm(n,e,t,i){return n[1]&&i?Ge(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(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 Rt(n,e,t,i,s,l){if(s){const o=Rm(e,t,i,l);n.p(o,s)}}function Ht(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 Gn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ot(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 yi(n){return n??""}function Wt(n,e,t){return n.set(t),e}function Ie(n){return n&&Zt(n.destroy)?n.destroy:X}const Hm=typeof window<"u";let No=Hm?()=>window.performance.now():()=>Date.now(),fa=Hm?n=>requestAnimationFrame(n):X;const bs=new Set;function jm(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&fa(jm)}function Fo(n){let e;return bs.size===0&&fa(jm),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function _(n,e){n.appendChild(e)}function qm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function yb(n){const e=v("style");return kb(qm(n),e),e.sheet}function kb(n,e){return _(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function yt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function D(){return U(" ")}function Oe(){return U("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ct(n){return function(e){return e.preventDefault(),n.call(this,e)}}function bn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Zn(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 dt(n){return n===""?null:+n}function wb(n){return Array.from(n.childNodes)}function re(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function fe(n,e){n.value=e??""}function Ar(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList[t?"add":"remove"](e)}function Vm(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEven
|
||
|
`;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_${Sb(f)}_${r}`,d=qm(n),{stylesheet:h,rules:m}=po.get(d)||$b(d,n);m[c]||(m[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function al(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(", "),ho-=s,ho||Cb())}function Cb(){fa(()=>{ho||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function Tb(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,m;function g(){c&&(m=rl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&al(n,m),d=!1}return Fo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const k=y-a,$=0+1*r(k/o);f($,1-$)}return!0}),g(),f(0,1),b}function Mb(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,zm(n,s)}}function zm(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 ul;function li(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function un(n){wl().$$.on_mount.push(n)}function Db(n){wl().$$.after_update.push(n)}function Bm(n){wl().$$.on_destroy.push(n)}function Ct(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Vm(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Be(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ms=[],ie=[],oo=[],Ir=[],Um=Promise.resolve();let Pr=!1;function Wm(){Pr||(Pr=!0,Um.then(ca))}function In(){return Wm(),Um}function tt(n){oo.push(n)}function we(n){Ir.push(n)}const xo=new Set;let us=0;function ca(){if(us!==0)return;const n=ul;do{try{for(;us<ms.length;){const e=ms[us];us++,li(e),Ob(e.$$)}}catch(e){throw ms.length=0,us=0,e}for(li(null),ms.length=0,us=0;ie.length;)ie.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];xo.has(t)||(xo.add(t),t())}oo.length=0}while(ms.length);for(;Ir.length;)Ir.pop()();Pr=!1,xo.clear(),li(n)}function Ob(n){if(n.fragment!==null){n.update(),Le(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}let Rs;function da(){return Rs||(Rs=Promise.resolve(),Rs.then(()=>{Rs=null})),Rs}function Bi(n,e,t){n.dispatchEvent(Vm(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Yn;function de(){Yn={r:0,c:[],p:Yn}}function pe(){Yn.r||Le(Yn.c),Yn=Yn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Yn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pa={duration:0};function Ym(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&al(n,o)}function f(){const{delay:d=0,duration:h=300,easing:m=kl,tick:g=X,css:b}=s||pa;b&&(o=rl(n,0,1,h,d,m,b,a++)),g(0,1);const y=No()+d,k=y+h;r&&r.abort(),l=!0,tt(()=>Bi(n,!0,"start")),r=Fo($=>{if(l){if($>=k)return g(1,0),Bi(n,!0,"end"),u(),l=!1;if($>=y){const C=m(($-y)/h);g(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),Zt(s)?(s=s(i),da().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function Km(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Yn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=X,css:h}=s||pa;h&&(o=rl(n,1,0,f,u,c,h));const m=No()+u,g=m+f;tt(()=>Bi(n,!1,"start")),Fo(b=>{if(l){if(b>=g)return d(0,1),Bi(n,!1,"end"),--r.r||Le(r.c),!1;if(b>=m){const y=c((b-m)/f);d(1-y,y)}}return l})}return Zt(s)?da().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(
|
||
|
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function ov(n){let e,t,i,s=!n[0]&&Hu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=v("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){S(r,e,a),s&&s.m(e,null),_(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Hu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):Ht(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function rv(n){let e,t;return e=new vn({props:{class:"full-page",center:!0,$$slots:{default:[ov]},$$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){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function av(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 t_ extends ke{constructor(e){super(),ye(this,e,av,rv,be,{nobranding:0})}}function ju(n,e,t){const i=n.slice();return i[11]=e[t],i}const uv=n=>({}),qu=n=>({uniqueId:n[3]});function fv(n){let e=(n[11]||bo)+"",t;return{c(){t=U(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||bo)+"")&&re(t,e)},d(i){i&&w(t)}}}function cv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||bo)+"",i;return{c(){e=v("pre"),i=U(t)},m(o,r){S(o,e,r),_(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)||bo)+"")&&re(i,t)},d(o){o&&w(e)}}}function Vu(n){let e,t;function i(o,r){return typeof o[11]=="object"?cv:fv}let s=i(n),l=s(n);return{c(){e=v("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){S(o,e,r),l.m(e,null),_(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&&w(e),l.d()}}}function dv(n){let e,t,i,s,l;const o=n[7].default,r=Nt(o,n,n[6],qu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Vu(ju(n,a,f));return{c(){e=v("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),x(e,"error",n[2].length)},m(f,c){S(f,e,c),r&&r.m(e,null),_(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=Y(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Rt(r,o,f,f[6],i?Ft(o,f[6],c,uv):Ht(f[6]),qu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=ju(f,a,d);u[d]?u[d].p(h,c):(u[d]=Vu(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)&&x(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&w(e),r&&r.d(f),yt(u,f),n[9](null),s=!1,l()}}}const bo="Invalid value";function pv(n,e,t){let i;Ke(n,Ci,m=>t(5,i=m));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(){Cs(r)}un(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(m){Be.call(this,n,m)}function h(m){ie[m?"unshift":"push"](()=>{u=m,t(1,u)})}return n.$$set=m=>{"name"in m&&t(4,r=m.name),"class"in m&&t(0,a=m.class),"$$scope"in m&&t(6,l=m.$$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 me extends ke{constructor(e){super(),ye(this,e,pv,dv,be,{name:4,class:0})}}function hv(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=D(),l=v("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){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(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]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=D(),l=v("input"),r=D(),a=v(
|
||
|
<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"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(m,g){S(m,e,g),_(e,t),_(e,i),H(s,e,null),_(e,l),H(o,e,null),_(e,r),H(a,e,null),_(e,u),_(e,f),c=!0,d||(h=Y(e,"submit",ct(n[4])),d=!0)},p(m,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:m}),s.$set(b);const y={};g&1538&&(y.$$scope={dirty:g,ctx:m}),o.$set(y);const k={};g&1540&&(k.$$scope={dirty:g,ctx:m}),a.$set(k),(!c||g&8)&&x(f,"btn-disabled",m[3]),(!c||g&8)&&x(f,"btn-loading",m[3])},i(m){c||(A(s.$$.fragment,m),A(o.$$.fragment,m),A(a.$$.fragment,m),c=!0)},o(m){P(s.$$.fragment,m),P(o.$$.fragment,m),P(a.$$.fragment,m),c=!1},d(m){m&&w(e),j(s),j(o),j(a),d=!1,h()}}}function bv(n,e,t){const i=Ct();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await he.admins.create({email:s,password:l,passwordConfirm:o}),await he.admins.authWithPassword(s,l),i("submit")}catch(d){he.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 vv extends ke{constructor(e){super(),ye(this,e,bv,_v,be,{})}}function zu(n){let e,t;return e=new t_({props:{$$slots:{default:[yv]},$$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){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function yv(n){let e,t;return e=new vv({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function kv(n){let e,t,i=n[0]&&zu(n);return{c(){i&&i.c(),e=Oe()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=zu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(de(),P(i,1,1,()=>{i=null}),pe())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function wv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){he.logout(!1),t(0,i=!0);return}he.authStore.isValid?$i("/collections"):he.logout()}return[i,async()=>{t(0,i=!1),await In(),window.location.search=""}]}class Sv extends ke{constructor(e){super(),ye(this,e,wv,kv,be,{})}}const kt=Pn(""),vo=Pn(""),Ts=Pn(!1);function Bo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function On(n,{delay:e=0,duration:t=400,easing:i=Bo,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);
|
||
|
opacity: ${a-f*d}`}}function Et(n,{delay:e=0,duration:t=400,easing:i=Bo}={}){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 At(n,{delay:e=0,duration:t=400,easing:i=Bo,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=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),fe(e,n[7]),i||(s=Y(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]&&fe(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function Cv(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=Yt(o,r(n)),ie.push(()=>ve(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=Oe()},m(a,u){e&&H(e,a,u),S(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],we(()=>t=!1)),o!==(o=a[4])){if(e){de();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),pe()}o?(e=Yt(o,r(a)),ie.push(()=>ve(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&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Bu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Uu();return{c(){r&&r.c(),e=D(),t=v("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Uu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(de(),P(r,1,1,()=>{r=null}),pe())},i(a){s||(A(r),a&&tt(()=>{i||(i=qe(t,On,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=qe(t,On,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Uu(n){let e,t,i;return{c(){e=v("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){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{t||(t=qe(e,On,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,On,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Tv(n){let e,t,i,s,l,o,r,a,u,f;const c=[Cv,$v],d=[];function h(g,b){return g[4]&&!g[5]?0:1}l=h(n),o=d[l]=c[l](n);let m=(n[0].length||n[7].length)&&Bu(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=D(),o.c(),r=D(),m&&m.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(g,b){S(g,e,b),_(e,t),_(t,i),_(e,s),d[l].m(e,null),_(e,r),m&&m.m(e,null),a=!0,u||(f=[Y(e,"click",bn(n[11])),Y(e,"submit",ct(n[10]))],u=!0)},p(g,[b]){let y=l;l=h(g),l===y?d[l].p(g,b):(de(),P(d[y],1,1,()=>{d[y]=null}),pe(),o=d[l],o?o.p(g,b):(o=d[l]=c[l](g),o.c()),A(o,1),o.m(e,r)),g[0].length||g[7].length?m?(m.p(g,b),b&129&&A(m,1)):(m=Bu(g),m.c(),A(m,1),m.m(e,null)):m&&(de(),P(m,1,1,()=>{m=null}),pe())},i(g){a||(A(o),A(m),a=!0)},o(g){P(o),P(m),a=!1},d(g){g&&w(e),d[l].d(),m&&m.d(),u=!1,Le(f)}}}function Mv(n,e,t){const i=Ct(),s="search_"+B.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new gn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function m(){t(0,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-1e85f96b.js"),["./FilterAutocompleteInput-1e85f96b.js","./index-0935db40.js"],import.meta.url)).default),t(5,f=!1))}un(()=>{g()});function b(M){Be.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function k(M){ie[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const C=()=>{h(!1),m()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,m,b,y,k,$,C]}class Uo extends ke{cons
|
||
|
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function zv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Bv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Uv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="User IP",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Wv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Yv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Zu(n){let e;function t(l,o){return l[6]?Jv:Kv}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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&&w(e)}}}function Kv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Gu(n);return{c(){e=v("tr"),t=v("td"),i=v("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){S(a,e,u),_(e,t),_(t,i),_(t,s),o&&o.m(t,null),_(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&&w(e),o&&o.d()}}}function Jv(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
|
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Gu(n){let e,t,i;return{c(){e=v("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){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Xu(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Qu(n,e){var Ce,$e,Ye;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,h,m,g,b,y,k=(e[23].referer||"N/A")+"",$,C,M,T,E,O=(e[23].userIp||"N/A")+"",I,L,N,F,V,G=e[23].status+"",se,K,te,ne,z,Q,J,ae,He,Fe,Ne=((($e=e[23].meta)==null?void 0:$e.errorMessage)||((Ye=e[23].meta)==null?void 0:Ye.errorData))&&Xu();ne=new Zi({props:{date:e[23].created}});function Re(){return e[17](e[23])}function ge(...ze){return e[18](e[23],...ze)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=D(),u=v("td"),f=v("span"),d=U(c),m=D(),Ne&&Ne.c(),g=D(),b=v("td"),y=v("span"),$=U(k),M=D(),T=v("td"),E=v("span"),I=U(O),N=D(),F=v("td"),V=v("span"),se=U(G),K=D(),te=v("td"),q(ne.$$.fragment),z=D(),Q=v("td"),Q.innerHTML='<i class="ri-arrow-right-line"></i>',J=D(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",C=e[23].referer),x(y,"txt-hint",!e[23].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","txt txt-ellipsis"),p(E,"title",L=e[23].userIp),x(E,"txt-hint",!e[23].userIp),p(T,"class","col-type-number col-field-userIp"),p(V,"class","label"),x(V,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(te,"class","col-type-date col-field-created"),p(Q,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ze,oe){S(ze,t,oe),_(t,i),_(i,s),_(s,o),_(t,a),_(t,u),_(u,f),_(f,d),_(u,m),Ne&&Ne.m(u,null),_(t,g),_(t,b),_(b,y),_(y,$),_(t,M),_(t,T),_(T,E),_(E,I),_(t,N),_(t,F),_(F,V),_(V,se),_(t,K),_(t,te),H(ne,te,null),_(t,z),_(t,Q),_(t,J),ae=!0,He||(Fe=[Y(t,"click",Re),Y(t,"keydown",ge)],He=!0)},p(ze,oe){var Z,ce,Se;e=ze,(!ae||oe&8)&&l!==(l=((Z=e[23].method)==null?void 0:Z.toUpperCase())+"")&&re(o,l),(!ae||oe&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ae||oe&8)&&c!==(c=e[23].url+"")&&re(d,c),(!ae||oe&8&&h!==(h=e[23].url))&&p(f,"title",h),(ce=e[23].meta)!=null&&ce.errorMessage||(Se=e[23].meta)!=null&&Se.errorData?Ne||(Ne=Xu(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!ae||oe&8)&&k!==(k=(e[23].referer||"N/A")+"")&&re($,k),(!ae||oe&8&&C!==(C=e[23].referer))&&p(y,"title",C),(!ae||oe&8)&&x(y,"txt-hint",!e[23].referer),(!ae||oe&8)&&O!==(O=(e[23].userIp||"N/A")+"")&&re(I,O),(!ae||oe&8&&L!==(L=e[23].userIp))&&p(E,"title",L),(!ae||oe&8)&&x(E,"txt-hint",!e[23].userIp),(!ae||oe&8)&&G!==(G=e[23].status+"")&&re(se,G),(!ae||oe&8)&&x(V,"label-danger",e[23].status>=400);const ue={};oe&8&&(ue.date=e[23].created),ne.$set(ue)},i(ze){ae||(A(ne.$$.fragment,ze),ae=!0)},o(ze){P(ne.$$.fragment,ze),ae=!1},d(ze){ze&&w(t),Ne&&Ne.d(),j(ne),He=!1,Le(Fe)}}}function Zv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I=[],L=new Map,N;function F(ge){n[11](ge)}let V={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Vv]},$$scope:{ctx:n}};n[1]!==void 0&&(V.sort=n[1]),s=new Bt({props:V}),ie.push(()=>ve(s,"sort",F));function G(ge){n[12](ge)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[zv]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),r=new Bt({props:se}),ie.push(()=>ve(r,"sort",G));function K(ge){n[13](ge)}let te={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Bv]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),f=new Bt({props:te}),ie.push(()=>ve(f,"sort",K));function ne(ge){n[14](ge)}let z={disable:!0,class:"col-type-number col-fiel
|
||
|
* Chart.js v3.9.1
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/function ti(){}const xv=function(){let n=0;return function(){return n++}}();function ot(n){return n===null||typeof n>"u"}function ht(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 Ze(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const $t=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function wn(n,e){return $t(n)?n:e}function xe(n,e){return typeof n>"u"?e:n}const ey=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,i_=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function bt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function at(n,e,t,i){let s,l,o;if(ht(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(Ze(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function ko(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 wo(n){if(ht(n))return n.map(wo);if(Ze(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=wo(n[t[s]]);return e}return n}function s_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function ty(n,e,t,i){if(!s_(n))return;const s=e[n],l=t[n];Ze(s)&&Ze(l)?dl(s,l,i):e[n]=wo(l)}function dl(n,e,t){const i=ht(e)?e:[e],s=i.length;if(!Ze(n))return n;t=t||{};const l=t.merger||ty;for(let o=0;o<s;++o){if(e=i[o],!Ze(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 tl(n,e){return dl(n,e,{merger:ny})}function ny(n,e,t){if(!s_(n))return;const i=e[n],s=t[n];Ze(i)&&Ze(s)?tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=wo(s))}const tf={"":n=>n,x:n=>n.x,y:n=>n.y};function ki(n,e){return(tf[e]||(tf[e]=iy(e)))(n)}function iy(n){const e=sy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function sy(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 Ea(n){return n.charAt(0).toUpperCase()+n.slice(1)}const En=n=>typeof n<"u",wi=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 ly(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const wt=Math.PI,ft=2*wt,oy=ft+wt,So=Number.POSITIVE_INFINITY,ry=wt/180,vt=wt/2,zs=wt/4,sf=wt*2/3,Tn=Math.log10,Jn=Math.sign;function lf(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Tn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function ay(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 Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)<t}function uy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function l_(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 Hn(n){return n*(wt/180)}function Aa(n){return n*(180/wt)}function of(n){if(!$t(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function o_(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+=ft),{angle:l,distance:s}}function Jr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function fy(n,e){return(n-e+oy)%ft-wt}function hn(n){return(n%ft+ft)%ft}function pl(n,e,t,i){const s=hn(n),l=hn(e),o=hn(t),r=hn(l-s),a=hn(o-s),u=hn(s-l),f=hn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Ut(n,e,t){return Math.max(e,Math.min(t,n))}function cy(n){return Ut(n,-32768,32767)}function hl(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 zi=(n,e,t,i)=>Ia(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),dy=(n,e,t)=>Ia(n,t,i=>n[i][e]>=t);function py(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 mi=(n,e,t)=>Math.max(Math.min(n,t),e);function Xs(n){return mi(Ol(n*2.55),0,255)}function vi(n){return mi(Ol(n*255),0,255)}function si(n){return mi(Ol(n/2.55)/100,0,1)}function cf(n){return mi(Ol(n*100),0,100)}const kn={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},Zr=[..."0123456789ABCDEF"],_y=n=>Zr[n&15],by=n=>Zr[(n&240)>>4]+Zr[n&15],Wl=n=>(n&240)>>4===(n&15),vy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function yy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&kn[n[1]]*17,g:255&kn[n[2]]*17,b:255&kn[n[3]]*17,a:e===5?kn[n[4]]*17:255}:(e===7||e===9)&&(t={r:kn[n[1]]<<4|kn[n[2]],g:kn[n[3]]<<4|kn[n[4]],b:kn[n[5]]<<4|kn[n[6]],a:e===9?kn[n[7]]<<4|kn[n[8]]:255})),t}const ky=(n,e)=>n<255?e(n):"";function wy(n){var e=vy(n)?_y:by;return n?"#"+e(n.r)+e(n.g)+e(n.b)+ky(n.a,e):void 0}const Sy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function p_(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 $y(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 Cy(n,e,t){const i=p_(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 Ty(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 Pa(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=Ty(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function La(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(vi)}function Na(n,e,t){return La(p_,n,e,t)}function My(n,e,t){return La(Cy,n,e,t)}function Dy(n,e,t){return La($y,n,e,t)}function h_(n){return(n%360+360)%360}function Oy(n){const e=Sy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):vi(+e[5]));const s=h_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=My(s,l,o):e[1]==="hsv"?i=Dy(s,l,o):i=Na(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Ey(n,e){var t=Pa(n);t[0]=h_(t[0]+e),t=Na(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Ay(n){if(!n)return;const e=Pa(n),t=e[0],i=cf(e[1]),s=cf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${si(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 L2{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=u_.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 ni=new L2;const Cf="transparent",N2={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 F2{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||N2[e.type||typeof o],this._easing=il[e.easing]||il.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=Jl([e.to,t,s,e.from]),this._from=Jl([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 R2=["x","y","borderWidth","radius","tension"],H2=["color","borderColor","backgroundColor"];et.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 j2=Object.keys(et.animation);et.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});et.set("animations",{colors:{type:"color",properties:H2},numbers:{type:"number",properties:R2}});et.describe("animations",{_fallback:"animation"});et.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 O_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ze(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ze(s))return;const l={};for(con
|
||
|
`)>-1?n.split(`
|
||
|
`):n}function tS(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=mn(e.bodyFont),u=mn(e.titleFont),f=mn(e.footerFont),c=l.length,d=s.length,h=i.length,m=An(e.padding);let g=m.height,b=0,y=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=h*C+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let k=0;const $=function(C){b=Math.max(b,t.measureText(C).width+k)};return t.save(),t.font=u.string,at(n.title,$),t.font=a.string,at(n.beforeBody.concat(n.afterBody),$),k=e.displayColors?o+2+e.boxPadding:0,at(i,C=>{at(C.before,$),at(C.lines,$),at(C.after,$)}),k=0,t.font=f.string,at(n.footer,$),t.restore(),b+=m.width,{width:b,height:g}}function nS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function iS(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 sS(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"),iS(u,n,e,t)&&(u="center"),u}function ic(n,e,t){const i=t.yAlign||e.yAlign||nS(n,t);return{xAlign:t.xAlign||e.xAlign||sS(n,e,t,i),yAlign:i}}function lS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function oS(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}=ys(o);let m=lS(e,r);const g=oS(e,a,u);return a==="center"?r==="left"?m+=u:r==="right"&&(m-=u):r==="left"?m-=Math.max(f,d)+s:r==="right"&&(m+=Math.max(c,h)+s),{x:Ut(m,0,i.width-e.width),y:Ut(g,0,i.height-e.height)}}function to(n,e,t){const i=An(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 Wn([],ii(n))}function rS(n,e,t){return Ti(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 sa extends ai{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 O_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=rS(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=Wn(r,ii(s)),r=Wn(r,ii(l)),r=Wn(r,ii(o)),r}getBeforeBody(e,t){return lc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return at(e,l=>{const o={before:[],lines:[],after:[]},r=oc(i,l);Wn(o.before,ii(r.beforeLabel.call(this,l))
|
||
|
* chartjs-adapter-luxon v1.3.0
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 chartjs-adapter-luxon Contributors
|
||
|
* Released under the MIT license
|
||
|
*/const DS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};L_._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return DS},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=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.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=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{t||(t=qe(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,At,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function OS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=D(),s=U(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&re(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&re(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function ES(n){let e;return{c(){e=U("Loading...")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function AS(n){let e,t,i,s,l,o=n[2]&&hc();function r(f,c){return f[2]?ES:OS}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=D(),i=v("canvas"),s=D(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Ar(i,"height","250px"),Ar(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),_(e,t),_(e,i),n[8](i),S(f,s,c),S(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&&(de(),P(o,1,1,()=>{o=null}),pe()),c&4&&x(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){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function IS(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),he.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let m of h)r.push({x:new Date(m.date),y:m.total}),t(1,a+=m.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),he.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}un(()=>(Ao.register(Mi,Jo,Yo,Xa,Pl,eS,aS),t(6,o=new Ao(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){ie[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.data.datasets[0].data=r,o),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 k($){return $ instanceof a?new a($.type,k($.content),$.alias):Array.isArray($)?$.map(k):$.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k($,C){C=C||{};var M,T;switch(r.util.type($)){case"Object":if(T=r.util.objId($),C[T])return C[T];M={},C[T]=M;for(var E in $)$.hasOwnProperty(E)&&(M[E]=k($[E],C));return M;case"Array":return T=r.util.objId($),C[T]?C[T]:(M=[],C[T]=M,$.forEach(function(O,I){M[I]=k(O,C)}),M);default:return $}},getLanguage:function(k){for(;k;){var $=s.exec(k.className);if($)return $[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,$){k.className=k.className.replace(RegExp(s,"gi"),""),k.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(k){var $=document.getElementsByTagName("script");for(var C in $)if($[C].src==k)return $[C]}return null}},isActive:function(k,$,C){for(var M="no-"+$;k;){var T=k.classList;if(T.contains($))return!0;if(T.contains(M))return!1;k=k.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(k,$){var C=r.util.clone(r.languages[k]);for(var M in $)C[M]=$[M];return C},insertBefore:function(k,$,C,M){M=M||r.languages;var T=M[k],E={};for(var O in T)if(T.hasOwnProperty(O)){if(O==$)for(var I in C)C.hasOwnProperty(I)&&(E[I]=C[I]);C.hasOwnProperty(O)||(E[O]=T[O])}var L=M[k];return M[k]=E,r.languages.DFS(r.languages,function(N,F){F===L&&N!=k&&(this[N]=E)}),E},DFS:function k($,C,M,T){T=T||{};var E=r.util.objId;for(var O in $)if($.hasOwnProperty(O)){C.call($,O,$[O],M||O);var I=$[O],L=r.util.type(I);L==="Object"&&!T[E(I)]?(T[E(I)]=!0,k(I,C,null,T)):L==="Array"&&!T[E(I)]&&(T[E(I)]=!0,k(I,C,O,T))}}},plugins:{},highlightAll:function(k,$){r.highlightAllUnder(document,k,$)},highlightAllUnder:function(k,$,C){var M={callback:C,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var T=0,E;E=M.elements[T++];)r.highlightElement(E,$===!0,M.callback)},highlightElement:function(k,$,C){var M=r.util.getLanguage(k),T=r.languages[M];r.util.setLanguage(k,M);var E=k.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=k.textContent,I={element:k,language:M,grammar:T,code:O};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),E=I.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if($&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(k,$,C){var M={code:k,grammar:$,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(k,$){var C=$.rest;if(C){for(var M in C)$[M]=C[M];delete $.rest}var T=new c;return d(T,T.head,k),f(k,T,$,T.head,0),m(T)},hooks:{all:{},add:function
|
||
|
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(I+1))}y.textContent=T,t.highlightElement(y)},function(T){b.setAttribute(r,f),y.textContent=T})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),k=0,$;$=y[k++];)t.highlightElement($)}};var m=!1;t.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(LS);const Js=ra;var gc={},NS={get exports(){return gc},set exports(n){gc=n}};(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(`
|
||
|
`),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="",m="",g=!1,b=0;b<d.length;++b){var y=d[b];y==o.element?g=!0:y.nodeName==="#text"&&(g?m+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+m,o.code=r.normalize(o.code,o.settings);else{var k=h+o.element.innerHTML+m;o.element.innerHTML=r.normalize(k,o.settings),o.code=o.element.textContent}}}})})()})(NS);(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 FS(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),_(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-10s5tkd")&&p(e,"class",i)},i:X,o:X,d(s){s&&w(e)}}}function RS(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=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.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 Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class eb extends ke{constructor(e){super(),ye(this,e,RS,FS,be,{class:0,content:2,language:3})}}const HS=n=>({}),_c=n=>({}),jS=n=>({}),bc=n=>({});function vc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$=n[4]&&!n[2]&&yc(n);const C=n[19].header,M=Nt(C,n,n[18],bc);let T=n[4]&&n[2]&&kc(n);const E=n[19].default,O=Nt(E,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],_c);return{c(){e=v("div"),t=v("div"),s=D(),l=v("div"),o=v("div"),$&&$.c(),r=D(),M&&M.c(),a=D(),T&&T.c(),u=D(),f=v("div"),O&&O.c(),c=D(),d=v("div"),L&&L.c(),p(t,
|
||
|
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 k={};y&16&&(k.id=b[4]),y&1&&(k.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,k.value=b[0].exceptDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function W4(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[3](b)}let g={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ts({props:g}),ie.push(()=>ve(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("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){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),H(r,b,y),S(b,u,y),S(b,f,y),c=!0,d||(h=Ie(We.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 k={};y&16&&(k.id=b[4]+".options.onlyDomains"),y&1&&(k.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,k.value=b[0].onlyDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function Y4(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[U4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[W4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),_(e,t),H(i,t,null),_(e,s),_(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){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function K4(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 ib extends ke{constructor(e){super(),ye(this,e,K4,Y4,be,{key:1,options:0})}}function J4(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 ib({props:r}),ie.push(()=>ve(e,"key",l)),ie.push(()=>ve(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],we(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],we(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function Z4(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 G4 extends ke{constructor(e){super(),ye(this,e,Z4,J4,be,{key:0,options:1})}}function X4(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class Q4 extends ke{constructor(e){super(),ye(this,e,X4,null,be,{key:0,options:1})}}var wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_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:[],onR
|
||
|
<span class='flatpickr-weekday'>
|
||
|
`+W.join("</span><span class='flatpickr-weekday'>")+`
|
||
|
</span>
|
||
|
`}}function Q(){t.calendarContainer.classList.add("hasWeeks");var R=lt("div","flatpickr-weekwrapper");R.appendChild(lt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=lt("div","flatpickr-weeks");return R.appendChild(W),{weekWrapper:R,weekNumbers:W}}function J(R,W){W===void 0&&(W=!0);var ee=W?R:R-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Xe("onYearChange"),V()),F(),Xe("onMonthChange"),Ei())}function ae(R,W){if(R===void 0&&(R=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Tr(t.config),le=ee.hours,Te=ee.minutes,Ee=ee.seconds;h(le,Te,Ee)}t.redraw(),R&&Xe("onChange")}function He(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Xe("onClose")}function Fe(){t.config!==void 0&&Xe("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 W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}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(ee){try{delete t[ee]}catch{}})}function Ne(R){return t.calendarContainer.contains(R)}function Re(R){if(t.isOpen&&!t.config.inline){var W=dn(R),ee=Ne(W),le=W===t.input||W===t.altInput||t.element.contains(W)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Te=!le&&!ee&&!Ne(R.relatedTarget),Ee=!t.config.ignoredFocusElements.some(function(Ae){return Ae.contains(W)});Te&&Ee&&(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 ge(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var W=R,ee=t.currentYear!==W;t.currentYear=W||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)),ee&&(t.redraw(),Xe("onYearChange"),V())}}function Ce(R,W){var ee;W===void 0&&(W=!0);var le=t.parseDate(R,void 0,W);if(t.config.minDate&&le&&pn(le,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&le&&pn(le,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retur
|
||
|
Leave empty for no restriction.`,position:"top"})),C=!0)},p(O,I){(!$||I&2048&&l!==(l=O[11]))&&p(e,"for",l);const L={};I&2048&&(L.id=O[11]),!a&&I&1&&(a=!0,L.value=O[0].mimeTypes,we(()=>a=!1)),r.$set(L);const N={};I&4097&&(N.$$scope={dirty:I,ctx:O}),k.$set(N)},i(O){$||(A(r.$$.fragment,O),A(k.$$.fragment,O),$=!0)},o(O){P(r.$$.fragment,O),P(k.$$.fragment,O),$=!1},d(O){O&&w(e),O&&w(o),j(r,O),O&&w(u),O&&w(f),j(k),C=!1,M()}}}function C$(n){let e;return{c(){e=v("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){S(t,e,i)},p:X,d(t){t&&w(e)}}}function T$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M;function T(O){n[10](O)}let E={id:n[11],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(E.value=n[0].thumbs),r=new ts({props:E}),ie.push(()=>ve(r,"value",T)),k=new Qn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[C$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=D(),h=v("button"),m=v("span"),m.textContent="Supported formats",g=D(),b=v("i"),y=D(),q(k.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[11]),p(c,"class","txt"),p(m,"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(O,I){S(O,e,I),_(e,t),_(e,i),_(e,s),S(O,o,I),H(r,O,I),S(O,u,I),S(O,f,I),_(f,c),_(f,d),_(f,h),_(h,m),_(h,g),_(h,b),_(h,y),H(k,h,null),$=!0,C||(M=Ie(We.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"})),C=!0)},p(O,I){(!$||I&2048&&l!==(l=O[11]))&&p(e,"for",l);const L={};I&2048&&(L.id=O[11]),!a&&I&1&&(a=!0,L.value=O[0].thumbs,we(()=>a=!1)),r.$set(L);const N={};I&4096&&(N.$$scope={dirty:I,ctx:O}),k.$set(N)},i(O){$||(A(r.$$.fragment,O),A(k.$$.fragment,O),$=!0)},o(O){P(r.$$.fragment,O),P(k.$$.fragment,O),$=!1},d(O){O&&w(e),O&&w(o),j(r,O),O&&w(u),O&&w(f),j(k),C=!1,M()}}}function M$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[k$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[w$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[$$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[T$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("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(m,g){S(m,e,g),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),H(u,a,null),_(e,f),_(e,c),H(d,c,null),h=!0},p(m,[g]){const b={};g&2&&(b.name="schema."+m[1]+".options.maxSize"),g&6145&&(b.$$scope={dirty:g,ctx:m}),i.$set(b);const y={};g&2&&(y.name="schema."+m[1]+".options.maxSelect"),g&6145&&(y.$$scope={dirty:g,ctx:m}),o.$set(y);const k={};g&2&&(k.name="schema."+m[1]+".options.mimeTypes"),g&6145&&(k.$$scope={dirty:g,ctx:m}),u.$set(k);const $={};g&2&&($.name="schema."+m[1]+".options.thumbs"),g&6145&&($.$$scope={dirty:g,ctx:m}),d.$set($)},i(m){h||(A(i.$$.fragment,m),A(o.$$.fragment,m),A(u.$$.fragment,m),A(d.$$.fragment,m),h=!0)},o(m){P(i.$$.fragment,m),P(o.$$.fragment,m),P(u.$$.fragment,m),P(d.$$.fragment,m),h=!1},d(m){m&&w(e),j(i),j(o),j(u),j(d)}}}function D$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(m){Be.call(this,n,m)}function o(){s.maxSize=dt(this.value),t(0,s)}function r(){s.maxSelect=dt(this.value),t(0,s)}function a(m){n.$$.not_equal(s.mimeTypes,m)&&(s.mimeTypes=m,t(0,s))}const u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},f=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetm
|
||
|
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[7]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function A$(n){let e,t,i,s,l,o,r;function a(f){n[8](f)}let u={searchable:n[2].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[2],$$slots:{afterOptions:[E$]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new Ns({props:u}),ie.push(()=>ve(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("Collection"),s=D(),q(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&4&&(d.searchable=f[2].length>5),c&4&&(d.items=f[2]),c&524296&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function I$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Max select",i=D(),s=v("i"),o=D(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18]),p(r,"type","number"),p(r,"id",a=n[18]),p(r,"step","1"),p(r,"min","1")},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].maxSelect),u||(f=[Ie(We.call(null,s,{text:"Leave empty for no limit.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&262144&&l!==(l=c[18])&&p(e,"for",l),d&262144&&a!==(a=c[18])&&p(r,"id",a),d&1&&dt(r.value)!==c[0].maxSelect&&fe(r,c[0].maxSelect)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,Le(f)}}}function P$(n){let e,t,i,s,l,o,r,a,u,f,c;function d(m){n[10](m)}let h={multiple:!0,searchable:!0,id:n[18],items:n[4]};return n[0].displayFields!==void 0&&(h.selected=n[0].displayFields),r=new xa({props:h}),ie.push(()=>ve(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=D(),s=v("i"),o=D(),q(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18])},m(m,g){S(m,e,g),_(e,t),_(e,i),_(e,s),S(m,o,g),H(r,m,g),u=!0,f||(c=Ie(We.call(null,s,{text:"Optional select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(m,g){(!u||g&262144&&l!==(l=m[18]))&&p(e,"for",l);const b={};g&262144&&(b.id=m[18]),g&16&&(b.items=m[4]),!a&&g&1&&(a=!0,b.selected=m[0].displayFields,we(()=>a=!1)),r.$set(b)},i(m){u||(A(r.$$.fragment,m),u=!0)},o(m){P(r.$$.fragment,m),u=!1},d(m){m&&w(e),m&&w(o),j(r,m),f=!1,c()}}}function L$(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[18],items:n[5]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new Ns({props:u}),ie.push(()=>ve(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("Cascade delete"),s=D(),q(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&262144&&(d.id=f[18]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function N$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[A$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[I$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[P$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[L$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}});let b={};return m=new tu({props:b}),n[12](m),m.$on("save",n[13]),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div")
|
||
|
(aka. not ${B.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(m,g){g[1]&8192&&t!==(t=m[44])&&p(e,"id",t),g[0]&1&&(e.checked=m[0].required),g[0]&1&&o!==(o=_s(m[0])+"")&&re(r,o),f&&Zt(f.update)&&g[0]&1&&f.update.call(null,{text:`Requires the field value to be ${_s(m[0])}
|
||
|
(aka. not ${B.zeroDefaultStr(m[0])}).`,position:"right"}),g[1]&8192&&c!==(c=m[44])&&p(s,"for",c)},d(m){m&&w(e),m&&w(i),m&&w(s),d=!1,Le(h)}}}function Jc(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[s3,({uniqueId:i})=>({44:i}),({uniqueId:i})=>[0,i?8192:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&24576&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function s3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[44]),p(s,"for",o=n[44])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[32]),r=!0)},p(u,f){f[1]&8192&&t!==(t=u[44])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&8192&&o!==(o=u[44])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Zc(n){let e,t,i,s,l,o,r,a,u,f;a=new Qn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[l3]},$$scope:{ctx:n}}});let c=n[8]&&Gc(n);return{c(){e=v("div"),t=v("div"),i=D(),s=v("div"),l=v("button"),o=v("i"),r=D(),q(a.$$.fragment),u=D(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,h){S(d,e,h),_(e,t),_(e,i),_(e,s),_(s,l),_(l,o),_(l,r),H(a,l,null),_(s,u),c&&c.m(s,null),f=!0},p(d,h){const m={};h[1]&16384&&(m.$$scope={dirty:h,ctx:d}),a.$set(m),d[8]?c?c.p(d,h):(c=Gc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function l3(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Gc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",bn(n[3])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function o3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T;s=new me({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[B$,({uniqueId:F})=>({44:F}),({uniqueId:F})=>[0,F?8192:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:`
|
||
|
form-field
|
||
|
required
|
||
|
`+(n[5]?"":"invalid")+`
|
||
|
`+(n[0].id&&n[0].system?"disabled":"")+`
|
||
|
`,name:"schema."+n[1]+".name",$$slots:{default:[U$,({uniqueId:F})=>({44:F}),({uniqueId:F})=>[0,F?8192:0]]},$$scope:{ctx:n}}});const E=[n3,t3,e3,x$,Q$,X$,G$,Z$,J$,K$,Y$,W$],O=[];function I(F,V){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:F[0].type==="user"?11:-1}~(f=I(n))&&(c=O[f]=E[f](n)),m=new me({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[i3,({uniqueId:F})=>({44:F}),({uniqueId:F})=>[0,F?8192:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&Jc(n),N=!n[0].toDelete&&Zc(n);return{c(){e=v("form"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),q(r.$$.fragment),a=D(),u=v("div"),c&&c.c(),d=D(),h=v("div"),q(m.$$.fragment),g=D(),b=v("div"),L&&L.c(),y=D(),N&&N.c(),k=D(),$=v("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($,"type","submit"),p($,"class","hidden"),p($,"tabindex","-1"),p(e,"class","field-form")},m(F,V){S(F,e,V),_(e,t),_(t,i),H(s,i,null),_(t,l),_(t,o),H(r,o,null),_(t,a),_(t,u),~f&&O[f].m(u,null),_(t,d),_(t,h),H(m,h,null),_(t,g),_(t,b),L&&L.m(b,null),_(t,y),N&&N.m(t,null),_(e,k),_(e,$),C=!0,M||(T=[Y(e,"dragstart",u3),Y(e,"submit",ct(n[33]))],M=!0)},p(F,V){const G={};V[0]&1&&(G.class="form-field required "+(F[0].id?"disabled":"")),V[0]&2&&(G.name="schema."+F[1]+".type"),V[0]&1|V[1]&24576&&(G.$$scope={dirty:V,ctx:F}),s.$set(G);const se={};V[0]&33&&(se.class=`
|
||
|
form-field
|
||
|
required
|
||
|
`+(F[5]?"":"invalid")+`
|
||
|
`+(F[0].id&&F[0].system?"disabled":"")+`
|
||
|
`),V[0]&2&&(se.name="schema."+F[1]+".name"),V[0]&33|V[1]&24576&&(se.$$scope={dirty:V,ctx:F}),r.$set(se);let K=f;f=I(F),f===K?~f&&O[f].p(F,V):(c&&(de(),P(O[K],1,1,()=>{O[K]=null}),pe()),~f?(c=O[f],c?c.p(F,V):(c=O[f]=E[f](F),c.c()),A(c,1),c.m(u,null)):c=null);const te={};V[0]&1|V[1]&24576&&(te.$$scope={dirty:V,ctx:F}),m.$set(te),F[0].type!=="file"?L?(L.p(F,V),V[0]&1&&A(L,1)):(L=Jc(F),L.c(),A(L,1),L.m(b,null)):L&&(de(),P(L,1,1,()=>{L=null}),pe()),F[0].toDelete?N&&(de(),P(N,1,1,()=>{N=null}),pe()):N?(N.p(F,V),V[0]&1&&A(N,1)):(N=Zc(F),N.c(),A(N,1),N.m(t,null))},i(F){C||(A(s.$$.fragment,F),A(r.$$.fragment,F),A(c),A(m.$$.fragment,F),A(L),A(N),C=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(m.$$.fragment,F),P(L),P(N),C=!1},d(F){F&&w(e),j(s),j(r),~f&&O[f].d(),j(m),L&&L.d(),N&&N.d(),M=!1,Le(T)}}}function Xc(n){let e,t,i,s,l=n[0].system&&Qc(),o=!n[0].id&&xc(n),r=n[0].required&&ed(n),a=n[0].unique&&td();return{c(){e=v("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){S(u,e,f),l&&l.m(e,null),_(e,t),o&&o.m(e,null),_(e,i),r&&r.m(e,null),_(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Qc(),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=xc(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ed(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=td(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Qc(n){let e;return{c(){e=v("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xc(n){let e;return{c(){e=v("span"),e.textContent="New",p(e,"class","label"),x(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&x(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function ed(n){let e,t=_s(n[0])+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l[0]&1&&t!==(t=_s(s[0])+"")&&re(i,t)},d(s){s&&w(e)}}}function td(n){let e;return{c(){e=v("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function nd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function id(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",bn(n[16])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function r3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,m,g,b,y=!n[0].toDelete&&Xc(n),k=n[7]&&!n[0].system&&nd(),$=n[0].toDelete&&id(n);return{c(){e=v("div"),t=v("span"),i=v("i"),l=D(),o=v("strong"),a=U(r),f=D(),y&&y.c(),c=D(),d=v("div"),h=D(),k&&k.c(),m=D(),$&&$.c(),g=Oe(),p(i,"class",s=yi(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),x(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(C,M){S(C,e,M),_(e,t),_(t,i),_(e,l),_(e,o),_(o,a),S(C,f,M),y&&y.m(C,M),S(C,c,M),S(C,d,M),S(C,h,M),k&&k.m(C,M),S(C,m,M),$&&$.m(C,M),S(C,g,M),b=!0},p(C,M){(!b||M[0]&1&&s!==(s=yi(B.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&re(a,r),(!b||M[0]&1&&u!==(u=C[0].name))&&p(o,"title",u),(!b||M[0]&1)&&x(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?y&&(y.d(1),y=null):y?y.p(C,M):(y=Xc(C),y.c(),y.m(c.parentNode,c)),C[7]&&!C[0].system?k?M[0]&129&&A(k,1):(k=nd(),k.c(),A(k,1),k.m(m.parentNode,m)):k&&(de(),P(k,1,1,()=>{k=null}),pe()),C[0].toDelete?$?$.p(C,M):($=id(C),$.c(),$.m(g.parentNode,g)):$&&($.d(1),$=null)},i(C){b||(A(k),b=!0)},o(C){P(k),b=!1},d(C){C&&w(e),C&&w(f),y&&y.d(C),C&&w(c),C&&w(d),C&&w(h),k&&k.d(C),C&&w(m),$&&$.d(C),C&&w(g)}}}func
|
||
|
`),t=v("code"),t.textContent="username",i=U(` ,
|
||
|
`),s=v("code"),s.textContent="email",l=U(` ,
|
||
|
`),o=v("code"),o.textContent="emailVisibility",r=U(` ,
|
||
|
`),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function od(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new c3({props:f}),ie.push(()=>ve(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),H(i,c,d),l=!0},p(c,d){e=c;const h={};d&1&&(h.key=e[15]),d&3&&(h.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,h.field=e[13],we(()=>s=!1)),i.$set(h)},i(c){l||(A(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function d3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],m=new Map,g,b,y,k,$,C,M,T,E,O,I,L=n[0].isAuth&&ld(),N=n[0].schema;const F=V=>V[13];for(let V=0;V<N.length;V+=1){let G=sd(n,N,V),se=F(G);m.set(se,h[V]=od(se,G))}return{c(){e=v("div"),t=v("p"),i=U(`System fields:
|
||
|
`),s=v("code"),s.textContent="id",l=U(` ,
|
||
|
`),o=v("code"),o.textContent="created",r=U(` ,
|
||
|
`),a=v("code"),a.textContent="updated",u=D(),L&&L.c(),f=U(`
|
||
|
.`),c=D(),d=v("div");for(let V=0;V<h.length;V+=1)h[V].c();g=D(),b=v("div"),y=D(),k=v("button"),$=v("i"),C=D(),M=v("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(b,"class","clearfix m-t-xs"),p($,"class","ri-add-line"),p(M,"class","txt"),p(k,"type","button"),p(k,"class",T="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(V,G){S(V,e,G),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),L&&L.m(t,null),_(t,f),S(V,c,G),S(V,d,G);for(let se=0;se<h.length;se+=1)h[se].m(d,null);S(V,g,G),S(V,b,G),S(V,y,G),S(V,k,G),_(k,$),_(k,C),_(k,M),E=!0,O||(I=Y(k,"click",n[3]),O=!0)},p(V,[G]){V[0].isAuth?L||(L=ld(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),G&55&&(N=V[0].schema,de(),h=gt(h,G,F,1,V,N,m,d,Kt,od,null,sd),pe()),(!E||G&1&&T!==(T="btn btn-block "+(V[0].schema.length?"btn-transparent":"btn-secondary")))&&p(k,"class",T)},i(V){if(!E){for(let G=0;G<N.length;G+=1)A(h[G]);E=!0}},o(V){for(let G=0;G<h.length;G+=1)P(h[G]);E=!1},d(V){V&&w(e),L&&L.d(),V&&w(c),V&&w(d);for(let G=0;G<h.length;G+=1)h[G].d();V&&w(g),V&&w(b),V&&w(y),V&&w(k),O=!1,I()}}}function p3(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function h3(n,e,t){let{collection:i=new gn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(b){i.schema[b]&&(i.schema.splice(b,1),t(0,i))}function r(){const b=new fn({name:a()});i.schema.push(b),t(0,i)}function a(b="field"){let y="";for(;u(b+y);)++y;return b+y}function u(b){return!!i.schema.find(y=>y.name===b)}function f(b){let y=[];if(b.toDelete)return y;for(let k of i.schema)k===b||k.toDelete||y.push(k.name);return y}function c(b,y){if(!b)return;b.dataTransfer.dropEffect="move";const k=parseInt(b.dataTransfer.getData("text/plain")),$=i.schema;k<y?($.splice(y+1,0,$[k]),$.splice(k,1)):($.splice(y,0,$[k]),$.splice(k+1,1)),t(0,i.schema=$,i)}function d(b,y,k,$){k[$]=b,t(0,i)}const h=b=>o(b),m=(b,y)=>p3(y==null?void 0:y.detail,b),g=(b,y)=>c(y==null?void 0:y.detail,b);return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new gn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,h,m,g]}class m3 extends ke{constructor(e){super(),ye(this,e,h3,d3,be,{collection:0})}}const g3=n=>({isAdminOnly:n&256}),rd=n=>({isAdminOnly:n[8]});function _3(n){let e,t;return e=new me({props:{class:"form-field rule-field m-0 "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[$3,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field m-0 "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function b3(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function v3(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-line"></i>
|
||
|
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1walzui")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function y3(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
|
||
|
<span class="txt">Set custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-1walzui")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function k3(n){let e;return{c(){e=U("Leave empty to grant everyone access.")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function w3(n){let e,t,i,s,l;return{c(){e=U(`Only admins will be able to perform this action (
|
||
|
`),t=v("button"),t.textContent="unlock to change",i=U(`
|
||
|
).`),p(t,"type","button"),p(t,"class","link-hint")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(t,"click",n[9]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function S3(n){let e;function t(l,o){return l[8]?w3:k3}let i=t(n),s=i(n);return{c(){e=v("p"),s.c()},m(l,o){S(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&w(e),s.d()}}}function $3(n){let e,t,i,s,l=n[8]?"Admins only":"Custom rule",o,r,a,u,f,c,d,h,m;function g(O,I){return O[8]?y3:v3}let b=g(n),y=b(n);function k(O){n[13](O)}var $=n[6];function C(O){let I={id:O[17],baseCollection:O[1],disabled:O[8]};return O[0]!==void 0&&(I.value=O[0]),{props:I}}$&&(f=Yt($,C(n)),n[12](f),ie.push(()=>ve(f,"value",k)));const M=n[11].default,T=Nt(M,n,n[14],rd),E=T||S3(n);return{c(){e=v("label"),t=v("span"),i=U(n[2]),s=U(" - "),o=U(l),r=D(),y.c(),u=D(),f&&q(f.$$.fragment),d=D(),h=v("div"),E&&E.c(),p(t,"class","txt"),p(e,"for",a=n[17]),p(h,"class","help-block")},m(O,I){S(O,e,I),_(e,t),_(t,i),_(t,s),_(t,o),_(e,r),y.m(e,null),S(O,u,I),f&&H(f,O,I),S(O,d,I),S(O,h,I),E&&E.m(h,null),m=!0},p(O,I){(!m||I&4)&&re(i,O[2]),(!m||I&256)&&l!==(l=O[8]?"Admins only":"Custom rule")&&re(o,l),b===(b=g(O))&&y?y.p(O,I):(y.d(1),y=b(O),y&&(y.c(),y.m(e,null))),(!m||I&131072&&a!==(a=O[17]))&&p(e,"for",a);const L={};if(I&131072&&(L.id=O[17]),I&2&&(L.baseCollection=O[1]),I&256&&(L.disabled=O[8]),!c&&I&1&&(c=!0,L.value=O[0],we(()=>c=!1)),$!==($=O[6])){if(f){de();const N=f;P(N.$$.fragment,1,0,()=>{j(N,1)}),pe()}$?(f=Yt($,C(O)),O[12](f),ie.push(()=>ve(f,"value",k)),q(f.$$.fragment),A(f.$$.fragment,1),H(f,d.parentNode,d)):f=null}else $&&f.$set(L);T?T.p&&(!m||I&16640)&&Rt(T,M,O,O[14],m?Ft(M,O[14],I,g3):Ht(O[14]),rd):E&&E.p&&(!m||I&256)&&E.p(O,m?I:-1)},i(O){m||(f&&A(f.$$.fragment,O),A(E,O),m=!0)},o(O){f&&P(f.$$.fragment,O),P(E,O),m=!1},d(O){O&&w(e),y.d(),O&&w(u),n[12](null),f&&j(f,O),O&&w(d),O&&w(h),E&&E.d(O)}}}function C3(n){let e,t,i,s;const l=[b3,_3],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Oe()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(de(),P(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){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let ad;function T3(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,h=ad,m=!1;g();async function g(){h||m||(t(7,m=!0),t(6,h=(await rt(()=>import("./FilterAutocompleteInput-1e85f96b.js"),["./FilterAutocompleteInput-1e85f96b.js","./index-0935db40.js"],import.meta.url)).default),ad=h,t(7,m=!1))}async function b(){t(0,r=d||""),await In(),c==null||c.focus()}async function y(){d=r,t(0,r=null)}function k(C){ie[C?"unshift":"push"](()=>{c=C,t(5,c)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"$$scope"in C&&t(14,l=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,h,m,i,b,y,s,k,$,l]}class gs extends ke{constructor(e){super(),ye(this,e,T3,C3,be,{collection:1,rule:0,label:2,formKey:3,required:4})}}function ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function fd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I,L,N,F,V,G,se=n[0].schema,K=[];for(let te=0;te<se.length;te+=1)K[te]=cd(ud(n,se,te));return{c(){e=v("div"),t=v("div"),i=v("div"),s=v("p"),s.textContent="The following record fields are available:",l=D(),o=v("div"),r=v("code"),r.textContent="id",a=D(),u=v("code"),u.textContent="created",f=D(),c=v("code"),c.textContent="updated",d=D();for(let te=0;te<K.length;te+=1)K[te].c();h=D(),m=v("hr"),g=D(),b=v("p"),b.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=D(),k=v("div"),k.innerHTML=`<code>@request.method</code>
|
||
|
<code>@request.query.*</code>
|
||
|
<code>@request.data.*</code>
|
||
|
<code>@request.auth.*</code>`,$=D(),C=v("hr"),M=D(),T=v("p"),T.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",E=D(),O=v("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",I=D(),L=v("hr"),N=D(),F=v("p"),F.innerHTML=`Example rule:
|
||
|
<br/>
|
||
|
<code>@request.auth.id != "" && created > "2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(m,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(k,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(T,"class","m-b-0"),p(O,"class","inline-flex flex-gap-5"),p(L,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(te,ne){S(te,e,ne),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o),_(o,r),_(o,a),_(o,u),_(o,f),_(o,c),_(o,d);for(let z=0;z<K.length;z+=1)K[z].m(o,null);_(i,h),_(i,m),_(i,g),_(i,b),_(i,y),_(i,k),_(i,$),_(i,C),_(i,M),_(i,T),_(i,E),_(i,O),_(i,I),_(i,L),_(i,N),_(i,F),G=!0},p(te,ne){if(ne&1){se=te[0].schema;let z;for(z=0;z<se.length;z+=1){const Q=ud(te,se,z);K[z]?K[z].p(Q,ne):(K[z]=cd(Q),K[z].c(),K[z].m(o,null))}for(;z<K.length;z+=1)K[z].d(1);K.length=se.length}},i(te){G||(te&&tt(()=>{V||(V=qe(e,Et,{duration:150},!0)),V.run(1)}),G=!0)},o(te){te&&(V||(V=qe(e,Et,{duration:150},!1)),V.run(0)),G=!1},d(te){te&&w(e),yt(K,te),te&&V&&V.end()}}}function M3(n){let e,t=n[9].name+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&1&&t!==(t=s[9].name+"")&&re(i,t)},d(s){s&&w(e)}}}function D3(n){let e,t=n[9].name+"",i,s;return{c(){e=v("code"),i=U(t),s=U(".*")},m(l,o){S(l,e,o),_(e,i),_(e,s)},p(l,o){o&1&&t!==(t=l[9].name+"")&&re(i,t)},d(l){l&&w(e)}}}function cd(n){let e;function t(l,o){return l[9].type==="relation"||l[9].type==="user"?D3:M3}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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&&w(e)}}}function dd(n){let e,t,i,s,l;function o(a){n[8](a)}let r={label:"Manage action",formKey:"options.manageRule",collection:n[0],$$slots:{default:[O3]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new gs({props:r}),ie.push(()=>ve(i,"rule",o)),{c(){e=v("hr"),t=D(),q(i.$$.fragment),p(e,"class","m-t-sm m-b-sm")},m(a,u){S(a,e,u),S(a,t,u),H(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&4096&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,we(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function O3(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
|
||
|
changing the password without requiring to enter the old one, directly updating the verified
|
||
|
state or email, etc.`,t=D(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function E3(n){var ue;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I,L,N,F,V,G,se,K,te,ne,z,Q,J=n[1]&&fd(n);function ae(Z){n[3](Z)}let He={label:"List/Search action",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(He.rule=n[0].listRule),f=new gs({props:He}),ie.push(()=>ve(f,"rule",ae));function Fe(Z){n[4](Z)}let Ne={label:"View action",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(Ne.rule=n[0].viewRule),g=new gs({props:Ne}),ie.push(()=>ve(g,"rule",Fe));function Re(Z){n[5](Z)}let ge={label:"Create action",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(ge.rule=n[0].createRule),C=new gs({props:ge}),ie.push(()=>ve(C,"rule",Re));function Ce(Z){n[6](Z)}let $e={label:"Update action",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&($e.rule=n[0].updateRule),I=new gs({props:$e}),ie.push(()=>ve(I,"rule",Ce));function Ye(Z){n[7](Z)}let ze={label:"Delete action",formKey:"deleteRule",collection:n[0]};n[0].deleteRule!==void 0&&(ze.rule=n[0].deleteRule),G=new gs({props:ze}),ie.push(()=>ve(G,"rule",Ye));let oe=((ue=n[0])==null?void 0:ue.isAuth)&&dd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
|
||
|
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
|
||
|
</a>.`,s=D(),l=v("button"),r=U(o),a=D(),J&&J.c(),u=D(),q(f.$$.fragment),d=D(),h=v("hr"),m=D(),q(g.$$.fragment),y=D(),k=v("hr"),$=D(),q(C.$$.fragment),T=D(),E=v("hr"),O=D(),q(I.$$.fragment),N=D(),F=v("hr"),V=D(),q(G.$$.fragment),K=D(),oe&&oe.c(),te=Oe(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base"),p(h,"class","m-t-sm m-b-sm"),p(k,"class","m-t-sm m-b-sm"),p(E,"class","m-t-sm m-b-sm"),p(F,"class","m-t-sm m-b-sm")},m(Z,ce){S(Z,e,ce),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),J&&J.m(e,null),S(Z,u,ce),H(f,Z,ce),S(Z,d,ce),S(Z,h,ce),S(Z,m,ce),H(g,Z,ce),S(Z,y,ce),S(Z,k,ce),S(Z,$,ce),H(C,Z,ce),S(Z,T,ce),S(Z,E,ce),S(Z,O,ce),H(I,Z,ce),S(Z,N,ce),S(Z,F,ce),S(Z,V,ce),H(G,Z,ce),S(Z,K,ce),oe&&oe.m(Z,ce),S(Z,te,ce),ne=!0,z||(Q=Y(l,"click",n[2]),z=!0)},p(Z,[ce]){var It;(!ne||ce&2)&&o!==(o=Z[1]?"Hide available fields":"Show available fields")&&re(r,o),Z[1]?J?(J.p(Z,ce),ce&2&&A(J,1)):(J=fd(Z),J.c(),A(J,1),J.m(e,null)):J&&(de(),P(J,1,1,()=>{J=null}),pe());const Se={};ce&1&&(Se.collection=Z[0]),!c&&ce&1&&(c=!0,Se.rule=Z[0].listRule,we(()=>c=!1)),f.$set(Se);const _e={};ce&1&&(_e.collection=Z[0]),!b&&ce&1&&(b=!0,_e.rule=Z[0].viewRule,we(()=>b=!1)),g.$set(_e);const Je={};ce&1&&(Je.collection=Z[0]),!M&&ce&1&&(M=!0,Je.rule=Z[0].createRule,we(()=>M=!1)),C.$set(Je);const nt={};ce&1&&(nt.collection=Z[0]),!L&&ce&1&&(L=!0,nt.rule=Z[0].updateRule,we(()=>L=!1)),I.$set(nt);const St={};ce&1&&(St.collection=Z[0]),!se&&ce&1&&(se=!0,St.rule=Z[0].deleteRule,we(()=>se=!1)),G.$set(St),(It=Z[0])!=null&&It.isAuth?oe?(oe.p(Z,ce),ce&1&&A(oe,1)):(oe=dd(Z),oe.c(),A(oe,1),oe.m(te.parentNode,te)):oe&&(de(),P(oe,1,1,()=>{oe=null}),pe())},i(Z){ne||(A(J),A(f.$$.fragment,Z),A(g.$$.fragment,Z),A(C.$$.fragment,Z),A(I.$$.fragment,Z),A(G.$$.fragment,Z),A(oe),ne=!0)},o(Z){P(J),P(f.$$.fragment,Z),P(g.$$.fragment,Z),P(C.$$.fragment,Z),P(I.$$.fragment,Z),P(G.$$.fragment,Z),P(oe),ne=!1},d(Z){Z&&w(e),J&&J.d(),Z&&w(u),j(f,Z),Z&&w(d),Z&&w(h),Z&&w(m),j(g,Z),Z&&w(y),Z&&w(k),Z&&w($),j(C,Z),Z&&w(T),Z&&w(E),Z&&w(O),j(I,Z),Z&&w(N),Z&&w(F),Z&&w(V),j(G,Z),Z&&w(K),oe&&oe.d(Z),Z&&w(te),z=!1,Q()}}}function A3(n,e,t){let{collection:i=new gn}=e,s=!1;const l=()=>t(1,s=!s);function o(d){n.$$.not_equal(i.listRule,d)&&(i.listRule=d,t(0,i))}function r(d){n.$$.not_equal(i.viewRule,d)&&(i.viewRule=d,t(0,i))}function a(d){n.$$.not_equal(i.createRule,d)&&(i.createRule=d,t(0,i))}function u(d){n.$$.not_equal(i.updateRule,d)&&(i.updateRule=d,t(0,i))}function f(d){n.$$.not_equal(i.deleteRule,d)&&(i.deleteRule=d,t(0,i))}function c(d){n.$$.not_equal(i.options.manageRule,d)&&(i.options.manageRule=d,t(0,i))}return n.$$set=d=>{"collection"in d&&t(0,i=d.collection)},[i,s,l,o,r,a,u,f,c]}class I3 extends ke{constructor(e){super(),ye(this,e,A3,E3,be,{collection:0})}}function P3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function L3(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[P3,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function N3(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function F3(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function pd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has err
|
||
|
<span class="txt">Username/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Oe(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,h){S(d,e,h),S(d,t,h),S(d,i,h),S(d,s,h),f.m(d,h),S(d,l,h),c&&c.m(d,h),S(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?h&8&&A(c,1):(c=pd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(de(),P(c,1,1,()=>{c=null}),pe())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function H3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function hd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(B.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[j3,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(B.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[q3,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(B.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(B.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&tt(()=>{r||(r=qe(e,Et,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=qe(e,Et,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function j3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[7](b)}let g={id:n[12],disabled:!B.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new ts({props:g}),ie.push(()=>ve(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),H(r,b,y),S(b,u,y),S(b,f,y),c=!0,d||(h=Ie(We.call(null,s,{text:`Email domains that are NOT allowed to sign up.
|
||
|
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&4096&&l!==(l=b[12]))&&p(e,"for",l);const k={};y&4096&&(k.id=b[12]),y&1&&(k.disabled=!B.isEmpty(b[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,k.value=b[0].options.exceptEmailDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[8](b)}let g={id:n[12],disabled:!B.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new ts({props:g}),ie.push(()=>ve(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),H(r,b,y),S(b,u,y),S(b,f,y),c=!0,d||(h=Ie(We.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&4096&&l!==(l=b[12]))&&p(e,"for",l);const k={};y&4096&&(k.id=b[12]),y&1&&(k.disabled=!B.isEmpty(b[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,k.value=b[0].options.onlyEmailDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function V3(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[H3,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&hd(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Oe()},m(o,r){H(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=hd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function z3(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function B3(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function md(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function U3(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].options.allowEmailAuth?B3:z3}let u=a(n),f=u(n),c=n[2]&&md();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
|
||
|
<span class="txt">Email/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Oe(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,h){S(d,e,h),S(d,t,h),S(d,i,h),S(d,s,h),f.m(d,h),S(d,l,h),c&&c.m(d,h),S(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?h&4&&A(c,1):(c=md(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(de(),P(c,1,1,()=>{c=null}),pe())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function W3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function gd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{t||(t=qe(e,Et,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,Et,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Y3(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[W3,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&gd();return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Oe()},m(o,r){H(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=gd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function K3(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function J3(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function _d(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Z3(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].options.allowOAuth2Auth?J3:K3}let u=a(n),f=u(n),c=n[1]&&_d();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
|
||
|
<span class="txt">OAuth2</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Oe(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,h){S(d,e,h),S(d,t,h),S(d,i,h),S(d,s,h),f.m(d,h),S(d,l,h),c&&c.m(d,h),S(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?h&2&&A(c,1):(c=_d(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(de(),P(c,1,1,()=>{c=null}),pe())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function G3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=D(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].options.minPasswordLength&&fe(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function X3(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Always require email",o=D(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"change",n[11]),Ie(We.call(null,r,{text:`The constraint is applied only for new records.
|
||
|
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function Q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y;return s=new ks({props:{single:!0,$$slots:{header:[R3],default:[L3]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[U3],default:[V3]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[Z3],default:[Y3]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[G3,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),b=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[X3,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=D(),i=v("div"),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),f=v("hr"),c=D(),d=v("h4"),d.textContent="General",h=D(),q(m.$$.fragment),g=D(),q(b.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(k,$){S(k,e,$),S(k,t,$),S(k,i,$),H(s,i,null),_(i,l),H(o,i,null),_(i,r),H(a,i,null),S(k,u,$),S(k,f,$),S(k,c,$),S(k,d,$),S(k,h,$),H(m,k,$),S(k,g,$),H(b,k,$),y=!0},p(k,[$]){const C={};$&8201&&(C.$$scope={dirty:$,ctx:k}),s.$set(C);const M={};$&8197&&(M.$$scope={dirty:$,ctx:k}),o.$set(M);const T={};$&8195&&(T.$$scope={dirty:$,ctx:k}),a.$set(T);const E={};$&12289&&(E.$$scope={dirty:$,ctx:k}),m.$set(E);const O={};$&12289&&(O.$$scope={dirty:$,ctx:k}),b.$set(O)},i(k){y||(A(s.$$.fragment,k),A(o.$$.fragment,k),A(a.$$.fragment,k),A(m.$$.fragment,k),A(b.$$.fragment,k),y=!0)},o(k){P(s.$$.fragment,k),P(o.$$.fragment,k),P(a.$$.fragment,k),P(m.$$.fragment,k),P(b.$$.fragment,k),y=!1},d(k){k&&w(e),k&&w(t),k&&w(i),j(s),j(o),j(a),k&&w(u),k&&w(f),k&&w(c),k&&w(d),k&&w(h),j(m,k),k&&w(g),j(b,k)}}}function x3(n,e,t){let i,s,l,o;Ke(n,Ci,g=>t(4,o=g));let{collection:r=new gn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=dt(this.value),t(0,r)}function m(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,b,y,k;n.$$.dirty&1&&r.isAuth&&B.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!B.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!B.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!B.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!B.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,m]}class eC extends ke{constructor(e){super(),ye(this,e,x3,Q3,be,{collection:0})}}function bd(n,e,t){const i=n.slice();return i[14]=e[t],i}function vd(n,e,t){const i=n.slice();return i[14]=e[t],i}function yd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function kd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed collection
|
||
|
`),s=v("strong"),o=U(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=U(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,m){S(h,e,m),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(f,d)},p(h,m){m&2&&l!==(l=h[1].originalName+"")&&re(o,l),m&2&&c!==(c=h[1].name+"")&&re(d,c)},d(h){h&&w(e)}}}function wd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed field
|
||
|
`),s=v("strong"),o=U(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=U(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,m){S(h,e,m),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(f,d)},p(h,m){m&16&&l!==(l=h[14].originalName+"")&&re(o,l),m&16&&c!==(c=h[14].name+"")&&re(d,c)},d(h){h&&w(e)}}}function Sd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=v("li"),t=U("Removed field "),i=v("span"),l=U(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),_(e,t),_(e,i),_(i,l),_(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&re(l,s)},d(r){r&&w(e)}}}function tC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&yd(),m=n[5]&&kd(n),g=n[4],b=[];for(let $=0;$<g.length;$+=1)b[$]=wd(vd(n,g,$));let y=n[3],k=[];for(let $=0;$<y.length;$+=1)k[$]=Sd(bd(n,y,$));return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),l=v("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=v("h6"),a.textContent="Changes:",u=D(),f=v("ul"),m&&m.c(),c=D();for(let $=0;$<b.length;$+=1)b[$].c();d=D();for(let $=0;$<k.length;$+=1)k[$].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($,e,C),_(e,t),_(e,i),_(e,s),_(s,l),_(s,o),h&&h.m(s,null),S($,r,C),S($,a,C),S($,u,C),S($,f,C),m&&m.m(f,null),_(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);_(f,d);for(let M=0;M<k.length;M+=1)k[M].m(f,null)},p($,C){if($[3].length?h||(h=yd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),$[5]?m?m.p($,C):(m=kd($),m.c(),m.m(f,c)):m&&(m.d(1),m=null),C&16){g=$[4];let M;for(M=0;M<g.length;M+=1){const T=vd($,g,M);b[M]?b[M].p(T,C):(b[M]=wd(T),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=g.length}if(C&8){y=$[3];let M;for(M=0;M<y.length;M+=1){const T=bd($,y,M);k[M]?k[M].p(T,C):(k[M]=Sd(T),k[M].c(),k[M].m(f,null))}for(;M<k.length;M+=1)k[M].d(1);k.length=y.length}},d($){$&&w(e),h&&h.d(),$&&w(r),$&&w(a),$&&w(u),$&&w(f),m&&m.d(),yt(b,$),yt(k,$)}}}function nC(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function iC(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[8]),Y(i,"click",n[9])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Le(l)}}}function sC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[iC],header:[nC],default:[tC]},$$scope:{ctx:n}};return e=new Bn({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){P(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function lC(n,e,t){let i,s,l;const o=Ct();let r,a;async function u(y){t(1,a=y),await In(),!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 m(y){ie[y?"unshift":"push"](()=>{r=y,t(2,r)})}function g(y){Be.call(this,n,y)}function b(y){Be.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,m,g,b]}class oC extends ke{constructor(e){super(),ye(this,e,lC,sC,be,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function $d(n,e,t){const i=n.slice();return i[43]=e[t][0],i[44]=e[t][1],i}function Cd(n){let e,t,i,s;function l(r){n[30](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new I3({props:o}),ie.push(()=>ve(t,"collection",l)),{c(){e=v("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],we(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Td(n){let e,t,i,s;function l(r){n[31](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new eC({props:o}),ie.push(()=>ve(t,"collection",l)),{c(){e=v("div"),q(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Es)},m(r,a){S(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],we(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function rC(n){let e,t,i,s,l,o,r;function a(d){n[29](d)}let u={};n[2]!==void 0&&(u.collection=n[2]),i=new m3({props:u}),ie.push(()=>ve(i,"collection",a));let f=n[3]===bl&&Cd(n),c=n[2].isAuth&&Td(n);return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),l=D(),f&&f.c(),o=D
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",bn(ct(n[22]))),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Dd(n){let e,t,i,s;return i=new Qn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[uC]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=D(),q(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&65536&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function Od(n){let e,t,i,s,l,o=n[44]+"",r,a,u,f,c;function d(){return n[24](n[43])}return{c(){e=v("button"),t=v("i"),s=D(),l=v("span"),r=U(o),a=U(" collection"),u=D(),p(t,"class",i=yi(B.getCollectionTypeIcon(n[43]))+" svelte-b10vi"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[43]==n[2].type)},m(h,m){S(h,e,m),_(e,t),_(e,s),_(e,l),_(l,r),_(l,a),_(e,u),f||(c=Y(e,"click",d),f=!0)},p(h,m){n=h,m[0]&64&&i!==(i=yi(B.getCollectionTypeIcon(n[43]))+" svelte-b10vi")&&p(t,"class",i),m[0]&64&&o!==(o=n[44]+"")&&re(r,o),m[0]&68&&x(e,"selected",n[43]==n[2].type)},d(h){h&&w(e),f=!1,c()}}}function uC(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Od($d(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Oe()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=$d(s,t,o);i[o]?i[o].p(r,l):(i[o]=Od(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){yt(i,s),s&&w(e)}}}function Ed(n){let e;return{c(){e=v("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y=(n[6][n[2].type]||"N/A")+"",k,$,C,M,T,E,O,I,L,N=n[2].isNew&&Dd(n),F=n[2].system&&Ed();return{c(){e=v("label"),t=U("Name"),s=D(),l=v("input"),f=D(),c=v("div"),d=v("button"),h=v("span"),m=D(),g=v("span"),b=U("Type: "),k=U(y),$=D(),N&&N.c(),T=D(),F&&F.c(),E=Oe(),p(e,"for",i=n[42]),p(l,"type","text"),p(l,"id",o=n[42]),l.required=!0,l.disabled=n[12],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(g,"class","txt"),p(d,"type","button"),p(d,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-hint":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(V,G){S(V,e,G),_(e,t),S(V,s,G),S(V,l,G),S(V,f,G),S(V,c,G),_(c,d),_(d,h),_(d,m),_(d,g),_(g,b),_(g,k),_(d,$),N&&N.m(d,null),S(V,T,G),F&&F.m(V,G),S(V,E,G),O=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[23]),I=!0)},p(V,G){(!O||G[1]&2048&&i!==(i=V[42]))&&p(e,"for",i),(!O||G[1]&2048&&o!==(o=V[42]))&&p(l,"id",o),(!O||G[0]&4096)&&(l.disabled=V[12]),(!O||G[0]&4&&r!==(r=V[2].isNew))&&(l.autofocus=r),(!O||G[0]&4&&a!==(a=V[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!O||G[0]&4&&u!==(u=V[2].name)&&l.value!==u)&&(l.value=u),(!O||G[0]&68)&&y!==(y=(V[6][V[2].type]||"N/A")+"")&&re(k,y),V[2].isNew?N?(N.p(V,G),G[0]&4&&A(N,1)):(N=Dd(V),N.c(),A(N,1),N.m(d,null)):N&&(de(),P(N,1,1,()=>{N=null}),pe()),(!O||G[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(V[2].isNew?"btn-hint":"btn-transparent")))&&p(d,"class",C),(!O||G[0]&4&&M!==(M=!V[2].isNew))&&(d.disabled=M),V[2].system?F||(F=Ed(),F.c(),F.m(E.parentNode,E)):F&&(F.d(1),F=null)},i(V){O||(A(N),O=!0)},o(V){P(N),O=!1},d(V){V&&w(e),V&&w(s),V&&w(l),V&&w(f),V&&w(c),N&&N.d(),V&&w(T),F&&F.d(V),V&&w(E),I=!1,L()}}}function Ad(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=We.call(null,e,n[13])),l=!0)},p(r,a){t&&Zt(t.update)&&a[0]&8192&&t.update.call(null,r[13])},i(r){s||(r&&tt(()=>{i||(i=qe(e,At,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=qe(e,At,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Id(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"cla
|
||
|
<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){S(l,e,o),_(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function gC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,m,g,b,y,k,$,C=n[3];const M=I=>I[15].id;for(let I=0;I<C.length;I+=1){let L=Fd(n,C,I),N=M(L);h.set(N,d[I]=jd(N,L))}let T=null;C.length||(T=Rd(n));let E=!n[7]&&qd(n),O={};return b=new tu({props:O}),n[13](b),b.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=v("input"),a=D(),u=v("hr"),f=D(),c=v("div");for(let I=0;I<d.length;I+=1)d[I].c();T&&T.c(),m=D(),E&&E.c(),g=D(),q(b.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(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"),x(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),x(c,"fade",n[6]),x(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),_(e,t),_(t,i),_(i,s),_(s,l),_(i,o),_(i,r),fe(r,n[0]),_(e,a),_(e,u),_(e,f),_(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);T&&T.m(c,null),_(e,m),E&&E.m(e,null),S(I,g,L),H(b,I,L),y=!0,k||($=[Y(l,"click",n[10]),Y(r,"input",n[11])],k=!0)},p(I,[L]){(!y||L&16)&&x(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&fe(r,I[0]),(!y||L&16)&&x(i,"active",I[4]),L&42&&(C=I[3],d=gt(d,L,M,1,I,C,h,c,Xi,jd,null,Fd),!C.length&&T?T.p(I,L):C.length?T&&(T.d(1),T=null):(T=Rd(I),T.c(),T.m(c,null))),(!y||L&64)&&x(c,"fade",I[6]),(!y||L&8)&&x(c,"sidebar-content-compact",I[3].length>20),I[7]?E&&(E.d(1),E=null):E?E.p(I,L):(E=qd(I),E.c(),E.m(e,null));const N={};b.$set(N)},i(I){y||(A(b.$$.fragment,I),y=!0)},o(I){P(b.$$.fragment,I),y=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();T&&T.d(),E&&E.d(),I&&w(g),n[13](null),j(b,I),k=!1,Le($)}}}function _C(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function bC(n,e,t){let i,s,l,o,r,a,u;Ke(n,Si,k=>t(5,o=k)),Ke(n,es,k=>t(9,r=k)),Ke(n,Po,k=>t(6,a=k)),Ke(n,Ts,k=>t(7,u=k));let f,c="";function d(k){Wt(Si,o=k,o)}const h=()=>t(0,c="");function m(){c=this.value,t(0,c)}const g=()=>f==null?void 0:f.show();function b(k){ie[k?"unshift":"push"](()=>{f=k,t(2,f)})}const y=k=>{var $;($=k.detail)!=null&&$.isNew&&k.detail.collection&&d(k.detail.collection)};return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(k=>k.id==c||k.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&512&&r&&_C()},[c,i,f,l,s,o,a,u,d,r,h,m,g,b,y]}class vC extends ke{constructor(e){super(),ye(this,e,bC,gC,be,{})}}function Vd(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function zd(n){n[18]=n[19].default}function Bd(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ud(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wd(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Ud();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Oe(),c&&c.c(),s=D(),l=v("button"),r=U(o),a=D(),p(l,"type","button"),p(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(h,m){S(h,t,m),c&&c.m(h,m),S(h,s,m),S(h,l,m),_(l,r),_(l,a),u||(f=Y(l,"click",d),u=!0)},p(h,m){e=h,m&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Ud(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),m&8&&o!==(o=e[15].label+"")&&re(r,o),m&40&&x(l,"active",e[5]===e[14])},d(h){h&&w(t),c&&c.d(h),h&&w(s),h&&w(l),u=!1,f()}}}function Yd(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:wC,then:kC,catch:yC,value:19,blocks:[,,,]};return lu(t=n[15].component,s),{c(){e=Oe(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e
|
||
|
<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-transparent btn-sm btn-block"),p(e,"class","list-item list-item-btn")},m(r,a){S(r,e,a),_(e,t),n[16](t),_(e,i),_(e,s),l||(o=[Y(t,"change",n[17]),Y(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&w(e),n[16](null),l=!1,Le(o)}}}function HT(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,m,g,b=n[4];const y=T=>T[25];for(let T=0;T<b.length;T+=1){let E=ep(n,b,T),O=y(E);d.set(O,c[T]=tp(O,E))}let k=n[0],$=[];for(let T=0;T<k.length;T+=1)$[T]=np(xd(n,k,T));const C=T=>P($[T],1,1,()=>{$[T]=null});let M=!n[8]&&ip(n);return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("div");for(let T=0;T<c.length;T+=1)c[T].c();h=D();for(let T=0;T<$.length;T+=1)$[T].c();m=D(),M&&M.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","list")},m(T,E){S(T,e,E),_(e,t),_(e,s),_(e,l),_(l,r),S(T,u,E),S(T,f,E);for(let O=0;O<c.length;O+=1)c[O].m(f,null);_(f,h);for(let O=0;O<$.length;O+=1)$[O].m(f,null);_(f,m),M&&M.m(f,null),n[19](f),g=!0},p(T,E){if((!g||E&8&&i!==(i=B.getFieldTypeIcon(T[3].type)))&&p(t,"class",i),(!g||E&8)&&o!==(o=T[3].name+"")&&re(r,o),(!g||E&2097152&&a!==(a=T[21]))&&p(e,"for",a),E&1558&&(b=T[4],de(),c=gt(c,E,y,1,T,b,d,f,Kt,tp,h,ep),pe()),E&2049){k=T[0];let O;for(O=0;O<k.length;O+=1){const I=xd(T,k,O);$[O]?($[O].p(I,E),A($[O],1)):($[O]=np(I),$[O].c(),A($[O],1),$[O].m(f,m))}for(de(),O=k.length;O<$.length;O+=1)C(O);pe()}T[8]?M&&(M.d(1),M=null):M?M.p(T,E):(M=ip(T),M.c(),M.m(f,null))},i(T){if(!g){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<k.length;E+=1)A($[E]);g=!0}},o(T){for(let E=0;E<c.length;E+=1)P(c[E]);$=$.filter(Boolean);for(let E=0;E<$.length;E+=1)P($[E]);g=!1},d(T){T&&w(e),T&&w(u),T&&w(f);for(let E=0;E<c.length;E+=1)c[E].d();yt($,T),M&&M.d(),n[19](null)}}}function jT(n){let e,t;return e=new me({props:{class:"form-field form-field-list form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[HT,({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-list form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&270533119&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function qT(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new fn}=e,c,d;function h(O){B.removeByValue(u,O),t(1,u)}function m(O){B.pushUnique(u,O),t(1,u)}function g(O){B.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>h(O),k=O=>m(O),$=O=>g(O);function C(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},T=()=>c==null?void 0:c.click();function E(O){ie[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,I;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=((O=f.options)==null?void 0:O.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)&&((I=f.options)==null?void 0:I.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,m,g,r,y,k,$,C,M,T,E]}class VT extends ke{constructor(e){super(),ye(this,e,qT,jT,be,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function sp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function zT(n,e){e=sp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback)
|
||
|
`),E&&E.c(),h=D(),g.c(),b=Oe(),p(s,"type","button"),p(s,"class","btn btn-transparent btn-hint p-l-sm p-r-sm"),p(e,"class","flex m-b-base flex-gap-10"),p(o,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,F){S(N,e,F),H(t,e,null),_(e,i),_(e,s),S(N,l,F),S(N,o,F);for(let V=0;V<r.length;V+=1)r[V].m(o,null);T&&T.m(o,null),S(N,f,F),S(N,c,F),_(c,d),E&&E.m(c,null),S(N,h,F),I[m].m(N,F),S(N,b,F),y=!0,k||($=[Y(s,"click",n[30]),Ie(u=zT.call(null,o,n[35]))],k=!0)},p(N,F){const V={};F[0]&4&&(V.value=N[2]),F[0]&4096&&(V.autocompleteCollection=N[12]),t.$set(V),F[0]&76716&&(C=N[3],de(),r=gt(r,F,M,1,N,C,a,o,Kt,fp,null,rp),pe(),!C.length&&T?T.p(N,F):C.length?T&&(T.d(1),T=null):(T=ap(N),T.c(),T.m(o,null))),u&&Zt(u.update)&&F[0]&1040&&u.update.call(null,N[35]),N[5]>1?E?E.p(N,F):(E=cp(N),E.c(),E.m(c,null)):E&&(E.d(1),E=null);let G=m;m=L(N),m===G?I[m].p(N,F):(de(),P(I[G],1,1,()=>{I[G]=null}),pe(),g=I[m],g?g.p(N,F):(g=I[m]=O[m](N),g.c()),A(g,1),g.m(b.parentNode,b))},i(N){if(!y){A(t.$$.fragment,N);for(let F=0;F<C.length;F+=1)A(r[F]);A(g),y=!0}},o(N){P(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)P(r[F]);P(g),y=!1},d(N){N&&w(e),j(t),N&&w(l),N&&w(o);for(let F=0;F<r.length;F+=1)r[F].d();T&&T.d(),N&&w(f),N&&w(c),E&&E.d(),N&&w(h),I[m].d(N),N&&w(b),k=!1,Le($)}}}function iM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=U("Select "),i=v("strong"),l=U(s),o=U(" records")},m(a,u){S(a,e,u),_(e,t),_(e,i),_(i,l),_(e,o)},p(a,u){var f;u[0]&4096&&s!==(s=(((f=a[12])==null?void 0:f.name)||"")+"")&&re(l,s)},d(a){a&&w(e)}}}function sM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[27]),Y(i,"click",n[28])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Le(l)}}}function lM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[18]];let o={$$slots:{footer:[sM],header:[iM],default:[nM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Ge(o,l[a]);e=new Bn({props:o}),n[38](e),e.$on("hide",n[39]),e.$on("show",n[40]);let r={collection:n[12]};return i=new ab({props:r}),n[41](i),i.$on("save",n[42]),i.$on("delete",n[43]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(a,u){H(e,a,u),S(a,t,u),H(i,a,u),s=!0},p(a,u){const f=u[0]&262144?nn(l,[l[0],l[1],Xn(a[18])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&4096&&(c.collection=a[12]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[38](null),j(e,a),a&&w(t),n[41](null),j(i,a)}}}const Dr=100;function oM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=Ot(e,c),h;Ke(n,es,_e=>t(25,h=_e));const m=Ct(),g="picker_"+B.randomString(5);let{value:b}=e,{field:y}=e,k,$,C="",M=[],T=[],E=1,O=0,I=!1,L=!1;function N(){return t(2,C=""),t(3,M=[]),t(6,T=[]),V(),G(!0),k==null?void 0:k.show()}function F(){return k==null?void 0:k.hide()}async function V(){const _e=B.toArray(b);if(!s||!_e.length)return;t(23,L=!0);let Je=[];const nt=_e.slice(),St=[];for(;nt.length>0;){const It=[];for(const Vt of nt.splice(0,Dr))It.push(`id="${Vt}"`);St.push(he.collection(s).getFullList(Dr,{filter:It.join("||"),$autoCancel:!1}))}try{await Promise.all(St).then(It=>{Je=Je.concat(...It)}),t(6,T=[]);for(const It of _e){const Vt=B.findByKey(Je,"id",It);Vt&&T.push(Vt)}C.trim()||t(3,M=B.filterDuplicatesByKey(T.concat(M)))}catch(It){he.errorResponseHandler(It)}t(23,L=!1)}async function G(_e=!1){if(s){t(4,I=!0),_e&&(C.trim()?t(3,M=[]):t(3,M=B.toArray(T).slice()));try{const Je=_e?1:E+1,nt=await he.collection(s).getList(Je,Dr,{filter:C,sort:"-created",$cancelKey:g+"loadList"});t(3,M=B.filterDuplicatesByKey(M.concat(nt.items))),E=nt.page,t(22,O=nt.totalItems)}catch(Je){he.errorResponseHandler(Je)}t(4,I=!1)}}function se(_e){i==1?t(6,T=[_e]):u&&(B.pushUnique(T,_e),t(6,T))}function K(_e){B.removeByKey(T,
|
||
|
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function bp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[13],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[7](n[13])}return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(h,m){S(h,e,m),_(e,t),H(i,t,null),_(e,s),_(e,l),_(l,o),_(e,r),a=!0,u||(f=[Ie(We.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(h,m){var b;n=h;const g={};m&8&&(g.record=n[13]),m&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(h){a||(A(i.$$.fragment,h),a=!0)},o(h){P(i.$$.fragment,h),a=!1},d(h){h&&w(e),j(i),u=!1,Le(f)}}}function aM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,m,g,b,y,k=n[3],$=[];for(let T=0;T<k.length;T+=1)$[T]=bp(pp(n,k,T));const C=T=>P($[T],1,1,()=>{$[T]=null});let M=null;return k.length||(M=mp(n)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("div"),c=v("div");for(let T=0;T<$.length;T+=1)$[T].c();M&&M.c(),d=D(),h=v("div"),m=v("button"),m.innerHTML=`<i class="ri-layout-line"></i>
|
||
|
<span class="txt">Open picker</span>`,p(t,"class",i=yi(B.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[12]),p(c,"class","relations-list svelte-1ynw0pc"),p(m,"type","button"),p(m,"class","btn btn-transparent btn-sm btn-block"),p(h,"class","list-item list-item-btn"),p(f,"class","list")},m(T,E){S(T,e,E),_(e,t),_(e,s),_(e,l),_(l,r),S(T,u,E),S(T,f,E),_(f,c);for(let O=0;O<$.length;O+=1)$[O].m(c,null);M&&M.m(c,null),_(f,d),_(f,h),_(h,m),g=!0,b||(y=Y(m,"click",n[8]),b=!0)},p(T,E){if((!g||E&4&&i!==(i=yi(B.getFieldTypeIcon(T[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!g||E&4)&&o!==(o=T[2].name+"")&&re(r,o),(!g||E&4096&&a!==(a=T[12]))&&p(e,"for",a),E&93){k=T[3];let O;for(O=0;O<k.length;O+=1){const I=pp(T,k,O);$[O]?($[O].p(I,E),A($[O],1)):($[O]=bp(I),$[O].c(),A($[O],1),$[O].m(c,null))}for(de(),O=k.length;O<$.length;O+=1)C(O);pe(),!k.length&&M?M.p(T,E):k.length?M&&(M.d(1),M=null):(M=mp(T),M.c(),M.m(c,null))}},i(T){if(!g){for(let E=0;E<k.length;E+=1)A($[E]);g=!0}},o(T){$=$.filter(Boolean);for(let E=0;E<$.length;E+=1)P($[E]);g=!1},d(T){T&&w(e),T&&w(u),T&&w(f),yt($,T),M&&M.d(),b=!1,y()}}}function uM(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[aM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l={value:n[0],field:n[2]};return i=new rM({props:l}),n[9](i),i.$on("save",n[10]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(o,r){H(e,o,r),S(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&4&&(a.class="form-field form-field-list "+(o[2].required?"required":"")),r&4&&(a.name=o[2].name),r&528415&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&1&&(u.value=o[0]),r&4&&(u.field=o[2]),i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[9](null),j(i,o)}}}const vp=100;function fM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new fn}=e,r=[],a=!1;u();async function u(){var k,$;const g=B.toArray(s);if(!((k=o==null?void 0:o.options)!=null&&k.collectionId)||!g.length){t(3,r=[]),t(4,a=!1);return}t(4,a=!0);const b=g.slice(),y=[];for(;b.length>0;){const C=[];for(const M of b.splice(0,vp))C.push(`id="${M}"`);y.push(he.collection(($=o==null?void 0:o.options)==null?void 0:$.collectionId).getFullList(vp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all(y).then(M=>{C=C.concat(...M)});for(const M of g){const T=B.findByKey(C,"id",M);T&&r.push(T)}t(3,r)}catch(C){he.errorResponseHandler(C)}t(4,a=!1)}function f(g){var b;B.removeByKey(r,"id",g.id),t(3,r),i?t(0,s=r.map(y=>y.id)):t(0,s=((b=r[0])==null?void 0:b.id)||"")}const c=g=>f(g),d=()=>l==null?void 0:l.show();function h(g){ie[g?"unshift":"push"](()=>{l=g,t(1,l)})}const m=g=>{t(3,r=g.detail||[]),t(0,s=i?r.map(b=>b.id):r[0]||"")};return n.$$set=g=>{"value"in g&&t(0,s=g.value),"picker"in g&&t(1,l=g.picker),"field"in g&&t(2,o=g.field)},n.$$.update=()=>{var g;n.$$.dirty&4&&t(5,i=((g=o.options)==null?void 0:g.maxSelect)!=1)},[s,l,o,r,a,i,f,c,d,h,m]}class cM extends ke{constructor(e){super(),ye(this,e,fM,uM,be,{value:0,picker:1,field:2})}}const dM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],pM=(n,e)=>{dM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function hM(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),Ar(e,"visibility","hidden")},m
|
||
|
Updated: ${n[2].updated}`,position:"left"})),b=!0)},p(k,$){$[1]&524288&&r!==(r=k[50])&&p(e,"for",r),c&&Zt(c.update)&&$[0]&4&&c.update.call(null,{text:`Created: ${k[2].created}
|
||
|
Updated: ${k[2].updated}`,position:"left"}),$[1]&524288&&m!==(m=k[50])&&p(h,"id",m),$[0]&4&&g!==(g=k[2].id)&&h.value!==g&&(h.value=g)},d(k){k&&w(e),k&&w(a),k&&w(u),k&&w(d),k&&w(h),b=!1,y()}}}function Cp(n){var u,f;let e,t,i,s,l;function o(c){n[26](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new FC({props:r}),ie.push(()=>ve(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Tp();return{c(){q(e.$$.fragment),i=D(),a&&a.c(),s=Oe()},m(c,d){H(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var m,g;const h={};d[0]&1&&(h.collection=c[0]),!t&&d[0]&4&&(t=!0,h.record=c[2],we(()=>t=!1)),e.$set(h),(g=(m=c[0])==null?void 0:m.schema)!=null&&g.length?a||(a=Tp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Tp(n){let e;return{c(){e=v("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function JM(n){let e,t,i;function s(o){n[39](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new cM({props:l}),ie.push(()=>ve(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[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ZM(n){let e,t,i,s,l;function o(f){n[36](f,n[47])}function r(f){n[37](f,n[47])}function a(f){n[38](f,n[47])}let u={field:n[47],record:n[2]};return n[2][n[47].name]!==void 0&&(u.value=n[2][n[47].name]),n[3][n[47].name]!==void 0&&(u.uploadedFiles=n[3][n[47].name]),n[4][n[47].name]!==void 0&&(u.deletedFileIndexes=n[4][n[47].name]),e=new VT({props:u}),ie.push(()=>ve(e,"value",o)),ie.push(()=>ve(e,"uploadedFiles",r)),ie.push(()=>ve(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[47]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[47].name],we(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[47].name],we(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[47].name],we(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function GM(n){let e,t,i;function s(o){n[35](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new _T({props:l}),ie.push(()=>ve(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[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function XM(n){let e,t,i;function s(o){n[34](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new pT({props:l}),ie.push(()=>ve(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[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QM(n){let e,t,i;function s(o){n[33](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new uT({props:l}),ie.push(()=>ve(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[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xM(n){let e,t,i;function s(o){n[32](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new $M({props:l}),ie.push(()=>ve(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[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function eD(n){let e,t,i;function s(o){n[31](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new lT({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e
|
||
|
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[21]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Ap(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||
|
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[22]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function oD(n){let e,t,i,s,l,o=n[0].isAuth&&!n[7].verified&&n[7].email&&Ep(n),r=n[0].isAuth&&n[7].email&&Ap(n);return{c(){o&&o.c(),e=D(),r&&r.c(),t=D(),i=v("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
|
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(a,u){o&&o.m(a,u),S(a,e,u),r&&r.m(a,u),S(a,t,u),S(a,i,u),s||(l=Y(i,"click",bn(ct(n[23]))),s=!0)},p(a,u){a[0].isAuth&&!a[7].verified&&a[7].email?o?o.p(a,u):(o=Ep(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a[0].isAuth&&a[7].email?r?r.p(a,u):(r=Ap(a),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(a){o&&o.d(a),a&&w(e),r&&r.d(a),a&&w(t),a&&w(i),s=!1,l()}}}function Ip(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=D(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[10]===Yi),p(s,"type","button"),p(s,"class","tab-item"),x(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),_(e,t),_(e,i),_(e,s),l||(o=[Y(t,"click",n[24]),Y(s,"click",n[25])],l=!0)},p(r,a){a[0]&1024&&x(t,"active",r[10]===Yi),a[0]&1024&&x(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Le(o)}}}function rD(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,h=!n[2].isNew&&Op(n),m=n[0].isAuth&&!n[2].isNew&&Ip(n);return{c(){e=v("h4"),i=U(t),s=D(),l=v("strong"),r=U(o),a=U(" record"),u=D(),h&&h.c(),f=D(),m&&m.c(),c=Oe()},m(b,y){S(b,e,y),_(e,i),_(e,s),_(e,l),_(l,r),_(e,a),S(b,u,y),h&&h.m(b,y),S(b,f,y),m&&m.m(b,y),S(b,c,y),d=!0},p(b,y){var k;(!d||y[0]&4)&&t!==(t=b[2].isNew?"New":"Edit")&&re(i,t),(!d||y[0]&1)&&o!==(o=((k=b[0])==null?void 0:k.name)+"")&&re(r,o),b[2].isNew?h&&(de(),P(h,1,1,()=>{h=null}),pe()):h?(h.p(b,y),y[0]&4&&A(h,1)):(h=Op(b),h.c(),A(h,1),h.m(f.parentNode,f)),b[0].isAuth&&!b[2].isNew?m?m.p(b,y):(m=Ip(b),m.c(),m.m(c.parentNode,c)):m&&(m.d(1),m=null)},i(b){d||(A(h),d=!0)},o(b){P(h),d=!1},d(b){b&&w(e),b&&w(u),h&&h.d(b),b&&w(f),m&&m.d(b),b&&w(c)}}}function aD(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],x(s,"btn-loading",n[8])},m(c,d){S(c,e,d),_(e,t),S(c,i,d),S(c,s,d),_(s,l),_(l,r),u||(f=Y(e,"click",n[20]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&re(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&x(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function uD(n){var s;let e,t,i={class:"overlay-panel-lg record-panel "+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":""),beforeHide:n[40],$$slots:{footer:[aD],header:[rD],default:[lD]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[41](e),e.$on("hide",n[42]),e.$on("show",n[43]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&5&&(r.class="overlay-panel-lg record-panel "+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")),o[0]&544&&(r.beforeHide=l[40]),o[0]&3485|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[41](null),j(e,l)}}}const Yi="form",yl="providers";function Pp(n){return JSON.stringify(n)}function fD(n,e,t){let i,s,l;const o=Ct(),r="record_"+B.randomString(5);let{collection:a}=e,u,f=null,c=new Ki,d=!1,h=!1,m={},g={},b="",y=Yi;function k(Z){return C(Z),t(9,h=!0),t(10,y=Yi),u==null?void 0:u.show()}function $(){return u==null?void 0:u.hide()}async function C(Z){Vn({}),t(7,f=Z||{}),Z!=null&&Z.clone?t(2,c=Z.clone()):t(2,c=new Ki),t(3,m={}),t(4,g={}),await In(),t(18,b=Pp(c))}function M(){if(d||!l||!(a!=null&&a.id))return;t(8,d=!0);const Z=E();let ce;c.isNew?ce=he.collection(a.id).create(Z):ce=he.collection(a.id).update(c.id,Z),ce.then(Se=>{qt(c.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),$(),o("save",Se)}).catch(Se=>{he.errorResponseHandler(Se)}).finally(()=>{t(8,d=!1)})}function T(){f!=null&&f.id&&Dn("Do you really want to delete the selected record?",()=>he.collection(f
|
||
|
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function zD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[38]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i;return{c(){e=v("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){S(s,e,l),t||(i=Y(e,"click",n[37]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function th(n){let e,t,i,s,l;i=new nu({props:{id:n[54].id}});let o=n[2].isAuth&&nh(n);return{c(){e=v("td"),t=v("div"),q(i.$$.fragment),s=D(),o&&o.c(),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(r,a){S(r,e,a),_(e,t),H(i,t,null),_(t,s),o&&o.m(t,null),l=!0},p(r,a){const u={};a[0]&16&&(u.id=r[54].id),i.$set(u),r[2].isAuth?o?o.p(r,a):(o=nh(r),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){P(i.$$.fragment,r),l=!1},d(r){r&&w(e),j(i),o&&o.d()}}}function nh(n){let e;function t(l,o){return l[54].verified?WD:UD}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function UD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(We.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function WD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(We.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function ih(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&sh(n),o=i&&lh(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=Oe()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=sh(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=lh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function sh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!B.isEmpty(o[54].username)),t?KD:YD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function YD(n){let e,t=n[54].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[54].username)},m(l,o){S(l,e,o),_(e,i)},p(l,o){o[0]&16&&t!==(t=l[54].username+"")&&re(i,t),o[0]&16&&s!==(s=l[54].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function KD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function lh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!B.isEmpty(o[54].email)),t?ZD:JD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function JD(n){let e,t=n[54].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[54].email)},m(l,o){S(l,e,o),_(e,i)},p(l,o){o[0]&16&&t!==(t=l[54].email+"")&&re(i,t),o[0]&16&&s!==(s=l[54].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function ZD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function oh(n,e){let t,i,s;return i=new AD({props:{record:e[54],field:e[57]}}),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&16&&(r.record=e[54]),o[0]&65536&&(r.field=e[57]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function rh(n){let e,t,i;return t=new Zi({props:{date:n[54].created}}),{c(){e=v("td"),q(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[54].created),t.$set(
|
||
|
<span class="txt">API Preview</span>`,g=D(),b=v("button"),b.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">New record</span>`,y=D(),q(k.$$.fragment),$=D(),C=v("div"),M=D(),q(T.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(m,"type","button"),p(m,"class","btn btn-outline"),p(b,"type","button"),p(b,"class","btn btn-expanded"),p(h,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-base")},m(K,te){S(K,e,te),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),_(e,u),F&&F.m(u,null),_(u,f),H(c,u,null),_(e,d),_(e,h),_(h,m),_(h,g),_(h,b),S(K,y,te),H(k,K,te),S(K,$,te),S(K,C,te),S(K,M,te),H(T,K,te),I=!0,L||(N=[Y(m,"click",n[16]),Y(b,"click",n[17])],L=!0)},p(K,te){(!I||te[0]&4)&&o!==(o=K[2].name+"")&&re(r,o),K[9]?F&&(F.d(1),F=null):F?F.p(K,te):(F=hh(K),F.c(),F.m(u,f));const ne={};te[0]&1&&(ne.value=K[0]),te[0]&4&&(ne.autocompleteCollection=K[2]),k.$set(ne);const z={};te[0]&4&&(z.collection=K[2]),!E&&te[0]&1&&(E=!0,z.filter=K[0],we(()=>E=!1)),!O&&te[0]&2&&(O=!0,z.sort=K[1],we(()=>O=!1)),T.$set(z)},i(K){I||(A(c.$$.fragment,K),A(k.$$.fragment,K),A(T.$$.fragment,K),I=!0)},o(K){P(c.$$.fragment,K),P(k.$$.fragment,K),P(T.$$.fragment,K),I=!1},d(K){K&&w(e),F&&F.d(),j(c),K&&w(y),j(k,K),K&&w($),K&&w(C),K&&w(M),n[19](null),j(T,K),L=!1,Le(N)}}}function aO(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=D(),i=v("button"),i.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<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){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[13]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function uO(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function fO(n){let e,t,i;function s(r,a){return r[9]?uO:aO}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("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){S(r,e,a),_(e,t),_(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&&w(e),o.d()}}}function cO(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
|
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function dO(n){let e,t,i,s,l,o,r,a,u;const f=[oO,lO,sO],c=[];function d(b,y){return b[3]&&!b[8].length?0:b[8].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new tu({props:h}),n[24](s);let m={};o=new MC({props:m}),n[25](o);let g={collection:n[2]};return a=new ab({props:g}),n[26](a),a.$on("save",n[27]),a.$on("delete",n[28]),{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),S(b,i,y),H(s,b,y),S(b,l,y),H(o,b,y),S(b,r,y),H(a,b,y),u=!0},p(b,y){let k=e;e=d(b),e===k?c[e].p(b,y):(de(),P(c[k],1,1,()=>{c[k]=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 $={};s.$set($);const C={};o.$set(C);const M={};y[0]&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&w(i),n[24](null),j(s,b),b&&w(l),n[25](null),j(o,b),b&&w(r),n[26](null),j(a,b)}}}function pO(n,e,t){let i,s,l,o,r,a,u;Ke(n,Si,z=>t(2,s=z)),Ke(n,Po,z=>t(3,l=z)),Ke(n,ha,z=>t(12,o=z)),Ke(n,kt,z=>t(29,r=z)),Ke(n,es,z=>t(8,a=z)),Ke(n,Ts,z=>t(9,u=z)),Wt(kt,r="Collections",r);const f=new URLSearchParams(o);let c,d,h,m,g=f.get("filter")||"",b=f.get("sort")||"-created",y=f.get("collectionId")||(s==null?void 0:s.id);function k(){t(10,y=s.id),t(1,b="-created"),t(0,g="")}tb(y);const $=()=>c==null?void 0:c.show(),C=()=>c==null?void 0:c.show(s),M=()=>m==null?void 0:m.load(),T=()=>d==null?void 0:d.show(s),E=()=>h==null?void 0:h.show(),O=z=>t(0,g=z.detail);function I(z){ie[z?"unshift":"push"](()=>{m=z,t(7,m)})}function L(z){g=z,t(0,g)}function N(z){b=z,t(1,b)}const F=z=>h==null?void 0:h.show(z==null?void 0:z.detail),V=()=>h==null?void 0:h.show();function G(z){ie[z?"unshift":"push"](()=>{c=z,t(4,c)})}function se(z){ie[z?"unshift":"push"](()=>{d=z,t(5,d)})}function K(z){ie[z?"unshift":"push"](()=>{h=z,t(6,h)})}const te=()=>m==null?void 0:m.reloadLoadedPages(),ne=()=>m==null?void 0:m.reloadLoadedPages();return n.$$.update=()=>{if(n.$$.dirty[0]&4096&&t(11,i=new URLSearchParams(o)),n.$$.dirty[0]&3080&&!l&&i.get("collectionId")&&i.get("collectionId")!=y&&i4(i.get("collectionId")),n.$$.dirty[0]&1028&&s!=null&&s.id&&y!=s.id&&k(),n.$$.dirty[0]&7&&(b||g||s!=null&&s.id)){const z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:b}).toString();$i("/collections?"+z)}},[g,b,s,l,c,d,h,m,a,u,y,i,o,$,C,M,T,E,O,I,L,N,F,V,G,se,K,te,ne]}class hO extends ke{constructor(e){super(),ye(this,e,pO,dO,be,{},null,[-1,-1])}}function mO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=D(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
|
||
|
<span class="txt">Application</span>`,o=D(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||
|
<span class="txt">Mail settings</span>`,a=D(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||
|
<span class="txt">Files storage</span>`,f=D(),c=v("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),h=v("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
|
||
|
<span class="txt">Export collections</span>`,m=D(),g=v("a"),g.innerHTML=`<i class="ri-install-line"></i>
|
||
|
<span class="txt">Import collections</span>`,b=D(),y=v("div"),y.textContent="Authentication",k=D(),$=v("a"),$.innerHTML=`<i class="ri-lock-password-line"></i>
|
||
|
<span class="txt">Auth providers</span>`,C=D(),M=v("a"),M.innerHTML=`<i class="ri-key-line"></i>
|
||
|
<span class="txt">Token options</span>`,T=D(),E=v("a"),E.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(g,"href","/settings/import-collections"),p(g,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(E,"href","/settings/admins"),p(E,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),_(t,f),_(t,c),_(t,d),_(t,h),_(t,m),_(t,g),_(t,b),_(t,y),_(t,k),_(t,$),_(t,C),_(t,M),_(t,T),_(t,E),O||(I=[Ie(Fn.call(null,l,{path:"/settings"})),Ie(Qt.call(null,l)),Ie(Fn.call(null,r,{path:"/settings/mail/?.*"})),Ie(Qt.call(null,r)),Ie(Fn.call(null,u,{path:"/settings/storage/?.*"})),Ie(Qt.call(null,u)),Ie(Fn.call(null,h,{path:"/settings/export-collections/?.*"})),Ie(Qt.call(null,h)),Ie(Fn.call(null,g,{path:"/settings/import-collections/?.*"})),Ie(Qt.call(null,g)),Ie(Fn.call(null,$,{path:"/settings/auth-providers/?.*"})),Ie(Qt.call(null,$)),Ie(Fn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(Qt.call(null,M)),Ie(Fn.call(null,E,{path:"/settings/admins/?.*"})),Ie(Qt.call(null,E))],O=!0)},p:X,i:X,o:X,d(L){L&&w(e),O=!1,Le(I)}}}class Di extends ke{constructor(e){super(),ye(this,e,null,mO,be,{})}}function mh(n,e,t){const i=n.slice();return i[30]=e[t],i}function gh(n){let e,t;return e=new me({props:{class:"form-field disabled",name:"id",$$slots:{default:[gO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="ID",o=D(),r=v("div"),a=v("i"),f=D(),c=v("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=h=n[1].id,c.disabled=!0},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),S(b,r,y),_(r,a),S(b,f,y),S(b,c,y),m||(g=Ie(u=We.call(null,a,{text:`Created: ${n[1].created}
|
||
|
Updated: ${n[1].updated}`,position:"left"})),m=!0)},p(b,y){y[0]&536870912&&l!==(l=b[29])&&p(e,"for",l),u&&Zt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${b[1].created}
|
||
|
Updated: ${b[1].updated}`,position:"left"}),y[0]&536870912&&d!==(d=b[29])&&p(c,"id",d),y[0]&2&&h!==(h=b[1].id)&&c.value!==h&&(c.value=h)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(c),m=!1,g()}}}function _h(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=D(),jn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),_(e,t),_(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function _O(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&fe(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function bh(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[bO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function bO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function vh(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[vO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[yO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),_(e,t),_(t,i),H(s,i,null),_(t,l),_(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&536871424|c[1]&4&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&tt(()=>{a||(a=qe(t,Et,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=qe(t,Et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function vO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&fe(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function yO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&5
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $O(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&yh(n);return{c(){h&&h.c(),e=D(),t=v("button"),i=v("span"),i.textContent="Cancel",s=D(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),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],x(l,"btn-loading",n[6])},m(m,g){h&&h.m(m,g),S(m,e,g),S(m,t,g),_(t,i),S(m,s,g),S(m,l,g),_(l,o),_(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(m,g){m[1].isNew?h&&(de(),P(h,1,1,()=>{h=null}),pe()):h?(h.p(m,g),g[0]&2&&A(h,1)):(h=yh(m),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=m[6]),(!f||g[0]&2)&&r!==(r=m[1].isNew?"Create":"Save changes")&&re(a,r),(!f||g[0]&1088&&u!==(u=!m[10]||m[6]))&&(l.disabled=u),(!f||g[0]&64)&&x(l,"btn-loading",m[6])},i(m){f||(A(h),f=!0)},o(m){P(h),f=!1},d(m){h&&h.d(m),m&&w(e),m&&w(t),m&&w(s),m&&w(l),c=!1,d()}}}function CO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[$O],header:[wO],default:[kO]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function TO(n,e,t){let i;const s=Ct(),l="admin_"+B.randomString(5);let o,r=new Ji,a=!1,u=!1,f=0,c="",d="",h="",m=!1;function g(K){return y(K),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(K){t(1,r=K!=null&&K.clone?K.clone():new Ji),k()}function k(){t(4,m=!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=""),Vn({})}function $(){if(a||!i)return;t(6,a=!0);const K={email:c,avatar:f};(r.isNew||m)&&(K.password=d,K.passwordConfirm=h);let te;r.isNew?te=he.admins.create(K):te=he.admins.update(r.id,K),te.then(async ne=>{var z;t(7,u=!1),b(),qt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((z=he.authStore.model)==null?void 0:z.id)===ne.id&&he.authStore.save(he.authStore.token,ne)}).catch(ne=>{he.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&Dn("Do you really want to delete the selected admin?",()=>he.admins.delete(r.id).then(()=>{t(7,u=!1),b(),qt("Successfully deleted admin."),s("delete",r)}).catch(K=>{he.errorResponseHandler(K)}))}const M=()=>C(),T=()=>b(),E=K=>t(2,f=K);function O(){c=this.value,t(3,c)}function I(){m=this.checked,t(4,m)}function L(){d=this.value,t(8,d)}function N(){h=this.value,t(9,h)}const F=()=>i&&u?(Dn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function V(K){ie[K?"unshift":"push"](()=>{o=K,t(5,o)})}function G(K){Be.call(this,n,K)}function se(K){Be.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||m||c!==r.email||f!==r.avatar)},[b,r,f,c,m,o,a,u,d,h,i,l,$,C,g,M,T,E,O,I,L,N,F,V,G,se]}class MO extends ke{constructor(e){super(),ye(this,e,TO,CO,be,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function kh(n,e,t){const i=n.slice();return i[24]=e[t],i}function DO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function OO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function EO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",p(t,"
|
||
|
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Sh(n){let e,t,i;return{c(){e=v("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){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $h(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ch(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,m=e[24].email+"",g,b,y,k,$,C,M,T,E,O,I,L,N,F;u=new nu({props:{id:e[24].id}});let V=e[24].id===e[7].id&&$h();$=new Zi({props:{date:e[24].created}}),T=new Zi({props:{date:e[24].updated}});function G(){return e[15](e[24])}function se(...K){return e[16](e[24],...K)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=D(),a=v("td"),q(u.$$.fragment),f=D(),V&&V.c(),c=D(),d=v("td"),h=v("span"),g=U(m),y=D(),k=v("td"),q($.$$.fragment),C=D(),M=v("td"),q(T.$$.fragment),E=D(),O=v("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',I=D(),jn(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(k,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,te){S(K,t,te),_(t,i),_(i,s),_(s,l),_(t,r),_(t,a),H(u,a,null),_(a,f),V&&V.m(a,null),_(t,c),_(t,d),_(d,h),_(h,g),_(t,y),_(t,k),H($,k,null),_(t,C),_(t,M),H(T,M,null),_(t,E),_(t,O),_(t,I),L=!0,N||(F=[Y(t,"click",G),Y(t,"keydown",se)],N=!0)},p(K,te){e=K,(!L||te&16&&!jn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ne={};te&16&&(ne.id=e[24].id),u.$set(ne),e[24].id===e[7].id?V||(V=$h(),V.c(),V.m(a,null)):V&&(V.d(1),V=null),(!L||te&16)&&m!==(m=e[24].email+"")&&re(g,m),(!L||te&16&&b!==(b=e[24].email))&&p(h,"title",b);const z={};te&16&&(z.date=e[24].created),$.$set(z);const Q={};te&16&&(Q.date=e[24].updated),T.$set(Q)},i(K){L||(A(u.$$.fragment,K),A($.$$.fragment,K),A(T.$$.fragment,K),L=!0)},o(K){P(u.$$.fragment,K),P($.$$.fragment,K),P(T.$$.fragment,K),L=!1},d(K){K&&w(t),j(u),V&&V.d(),j($),j(T),N=!1,Le(F)}}}function LO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M=[],T=new Map,E;function O(z){n[11](z)}let I={class:"col-type-text",name:"id",$$slots:{default:[DO]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Bt({props:I}),ie.push(()=>ve(o,"sort",O));function L(z){n[12](z)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[OO]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Bt({props:N}),ie.push(()=>ve(u,"sort",L));function F(z){n[13](z)}let V={class:"col-type-date col-field-created",name:"created",$$slots:{default:[EO]},$$scope:{ctx:n}};n[2]!==void 0&&(V.sort=n[2]),d=new Bt({props:V}),ie.push(()=>ve(d,"sort",F));function G(z){n[14](z)}let se={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[AO]},$$scope:{ctx:n}};n[2]!==void 0&&(se.sort=n[2]),g=new Bt({props:se}),ie.push(()=>ve(g,"sort",G));let K=n[4];const te=z=>z[24].id;for(let z=0;z<K.length;z+=1){let Q=kh(n,K,z),J=te(Q);T.set(J,M[z]=Ch(J,Q))}let ne=null;return K.length||(ne=wh(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=D(),q(o.$$.fragment),a=D(),q(u.$$.fragment),c=D(),q(d.$$.fragment),m=D(),q(g.$$.fragment),y=D(),k=v("th"),$=D(),C=v("tbody");for(let z=0;z<M.length;z+=1)M[z].c();ne&&ne.c(),p(s,"class","min-width"),p(k,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[5])},m(z,Q){S(z,e,Q),_(e,t),_(t,i),_(i,s),_(i,l),H(o,i,null),_(i,a),H(u,i,null),_(i,c),H(d,i,null),_(i,m),H(g,i,null),_(i,y),_(i,k),_(e,$),_(e,C);for(let J=0;J<M.length;J+=1)M[J].m(C,null);ne&&ne.m(C,null),E=!0},p(z,Q){const J={};Q&134217728&&(J.$$scope={dirty:Q,ctx:z}),!r&&Q&4&&(r=!0,J.sort=z[2],we(()=>r=!1)),o.$set(J);const ae={};Q&13421
|
||
|
<span class="txt">New admin</span>`,h=D(),q(m.$$.fragment),g=D(),b=v("div"),y=D(),q(k.$$.fragment),$=D(),O&&O.c(),C=Oe(),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(b,"class","clearfix m-b-base")},m(I,L){S(I,e,L),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(e,r),H(a,e,null),_(e,u),_(e,f),_(e,c),_(e,d),S(I,h,L),H(m,I,L),S(I,g,L),S(I,b,L),S(I,y,L),H(k,I,L),S(I,$,L),O&&O.m(I,L),S(I,C,L),M=!0,T||(E=Y(d,"click",n[9]),T=!0)},p(I,L){(!M||L&64)&&re(o,I[6]);const N={};L&2&&(N.value=I[1]),m.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),k.$set(F),I[4].length?O?O.p(I,L):(O=Th(I),O.c(),O.m(C.parentNode,C)):O&&(O.d(1),O=null)},i(I){M||(A(a.$$.fragment,I),A(m.$$.fragment,I),A(k.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(m.$$.fragment,I),P(k.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(h),j(m,I),I&&w(g),I&&w(b),I&&w(y),j(k,I),I&&w($),O&&O.d(I),I&&w(C),T=!1,E()}}}function FO(n){let e,t,i,s,l,o;e=new Di({}),i=new vn({props:{$$slots:{default:[NO]},$$scope:{ctx:n}}});let r={};return l=new MO({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),S(a,t,u),H(i,a,u),S(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){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function RO(n,e,t){let i,s,l;Ke(n,ha,N=>t(21,i=N)),Ke(n,kt,N=>t(6,s=N)),Ke(n,Ma,N=>t(7,l=N)),Wt(kt,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=[]),he.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),h(),he.errorResponseHandler(N,!1))})}function h(){t(4,a=[])}const m=()=>d(),g=()=>r==null?void 0:r.show(),b=N=>t(1,f=N.detail);function y(N){c=N,t(2,c)}function k(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),T=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},E=()=>t(1,f="");function O(N){ie[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();$i("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,m,g,b,y,k,$,C,M,T,E,O,I,L]}class HO extends ke{constructor(e){super(),ye(this,e,RO,FO,be,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function jO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=D(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function qO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=D(),l=v("input"),r=D(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){S(d,e,h),_(e,t),S(d,s,h),S(d,l,h),fe(l,n[1]),S(d,r,h),S(d,a,h),_(a,u),f||(c=[Y(l,"input",n[5]),Ie(Qt.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&fe(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Le(c)}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[jO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:
|
||
|
<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"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){S(d,e,h),_(e,t),_(e,i),H(s,e,null),_(e,l),H(o,e,null),_(e,r),_(e,a),u=!0,f||(c=Y(e,"submit",ct(n[3])),f=!0)},p(d,h){const m={};h&769&&(m.$$scope={dirty:h,ctx:d}),s.$set(m);const g={};h&770&&(g.$$scope={dirty:h,ctx:d}),o.$set(g),(!u||h&4)&&x(a,"btn-disabled",d[2]),(!u||h&4)&&x(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function zO(n){let e,t;return e=new t_({props:{$$slots:{default:[VO]},$$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){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function BO(n,e,t){let i;Ke(n,ha,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),he.admins.authWithPassword(l,o).then(()=>{Ca(),$i("/")}).catch(()=>{cl("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 UO extends ke{constructor(e){super(),ye(this,e,BO,zO,be,{})}}function WO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[KO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[JO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[ZO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[GO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}});let T=n[3]&&Mh(n);return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),c=D(),d=v("div"),h=v("div"),m=D(),T&&T.c(),g=D(),b=v("button"),y=v("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=k=!n[3]||n[2],x(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(E,O){S(E,e,O),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),H(a,e,null),_(e,u),H(f,e,null),_(e,c),_(e,d),_(d,h),_(d,m),T&&T.m(d,null),_(d,g),_(d,b),_(b,y),$=!0,C||(M=Y(b,"click",n[13]),C=!0)},p(E,O){const I={};O&1572865&&(I.$$scope={dirty:O,ctx:E}),i.$set(I);const L={};O&1572865&&(L.$$scope={dirty:O,ctx:E}),o.$set(L);const N={};O&1572865&&(N.$$scope={dirty:O,ctx:E}),a.$set(N);const F={};O&1572865&&(F.$$scope={dirty:O,ctx:E}),f.$set(F),E[3]?T?T.p(E,O):(T=Mh(E),T.c(),T.m(d,g)):T&&(T.d(1),T=null),(!$||O&12&&k!==(k=!E[3]||E[2]))&&(b.disabled=k),(!$||O&4)&&x(b,"btn-loading",E[2])},i(E){$||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(a.$$.fragment,E),A(f.$$.fragment,E),$=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(a.$$.fragment,E),P(f.$$.fragment,E),$=!1},d(E){E&&w(e),j(i),j(o),j(a),j(f),T&&T.d(),C=!1,M()}}}function YO(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=D(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.appName),r||(a=Y(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&&fe(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application url"),s=D(),l=v("inpu
|
||
|
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,m){S(h,e,m),S(h,t,m),S(h,i,m),_(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",ct(n[4])),a=!0)},p(h,m){let g=l;l=d(h),l===g?c[l].p(h,m):(de(),P(c[g],1,1,()=>{c[g]=null}),pe(),o=c[l],o?o.p(h,m):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){P(o),r=!1},d(h){h&&w(e),h&&w(t),h&&w(i),c[l].d(),a=!1,u()}}}function QO(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[XO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(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){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function xO(n,e,t){let i,s,l,o;Ke(n,Ts,T=>t(14,s=T)),Ke(n,vo,T=>t(15,l=T)),Ke(n,kt,T=>t(16,o=T)),Wt(kt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const T=await he.settings.getAll()||{};m(T)}catch(T){he.errorResponseHandler(T)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const T=await he.settings.update(B.filterRedactedProps(a));m(T),qt("Successfully saved application settings.")}catch(T){he.errorResponseHandler(T)}t(2,f=!1)}}function m(T={}){var E,O;Wt(vo,l=(E=T==null?void 0:T.meta)==null?void 0:E.appName,l),Wt(Ts,s=!!((O=T==null?void 0:T.meta)!=null&&O.hideControls),s),t(0,a={meta:(T==null?void 0:T.meta)||{},logs:(T==null?void 0:T.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){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 k(){a.logs.maxDays=dt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),M=()=>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,g,r,c,b,y,k,$,C,M]}class eE extends ke{constructor(e){super(),ye(this,e,xO,QO,be,{})}}function tE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Ge(l,s[o]);return{c(){e=v("input"),Zn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),fe(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Zn(e,l=nn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&fe(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function nE(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=Ge(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Zn(s,a)},m(u,f){S(u,e,f),_(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(We.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Zn(s,a=nn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Le(o)}}}function iE(n){let e;function t(l,o){return l[3]?nE:tE}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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:X,o:X,d(l){s.d(l),l&&w(e)}}}function sE(n,e,t){const i=["value","mask"];let s=Ot(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await In(),r==null||r.focus()}const f=()=>u();function c(h){ie[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=Ge(Ge({},e),Gn(h)),t(5,s=Ot(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 ke{constructor(e){super(),ye(this,e,sE,iE,be,{value:0,mask:1})}}function lE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;return{c(){e=v("label"),t=U("Subject"),s=D(),l=v("input"),r=D(),a=v("div"),u=U(`Available placeholder para
|
||
|
`),f=v("button"),f.textContent=`{APP_NAME}
|
||
|
`,c=U(`,
|
||
|
`),d=v("button"),d.textContent=`{APP_URL}
|
||
|
`,h=U("."),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,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){S(b,e,y),_(e,t),S(b,s,y),S(b,l,y),fe(l,n[0].subject),S(b,r,y),S(b,a,y),_(a,u),_(a,f),_(a,c),_(a,d),_(a,h),m||(g=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],m=!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&&fe(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),m=!1,Le(g)}}}function oE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y;return{c(){e=v("label"),t=U("Action URL"),s=D(),l=v("input"),r=D(),a=v("div"),u=U(`Available placeholder parameters:
|
||
|
`),f=v("button"),f.textContent=`{APP_NAME}
|
||
|
`,c=U(`,
|
||
|
`),d=v("button"),d.textContent=`{APP_URL}
|
||
|
`,h=U(`,
|
||
|
`),m=v("button"),m.textContent=`{TOKEN}
|
||
|
`,g=U("."),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,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(m,"type","button"),p(m,"class","label label-sm link-primary txt-mono"),p(m,"title","Required parameter"),p(a,"class","help-block")},m(k,$){S(k,e,$),_(e,t),S(k,s,$),S(k,l,$),fe(l,n[0].actionUrl),S(k,r,$),S(k,a,$),_(a,u),_(a,f),_(a,c),_(a,d),_(a,h),_(a,m),_(a,g),b||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(m,"click",n[19])],b=!0)},p(k,$){$[1]&1&&i!==(i=k[31])&&p(e,"for",i),$[1]&1&&o!==(o=k[31])&&p(l,"id",o),$[0]&1&&l.value!==k[0].actionUrl&&fe(l,k[0].actionUrl)},d(k){k&&w(e),k&&w(s),k&&w(l),k&&w(r),k&&w(a),b=!1,Le(y)}}}function rE(n){let e,t,i,s;return{c(){e=v("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){S(l,e,o),fe(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&fe(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function aE(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=Yt(o,r(n)),ie.push(()=>ve(e,"value",l))),{c(){e&&q(e.$$.fragment),i=Oe()},m(a,u){e&&H(e,a,u),S(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,we(()=>t=!1)),o!==(o=a[4])){if(e){de();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),pe()}o?(e=Yt(o,r(a)),ie.push(()=>ve(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&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function uE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C;const M=[aE,rE],T=[];function E(O,I){return O[4]&&!O[5]?0:1}return l=E(n),o=T[l]=M[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=D(),o.c(),r=D(),a=v("div"),u=U(`Available placeholder parameters:
|
||
|
`),f=v("button"),f.textContent=`{APP_NAME}
|
||
|
`,c=U(`,
|
||
|
`),d=v("button"),d.textContent=`{APP_URL}
|
||
|
`,h=U(`,
|
||
|
`),m=v("button"),m.textContent=`{TOKEN}
|
||
|
`,g=U(`,
|
||
|
`),b=v("button"),b.textContent=`{ACTION_URL}
|
||
|
`,y=U("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(m,"type","button"),p(m,"class","label label-sm link-primary txt-mono"),p(b,"type","button"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(O,I){S(O,e,I),_(e,t),S(O,s,I),T[l].m(O,I),S(O,r,I),S(O,a,I),_(a,u),_(a,f),_(a,c),_(a,d),_(a,h),_(a,m),_(a,g),_(a,b),_(a,y),k=!0,$||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(m,"click",n[24]),Y(b,"click",n[25])],$=!0)},p(O,I){(!k||I[1]&1&&i!==(i=O[31]))&&p(e,"for",i);let L=l;l=E(O),l===L?T[l].p(O,I):(de(),P(T[L],1,1,()=>{T[L]=null}),pe(),o=T[l],o?o.p(O,I):(o=T[l]=M[l](O),o.c()),A(o,1),o.m(r.parentNode,r))},i(O){k||(A(o),k=!0)},o(O){P(o),k=!1},d(O){O&&w(e),O&&w(s),T[l].d(O),O&&w(r),O&&w(a),$=!1,Le(C)}}}function fE(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[lE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[oE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[uE,({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),S(r,t,a),H(i,r,a),S(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){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function Dh(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Dh();return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),l=U(n[2]),o=D(),r=v("div"),a=D(),f&&f.c(),u=Oe(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),_(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&re(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Dh(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(de(),P(f,1,1,()=>{f=null}),pe())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function dE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[cE],default:[fE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Ge(s,i[l]);return e=new ks({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?nn(i,[Xn(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){P(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let Oh;function pE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Ot(e,s),o;Ke(n,Ci,z=>t(12,o=z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Oh,d=!1;function h(){f==null||f.expand()}function m(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-835015b3.js"),["./CodeEditor-835015b3.js","./index-0935db40.js"],import.meta.url)).default),Oh=c,t(5,d=!1))}function y(z){B.copyToClipboard(z),xg(`Copied ${z} to clipboard`,2e3)}b();function k(){u.subject=this.value,t(0,u)}const $=()=>y("{APP_NAME}"),C=()=>y("{APP_URL}");function M(){u.actionUrl=t
|
||
|
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function LE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent 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],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),_(e,t),S(u,i,f),S(u,s,f),_(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Le(a)}}}function NE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b;const y=[SE,wE],k=[];function $(C,M){return C[2]?0:1}return d=$(n),h=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[5]),r=D(),a=v("div"),u=v("form"),f=v("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(C,M){S(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(C,r,M),S(C,a,M),_(a,u),_(u,f),_(u,c),k[d].m(u,null),m=!0,g||(b=Y(u,"submit",ct(n[27])),g=!0)},p(C,M){(!m||M[0]&32)&&re(o,C[5]);let T=d;d=$(C),d===T?k[d].p(C,M):(de(),P(k[T],1,1,()=>{k[T]=null}),pe(),h=k[d],h?h.p(C,M):(h=k[d]=y[d](C),h.c()),A(h,1),h.m(u,null))},i(C){m||(A(h),m=!0)},o(C){P(h),m=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,b()}}}function FE(n){let e,t,i,s,l,o;e=new Di({}),i=new vn({props:{$$slots:{default:[NE]},$$scope:{ctx:n}}});let r={};return l=new kE({props:r}),n[28](l),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),S(a,t,u),H(i,a,u),S(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(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){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function RE(n,e,t){let i,s,l;Ke(n,kt,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Wt(kt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;h();async function h(){t(2,c=!0);try{const ne=await he.settings.getAll()||{};g(ne)}catch(ne){he.errorResponseHandler(ne)}t(2,c=!1)}async function m(){if(!(d||!s)){t(3,d=!0);try{const ne=await he.settings.update(B.filterRedactedProps(f));g(ne),Vn({}),qt("Successfully saved mail settings.")}catch(ne){he.errorResponseHandler(ne)}t(3,d=!1)}}function g(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function k(){f.meta.senderAddress=this.value,t(0,f)}function $(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function C(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function T(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function O(){f.smtp.port=dt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const V=()=>b(),G=()=>m(),se=()=>a==null?
|
||
|
the
|
||
|
`),r=v("strong"),u=U(a),f=U(`
|
||
|
to the
|
||
|
`),c=v("strong"),h=U(d),m=U(`.
|
||
|
`),g=v("br"),b=U(`
|
||
|
There are numerous command line tools that can help you, such as:
|
||
|
`),y=v("a"),y.textContent=`rclone
|
||
|
`,k=U(`,
|
||
|
`),$=v("a"),$.textContent=`s5cmd
|
||
|
`,C=U(", etc."),M=D(),T=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(T,"class","clearfix m-t-base")},m(L,N){S(L,e,N),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(l,r),_(r,u),_(l,f),_(l,c),_(c,h),_(l,m),_(l,g),_(l,b),_(l,y),_(l,k),_(l,$),_(l,C),_(e,M),_(e,T),O=!0},p(L,N){var F;(!O||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&re(u,a),(!O||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&re(h,d)},i(L){O||(L&&tt(()=>{E||(E=qe(e,Et,{duration:150},!0)),E.run(1)}),O=!0)},o(L){L&&(E||(E=qe(e,Et,{duration:150},!1)),E.run(0)),O=!1},d(L){L&&w(e),L&&E&&E.end()}}}function Nh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T;return i=new me({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[zE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[BE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"s3.region",$$slots:{default:[UE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[WE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[YE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),k=new me({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[KE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("div"),q(d.$$.fragment),h=D(),m=v("div"),q(g.$$.fragment),b=D(),y=v("div"),q(k.$$.fragment),$=D(),C=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(m,"class","col-lg-6"),p(y,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(E,O){S(E,e,O),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),H(u,a,null),_(e,f),_(e,c),H(d,c,null),_(e,h),_(e,m),H(g,m,null),_(e,b),_(e,y),H(k,y,null),_(e,$),_(e,C),T=!0},p(E,O){const I={};O&100663298&&(I.$$scope={dirty:O,ctx:E}),i.$set(I);const L={};O&100663298&&(L.$$scope={dirty:O,ctx:E}),o.$set(L);const N={};O&100663298&&(N.$$scope={dirty:O,ctx:E}),u.$set(N);const F={};O&100663298&&(F.$$scope={dirty:O,ctx:E}),d.$set(F);const V={};O&100663298&&(V.$$scope={dirty:O,ctx:E}),g.$set(V);const G={};O&100663298&&(G.$$scope={dirty:O,ctx:E}),k.$set(G)},i(E){T||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(u.$$.fragment,E),A(d.$$.fragment,E),A(g.$$.fragment,E),A(k.$$.fragment,E),E&&tt(()=>{M||(M=qe(e,Et,{duration:150},!0)),M.run(1)}),T=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(d.$$.fragment,E),P(g.$$.fragment,E),P(k.$$.fragment,E),E&&(M||(M=qe(e,Et,{duration:150},!1)),M.run(0)),T=!1},d(E){E&&w(e),j(i),j(o),j(u),j(d),j(g),j(k),E&&M&&M.end()}}}function zE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Endpoint"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.endpoint),r||(a=Y(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&&fe(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function BE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Bucket"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"
|
||
|
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ZE(n){let e,t,i,s;return{c(){e=v("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;S(l,e,o),i||(s=Ie(t=We.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Zt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function GE(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Rh(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),_(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function XE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b;const y=[qE,jE],k=[];function $(C,M){return C[2]?0:1}return d=$(n),h=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[7]),r=D(),a=v("div"),u=v("form"),f=v("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(C,M){S(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(C,r,M),S(C,a,M),_(a,u),_(u,f),_(u,c),k[d].m(u,null),m=!0,g||(b=Y(u,"submit",ct(n[20])),g=!0)},p(C,M){(!m||M&128)&&re(o,C[7]);let T=d;d=$(C),d===T?k[d].p(C,M):(de(),P(k[T],1,1,()=>{k[T]=null}),pe(),h=k[d],h?h.p(C,M):(h=k[d]=y[d](C),h.c()),A(h,1),h.m(u,null))},i(C){m||(A(h),m=!0)},o(C){P(h),m=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,b()}}}function QE(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[XE]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(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){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function xE(n,e,t){let i,s,l;Ke(n,kt,F=>t(7,l=F)),Wt(kt,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 F=await he.settings.getAll()||{};g(F)}catch(F){he.errorResponseHandler(F)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(lo);const F=await he.settings.update(B.filterRedactedProps(r));Vn({}),await g(F),Ca(),c?nv("Successfully saved but failed to establish S3 connection."):qt("Successfully saved files storage settings.")}catch(F){he.errorResponseHandler(F)}t(3,u=!1)}}async function g(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await y()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await y()}async function y(){if(t(5,c=null),!!r.s3.enabled){he.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{he.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await he.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}un(()=>()=>{clearTimeout(d)});function k(){r.s3.enabled=this.checked,t(1,r)}function $(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function T(){r.s3.accessKey=this.value,t(1,r)}function E(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function O(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>b(),L=()=>m(),N=()=>m();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,m,b,i,k,$,C,M,T,E,O,I,L,N]}class eA extends ke{constructor(e){super(),ye(this,e,xE,QE,be,{})}}function tA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[12]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Hh(n){let e,t,i,s,l,o,r,a,u,f,c;l=new me({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[nA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[iA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let d=n[4]&&jh(n);return{c(){e=v("div"),t=v("div"),i=D(),s=v("div"),q(l.$$.fragment),o=D(),r=v("div"),q(a.$$.fragment),u=D(),d&&d.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(e,"class","grid")},m(h,m){S(h,e,m),_(e,t),_(e,i),_(e,s),H(l,s,null),_(e,o),_(e,r),H(a,r,null),_(e,u),d&&d.m(e,null),c=!0},p(h,m){const g={};m&2&&(g.name=h[1]+".clientId"),m&3145729&&(g.$$scope={dirty:m,ctx:h}),l.$set(g);const b={};m&2&&(b.name=h[1]+".clientSecret"),m&3145729&&(b.$$scope={di
|
||
|
another PocketBase environment.</p>`,t=D(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),q(o.$$.fragment),r=D(),a=v("div"),u=v("div"),f=D(),c=v("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-transparent 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(g,b){S(g,e,b),S(g,t,b),S(g,i,b),_(i,s),_(i,l),H(o,i,null),n[8](i),S(g,r,b),S(g,a,b),_(a,u),_(a,f),_(a,c),d=!0,h||(m=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],h=!0)},p(g,b){const y={};b&4&&(y.content=g[2]),o.$set(y)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){P(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),j(o),n[8](null),g&&w(r),g&&w(a),h=!1,Le(m)}}}function CA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function TA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[CA,$A],m=[];function g(b,y){return b[1]?0:1}return f=g(n),c=m[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[3]),r=D(),a=v("div"),u=v("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){S(b,e,y),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(b,r,y),S(b,a,y),_(a,u),m[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&re(o,b[3]);let k=f;f=g(b),f===k?m[f].p(b,y):(de(),P(m[k],1,1,()=>{m[k]=null}),pe(),c=m[f],c?c.p(b,y):(c=m[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&w(e),b&&w(r),b&&w(a),m[f].d()}}}function MA(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[TA]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(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){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function DA(n,e,t){let i,s;Ke(n,kt,b=>t(3,s=b)),Wt(kt,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 he.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){he.errorResponseHandler(b)}t(1,a=!1)}function f(){B.downloadJson(r,"pb_schema")}function c(){B.copyToClipboard(i),xg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){ie[b?"unshift":"push"](()=>{o=b,t(0,o)})}const m=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),k=document.createRange();k.selectNodeContents(o),y.removeAllRanges(),y.addRange(k)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,m,g]}class OA extends ke{constructor(e){super(),ye(this,e,DA,MA,be,{})}}function Jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Gh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Qh(n,e,t){const i=n.slice();return i[14]=e[t],i}function xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function em(n,e,t){const i=n.slice();return i[30]=e[t],i}function EA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&tm(),a=n[0].name!==n[1].name&&nm(n);return{c(){e=v("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),_(e,t),a&&a.m(e,null),_(e,i),_(e,s),_(s,o)},p(u,f){u[9]?r||(r=tm(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=nm(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&re(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function AA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=D(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),_(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?voi
|
||
|
<th width="10%" class="svelte-lmkr38">Old</th>
|
||
|
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=v("tbody");for(let C=0;C<m.length;C+=1)m[C].c();r=D(),g&&g.c(),a=D();for(let C=0;C<y.length;C+=1)y[C].c();u=D();for(let C=0;C<$.length;C+=1)$[C].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,M){S(C,e,M),d.m(e,null),S(C,t,M),S(C,i,M),_(i,s),_(i,l),_(i,o);for(let T=0;T<m.length;T+=1)m[T].m(o,null);_(o,r),g&&g.m(o,null),_(o,a);for(let T=0;T<y.length;T+=1)y[T].m(o,null);_(o,u);for(let T=0;T<$.length;T+=1)$[T].m(o,null)},p(C,M){if(c===(c=f(C))&&d?d.p(C,M):(d.d(1),d=c(C),d&&(d.c(),d.m(e,null))),M[0]&7203){h=C[11];let T;for(T=0;T<h.length;T+=1){const E=em(C,h,T);m[T]?m[T].p(E,M):(m[T]=im(E),m[T].c(),m[T].m(o,r))}for(;T<m.length;T+=1)m[T].d(1);m.length=h.length}if(C[2]||C[5]?g?g.p(C,M):(g=sm(C),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){b=C[7];let T;for(T=0;T<b.length;T+=1){const E=Gh(C,b,T);y[T]?y[T].p(E,M):(y[T]=um(E),y[T].c(),y[T].m(o,u))}for(;T<y.length;T+=1)y[T].d(1);y.length=b.length}if(M[0]&4352){k=C[8];let T;for(T=0;T<k.length;T+=1){const E=Jh(C,k,T);$[T]?$[T].p(E,M):($[T]=cm(E),$[T].c(),$[T].m(o,null))}for(;T<$.length;T+=1)$[T].d(1);$.length=k.length}},i:X,o:X,d(C){C&&w(e),d.d(),C&&w(t),C&&w(i),yt(m,C),g&&g.d(),yt(y,C),yt($,C)}}}function $n(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function on(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function LA(n,e,t){let i,s,l,{collectionA:o=new gn}=e,{collectionB:r=new gn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const m=Object.keys(new gn().export()).filter(y=>!["schema","created","updated"].includes(y));function g(){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(k=>y.id==k.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")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(k=>y.id==k.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(k=>k.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(k=>k.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,m,b]}class NA extends ke{constructor(e){super(),ye(this,e,LA,PA,be,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function dm(n,e,t){const i=n.slice();return i[17]=e[t],i}function pm(n){let e,t;return e=new NA({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){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function FA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=pm(dm(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Oe()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);S(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=dm(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=pm(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(de(),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)P(s[r]);t=!1},d(o){yt(s,o),o&&w(e)}}}function RA(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function HA(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=U("Close"),i=D(),s=v("button"),l=v("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n
|
||
|
- ${C.join(`
|
||
|
- `)}`,()=>{m()}):m()}async function m(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),qt("Successfully imported collections configuration."),i("submit")}catch(C){he.errorResponseHandler(C)}t(4,u=!1),c()}}const g=()=>h(),b=()=>!u;function y(C){ie[C?"unshift":"push"](()=>{s=C,t(1,s)})}function k(C){Be.call(this,n,C)}function $(C){Be.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,g,b,y,k,$]}class VA extends ke{constructor(e){super(),ye(this,e,qA,jA,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();return i[32]=e[t],i}function mm(n,e,t){const i=n.slice();return i[35]=e[t],i}function gm(n,e,t){const i=n.slice();return i[32]=e[t],i}function zA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[UA,({uniqueId:V})=>({40:V}),({uniqueId:V})=>[0,V?512:0]]},$$scope:{ctx:n}}});let O=!1,I=n[6]&&n[1].length&&!n[7]&&bm(),L=n[6]&&n[1].length&&n[7]&&vm(n),N=n[13].length&&Em(n),F=!!n[0]&&Am(n);return{c(){e=v("input"),t=D(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or
|
||
|
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),q(a.$$.fragment),u=D(),f=D(),I&&I.c(),c=D(),L&&L.c(),d=D(),N&&N.c(),h=D(),m=v("div"),F&&F.c(),g=D(),b=v("div"),y=D(),k=v("button"),$=v("span"),$.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"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p($,"class","txt"),p(k,"type","button"),p(k,"class","btn btn-expanded btn-warning m-l-auto"),k.disabled=C=!n[14],p(m,"class","flex m-t-base")},m(V,G){S(V,e,G),n[19](e),S(V,t,G),S(V,i,G),_(i,s),_(s,l),_(s,o),S(V,r,G),H(a,V,G),S(V,u,G),S(V,f,G),I&&I.m(V,G),S(V,c,G),L&&L.m(V,G),S(V,d,G),N&&N.m(V,G),S(V,h,G),S(V,m,G),F&&F.m(m,null),_(m,g),_(m,b),_(m,y),_(m,k),_(k,$),M=!0,T||(E=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(k,"click",n[26])],T=!0)},p(V,G){(!M||G[0]&4096)&&x(o,"btn-loading",V[12]);const se={};G[0]&64&&(se.class="form-field "+(V[6]?"":"field-error")),G[0]&65|G[1]&1536&&(se.$$scope={dirty:G,ctx:V}),a.$set(se),V[6]&&V[1].length&&!V[7]?I||(I=bm(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),V[6]&&V[1].length&&V[7]?L?L.p(V,G):(L=vm(V),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),V[13].length?N?N.p(V,G):(N=Em(V),N.c(),N.m(h.parentNode,h)):N&&(N.d(1),N=null),V[0]?F?F.p(V,G):(F=Am(V),F.c(),F.m(m,g)):F&&(F.d(1),F=null),(!M||G[0]&16384&&C!==(C=!V[14]))&&(k.disabled=C)},i(V){M||(A(a.$$.fragment,V),A(O),M=!0)},o(V){P(a.$$.fragment,V),P(O),M=!1},d(V){V&&w(e),n[19](null),V&&w(t),V&&w(i),V&&w(r),j(a,V),V&&w(u),V&&w(f),I&&I.d(V),V&&w(c),L&&L.d(V),V&&w(d),N&&N.d(V),V&&w(h),V&&w(m),F&&F.d(),T=!1,Le(E)}}}function BA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function _m(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function UA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&_m();return{c(){e=v("label"),t=U("Collections"),s=D(),l=v("textarea"),r=D(),c&&c.c(),a=Oe(),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){S(d,e,h),_(e,t),S(d,s,h),S(d,l,h),fe(l,n[0]),S(d,r,h),c&&c.m(d,h),S(d,a,h),u||(f=Y(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&&fe(l,d[0]),d[0]&&!d[6]?c||(c=_m(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function bm(n){let e;return{c(){e=v("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){S(t,e,i)},d(t){t&&w(e)}}}function vm(n){let e,t,i,s,l,o=n[9].length&&ym(n),r=n[4].length&&Sm(n),a=n[8].length&&Mm(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=D(),i=v("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){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),_(i,s),r&&r.m(i,null),_(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=ym(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Sm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Mm(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function ym(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=gm(n,s,o),a=l(r);t.set(a,e[o]=wm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Oe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=gt(e,r,l,1,o,s,t,i.parentNode,Xi,wm,i,gm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function km(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&re(s,i)},d(o){o&&w(e)}}}function wm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&km(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=D(),l=v("strong"),r=U(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){S(c,t,d),_(t,i),_(t,s),_(t,l),_(l,r),_(t,a),f&&f.m(t,null),_(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&re(r,o),e[32].id?f?f.p(e,d):(f=km(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Sm(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=mm(n,s,o),a=l(r);t.set(a,e[o]=Tm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Oe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=gt(e,r,l,1,o,s,t,i.parentNode,Xi,Tm,i,mm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function $m(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=D(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),_(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&re(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Cm(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&re(s,i)},d(o){o&&w(e)}}}function Tm(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&&$m(e),h=e[35].new.id&&Cm(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=D(),l=v("div"),d&&d.c(),o=D(),r=v("strong"),u=U(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(m,g){S(m,t,g),_(t,i),_(t,s),_(t,l),d&&d.m(l,null),_(l,o),_(l,r),_(r,u),_(l,f),h&&h.m(l,null),_(t,c)},p(m,g){e=m,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=$m(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&re(u,a),e[35].new.id?h?h.p(e,g):(h=Cm(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(m){m&&w(t),d&&d.d(),h&&h.d()}}}function Mm(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=hm(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=Oe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=gt(e,r,l,1,o,s,t,i.parentNode,Xi,Om,i,hm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Dm(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(
|
||
|
imported with different IDs. You can replace them in the import if you want
|
||
|
to.</string>`,l=D(),o=v("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){S(u,e,f),_(e,t),_(e,i),_(e,s),_(e,l),_(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function Am(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function WA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[BA,zA],m=[];function g(b,y){return b[5]?0:1}return f=g(n),c=m[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[15]),r=D(),a=v("div"),u=v("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){S(b,e,y),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(b,r,y),S(b,a,y),_(a,u),m[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&re(o,b[15]);let k=f;f=g(b),f===k?m[f].p(b,y):(de(),P(m[k],1,1,()=>{m[k]=null}),pe(),c=m[f],c?c.p(b,y):(c=m[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&w(e),b&&w(r),b&&w(a),m[f].d()}}}function YA(n){let e,t,i,s,l,o;e=new Di({}),i=new vn({props:{$$slots:{default:[WA]},$$scope:{ctx:n}}});let r={};return l=new VA({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),S(a,t,u),H(i,a,u),S(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){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function KA(n,e,t){let i,s,l,o,r,a,u;Ke(n,kt,z=>t(15,u=z)),Wt(kt,u="Import collections",u);let f,c,d="",h=!1,m=[],g=[],b=!0,y=[],k=!1;$();async function $(){t(5,k=!0);try{t(2,g=await he.collections.getFullList(200));for(let z of g)delete z.created,delete z.updated}catch(z){he.errorResponseHandler(z)}t(5,k=!1)}function C(){if(t(4,y=[]),!!i)for(let z of m){const Q=B.findByKey(g,"id",z.id);!(Q!=null&&Q.id)||!B.hasCollectionChanges(Q,z,b)||y.push({new:z,old:Q})}}function M(){t(1,m=[]);try{t(1,m=JSON.parse(d))}catch{}Array.isArray(m)?t(1,m=B.filterDuplicatesByKey(m)):t(1,m=[]);for(let z of m)delete z.created,delete z.updated,z.schema=B.filterDuplicatesByKey(z.schema)}function T(){var z,Q;for(let J of m){const ae=B.findByKey(g,"name",J.name)||B.findByKey(g,"id",J.id);if(!ae)continue;const He=J.id,Fe=ae.id;J.id=Fe;const Ne=Array.isArray(ae.schema)?ae.schema:[],Re=Array.isArray(J.schema)?J.schema:[];for(const ge of Re){const Ce=B.findByKey(Ne,"name",ge.name);Ce&&Ce.id&&(ge.id=Ce.id)}for(let ge of m)if(Array.isArray(ge.schema))for(let Ce of ge.schema)(z=Ce.options)!=null&&z.collectionId&&((Q=Ce.options)==null?void 0:Q.collectionId)===He&&(Ce.options.collectionId=Fe)}t(0,d=JSON.stringify(m,null,4))}function E(z){t(12,h=!0);const Q=new FileReader;Q.onload=async J=>{t(12,h=!1),t(10,f.value="",f),t(0,d=J.target.result),await In(),m.length||(cl("Invalid collections configuration."),O())},Q.onerror=J=>{console.warn(J),cl("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},Q.readAsText(z)}function O(){t(0,d=""),t(10,f.value="",f),Vn({})}function I(z){ie[z?"unshift":"push"](()=>{f=z,t(10,f)})}const L=()=>{f.files.length&&E(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function V(){b=this.checked,t(3,b)}const G=()=>T(),se=()=>O(),K=()=>c==null?void 0:c.show(g,m,b);function te(z){ie[z?"unshift":"push"](()=>{c=z,t(11,c)})}const ne=()=>O();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&m.length&&m.length===m.filter(z=>!!z.id&&!!z.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(z=>i&&b&&!B.findByKey(m,"id",z.id))),n.
|
||
|
<span class="txt">Manage admins</span>`,t=D(),i=v("hr"),s=D(),l=v("button"),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,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(Qt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Le(r)}}}function f5(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]&&Lm(n);return o=new jb({props:{routes:ZA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new i5({}),f=new a5({}),{c(){t=D(),i=v("div"),d&&d.c(),s=D(),l=v("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(m,g){S(m,t,g),S(m,i,g),d&&d.m(i,null),_(i,s),_(i,l),H(o,l,null),_(l,r),H(a,l,null),S(m,u,g),H(f,m,g),c=!0},p(m,[g]){var b;(!c||g&12)&&e!==(e=B.joinNonEmpty([m[3],m[2],"PocketBase"]," - "))&&(document.title=e),(b=m[0])!=null&&b.id&&m[1]?d?(d.p(m,g),g&3&&A(d,1)):(d=Lm(m),d.c(),A(d,1),d.m(i,s)):d&&(de(),P(d,1,1,()=>{d=null}),pe())},i(m){c||(A(d),A(o.$$.fragment,m),A(a.$$.fragment,m),A(f.$$.fragment,m),c=!0)},o(m){P(d),P(o.$$.fragment,m),P(a.$$.fragment,m),P(f.$$.fragment,m),c=!1},d(m){m&&w(t),m&&w(i),d&&d.d(),j(o),j(a),m&&w(u),j(f,m)}}}function c5(n,e,t){let i,s,l,o;Ke(n,Ts,h=>t(8,i=h)),Ke(n,vo,h=>t(2,s=h)),Ke(n,Ma,h=>t(0,l=h)),Ke(n,kt,h=>t(3,o=h));let r,a=!1;function u(h){var m,g,b,y;((m=h==null?void 0:h.detail)==null?void 0:m.location)!==r&&(t(1,a=!!((b=(g=h==null?void 0:h.detail)==null?void 0:g.userData)!=null&&b.showAppSidebar)),r=(y=h==null?void 0:h.detail)==null?void 0:y.location,Wt(kt,o="",o),Vn({}),nb())}function f(){$i("/")}async function c(){var h,m;if(l!=null&&l.id)try{const g=await he.settings.getAll({$cancelKey:"initialAppSettings"});Wt(vo,s=((h=g==null?void 0:g.meta)==null?void 0:h.appName)||"",s),Wt(Ts,i=!!((m=g==null?void 0:g.meta)!=null&&m.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){he.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class d5 extends ke{constructor(e){super(),ye(this,e,c5,f5,be,{})}}new d5({target:document.getElementById("app")});export{Le as A,qt as B,B as C,$i as D,Oe as E,t_ as F,ga as G,pu as H,Ke as I,es as J,Ct as K,un as L,ie as M,eb as N,gt as O,Xi as P,Kt as Q,gn as R,ke as S,Ar as T,P as a,D as b,q as c,j as d,v as e,p as f,S as g,_ as h,ye as i,Ie as j,de as k,Qt as l,H as m,pe as n,w as o,he as p,me as q,x as r,be as s,A as t,Y as u,ct as v,U as w,re as x,X as y,fe as z};
|