pocketbase/ui/dist/assets/index.2831f276.js

383 lines
766 KiB
JavaScript
Raw Normal View History

const m_=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)}};m_();function oe(){}const ml=n=>n;function ht(n,e){for(const t in e)n[t]=e[t];return n}function Np(n){return n()}function Ba(){return Object.create(null)}function lt(n){n.forEach(Np)}function Bn(n){return typeof n=="function"}function Oe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let El;function Jn(n,e){return El||(El=document.createElement("a")),El.href=e,n===El.href}function g_(n){return Object.keys(n).length===0}function Rp(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function cn(n,e,t){n.$$.on_destroy.push(Rp(e,t))}function $n(n,e,t,i){if(n){const s=Hp(n,e,t,i);return n[0](s)}}function Hp(n,e,t,i){return n[1]&&i?ht(t.ctx.slice(),n[1](i(e))):t.ctx}function Cn(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 Mn(n,e,t,i,s,l){if(s){const o=Hp(e,t,i,l);n.p(o,s)}}function Tn(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 si(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Wt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Ua(n){return n==null?"":n}function jp(n,e,t){return n.set(t),e}function tt(n){return n&&Bn(n.destroy)?n.destroy:oe}const qp=typeof window<"u";let Oo=qp?()=>window.performance.now():()=>Date.now(),ta=qp?n=>requestAnimationFrame(n):oe;const ps=new Set;function Vp(n){ps.forEach(e=>{e.c(n)||(ps.delete(e),e.f())}),ps.size!==0&&ta(Vp)}function Ao(n){let e;return ps.size===0&&ta(Vp),{promise:new Promise(t=>{ps.add(e={c:n,f:t})}),abort(){ps.delete(e)}}}function m(n,e){n.appendChild(e)}function zp(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function __(n){const e=_("style");return b_(zp(n),e),e.sheet}function b_(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Rn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function R(n){return document.createTextNode(n)}function T(){return R(" ")}function ot(){return R("")}function G(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Vt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Hn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Bp(n){return function(e){e.target===this&&n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ii(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]:h(n,i,e[i])}function Dt(n){return n===""?null:+n}function v_(n){return Array.from(n.childNodes)}function be(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Ce(n,e){n.value=e==null?"":e}function Wa(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 Up(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.init
`;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_${y_(f)}_${r}`,d=zp(n),{stylesheet:p,rules:g}=oo.get(d)||k_(d,n);g[c]||(g[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ro+=1,c}function ll(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(", "),ro-=s,ro||w_())}function w_(){ta(()=>{ro||(oo.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),oo.clear())})}function S_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=ml,start:a=Oo()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,g;function v(){c&&(g=sl(n,0,1,o,l,r,c)),l||(p=!0)}function b(){c&&ll(n,g),d=!1}return Ao(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),b()),!d)return!1;if(p){const S=y-a,$=0+1*r(S/o);f($,1-$)}return!0}),v(),f(0,1),b}function $_(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,Wp(n,s)}}function Wp(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 ol;function Ks(n){ol=n}function Eo(){if(!ol)throw new Error("Function called outside component initialization");return ol}function Un(n){Eo().$$.on_mount.push(n)}function C_(n){Eo().$$.after_update.push(n)}function M_(n){Eo().$$.on_destroy.push(n)}function rn(){const n=Eo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Up(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function dt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const zs=[],ge=[],eo=[],wr=[],Yp=Promise.resolve();let Sr=!1;function Kp(){Sr||(Sr=!0,Yp.then(Zp))}function li(){return Kp(),Yp}function Tt(n){eo.push(n)}function Re(n){wr.push(n)}const Yo=new Set;let Pl=0;function Zp(){const n=ol;do{for(;Pl<zs.length;){const e=zs[Pl];Pl++,Ks(e),T_(e.$$)}for(Ks(null),zs.length=0,Pl=0;ge.length;)ge.pop()();for(let e=0;e<eo.length;e+=1){const t=eo[e];Yo.has(t)||(Yo.add(t),t())}eo.length=0}while(zs.length);for(;wr.length;)wr.pop()();Sr=!1,Yo.clear(),Ks(n)}function T_(n){if(n.fragment!==null){n.update(),lt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let As;function na(){return As||(As=Promise.resolve(),As.then(()=>{As=null})),As}function Gi(n,e,t){n.dispatchEvent(Up(`${e?"intro":"outro"}${t}`))}const to=new Set;let ei;function Te(){ei={r:0,c:[],p:ei}}function De(){ei.r||lt(ei.c),ei=ei.p}function A(n,e){n&&n.i&&(to.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(to.has(n))return;to.add(n),ei.c.push(()=>{to.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ia={duration:0};function Jp(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&ll(n,l)}function u(){const{delay:c=0,duration:d=300,easing:p=ml,tick:g=oe,css:v}=i||ia;v&&(l=sl(n,0,1,d,c,p,v,r++)),g(0,1);const b=Oo()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>Gi(n,!0,"start")),o=Ao(S=>{if(s){if(S>=y)return g(1,0),Gi(n,!0,"end"),a(),s=!1;if(S>=b){const $=p((S-b)/d);g($,1-$)}}return s})}let f=!1;return{start(){f||(f=!0,ll(n),Bn(i)?(i=i(),na().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Gp(n,e,t){let i=e(n,t),s=!0,l;const o=ei;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=ml,tick:c=oe,css:d}=i||ia;d&&(l=sl(n,1,0,u,a,f,d));const p=Oo()+a,g=p+u;Tt(()=>Gi(n,!1,"start")),Ao(v=>{if(s){if(v>=g)return c(0,1),Gi(n,!1,"end"),--o.r||lt(o.c),!1;if(v>=p){const b=f((v-p)/u);c(1-b,b)}}return s})}return Bn(i)?na().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&ll(n,l),s=!1)}}}function at(n,e,t,i){let s=e(n,t),l=i?0:1,o=nu
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=T(),i=_("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function Y1(n){let e,t,i,s,l,o,r,a,u=!n[0]&&wu();const f=n[2].default,c=$n(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),u&&u.c(),l=T(),c&&c.c(),o=T(),r=_("div"),h(t,"class","flex-fill"),h(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),h(r,"class","flex-fill"),h(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,p){w(d,e,p),m(e,t),m(e,i),m(e,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,o),m(e,r),a=!0},p(d,[p]){d[0]?u&&(u.d(1),u=null):u||(u=wu(),u.c(),u.m(s,l)),c&&c.p&&(!a||p&2)&&Mn(c,f,d,d[1],a?Cn(f,d[1],p,null):Tn(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){P(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function K1(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(1,s=o.$$scope)},[l,s,i]}class ag extends Ee{constructor(e){super(),Ae(this,e,K1,Y1,Oe,{nobranding:0})}}function Su(n,e,t){const i=n.slice();return i[11]=e[t],i}const Z1=n=>({}),$u=n=>({uniqueId:n[3]});function J1(n){let e=(n[11]||po)+"",t;return{c(){t=R(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||po)+"")&&be(t,e)},d(i){i&&k(t)}}}function G1(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||po)+"",t;return{c(){t=R(e)},m(l,o){w(l,t,o)},p(l,o){var r,a;o&4&&e!==(e=(((r=l[11])==null?void 0:r.message)||((a=l[11])==null?void 0:a.code)||po)+"")&&be(t,e)},d(l){l&&k(t)}}}function Cu(n){let e,t;function i(o,r){return typeof o[11]=="object"?G1:J1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),h(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function X1(n){let e,t,i,s,l;const o=n[7].default,r=$n(o,n,n[6],$u);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Cu(Su(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();h(e,"class",n[0]),X(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=G(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Mn(r,o,f,f[6],i?Cn(o,f[6],c,Z1):Tn(f[6]),$u),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const p=Su(f,a,d);u[d]?u[d].p(p,c):(u[d]=Cu(p),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)&&h(e,"class",f[0]),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&&k(e),r&&r.d(f),Rn(u,f),n[9](null),s=!1,l()}}}const po="Invalid value";function Q1(n,e,t){let i;cn(n,ns,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){rg(r)}Un(()=>(u.addEventListener("change",c),()=>{u.removeEventListener("change",c)}));function d(g){dt.call(this,n,g)}function p(g){ge[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,p]}class Fe extends Ee{constructor(e){super(),Ae(this,e,Q1,X1,Oe,{name:4,class:0})}}function x1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function eb(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(c,
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),X(f,"btn-disabled",n[3]),X(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),q(a,e,null),m(e,u),m(e,f),c=!0,d||(p=G(e,"submit",Vt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const S={};v&1540&&(S.$$scope={dirty:v,ctx:g}),a.$set(S),v&8&&X(f,"btn-disabled",g[3]),v&8&&X(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,p()}}}function ib(n,e,t){const i=rn();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await Se.Admins.create({email:s,password:l,passwordConfirm:o}),await Se.Admins.authViaEmail(s,l),i("submit")}catch(d){Se.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 sb extends Ee{constructor(e){super(),Ae(this,e,ib,nb,Oe,{})}}function Mu(n){let e,t;return e=new ag({props:{$$slots:{default:[lb]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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){V(e,i)}}}function lb(n){let e,t;return e=new sb({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ob(n){let e,t,i=n[0]&&Mu(n);return{c(){i&&i.c(),e=ot()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Mu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Te(),P(i,1,1,()=>{i=null}),De())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function rb(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){Se.logout(!1),t(0,i=!0);return}Se.AuthStore.isValid?$s("/collections"):Se.logout()}return[i,async()=>{t(0,i=!1),await li(),window.location.search=""}]}class ab extends Ee{constructor(e){super(),Ae(this,e,rb,ob,Oe,{})}}function Ro(n){const e=n-1;return e*e*e+1}function mo(n,{delay:e=0,duration:t=400,easing:i=ml}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function jn(n,{delay:e=0,duration:t=400,easing:i=Ro,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 Xt(n,{delay:e=0,duration:t=400,easing:i=Ro}={}){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:p=>`overflow: hidden;opacity: ${Math.min(p*20,1)*l};height: ${p*o}px;padding-top: ${p*r}px;padding-bottom: ${p*a}px;margin-top: ${p*u}px;margin-bottom: ${p*f}px;border-top-width: ${p*c}px;border-bottom-width: ${p*d}px;`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Ro,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 ub(n){let e,t,i,s;return{c(){e=_("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Ce(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&Ce(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function fb(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),ge.push(()=>Ie(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=ot()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],Re(()=>t=!1)),o!==(o=a[4])){if(e){Te();const c=e;P(c.$$.fragment,1,0,()=>{V(c,1)}),De()}o?(e=new o(r(a)),ge.push(()=>Ie(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),q(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&&k(i),e&&V(e,a)}}}function Tu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Du();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',h(t,"type","button"),h(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Du(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Te(),P(r,1,1,()=>{r=null}),De())},i(a){s||(A(r),Tt(()=>{i||(i=at(t,jn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),i||(i=at(t,jn,{duration:150,x:5},!1)),i.run(0),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Du(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=at(e,jn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=at(e,jn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function cb(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[fb,ub],p=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=p[o]=d[o](n);let v=(n[0].length||n[7].length)&&Tu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),h(s,"class","ri-search-line"),h(i,"for",n[8]),h(i,"class","m-l-10 txt-xl"),h(t,"class","searchbar"),h(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),p[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Vt(n[10])),G(e,"click",Hn(n[11]))],f=!0)},p(b,[y]){let S=o;o=g(b),o===S?p[o].p(b,y):(Te(),P(p[S],1,1,()=>{p[S]=null}),De(),r=p[o],r?r.p(b,y):(r=p[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Tu(b),v.c(),A(v,1),v.m(t,null)):v&&(Te(),P(v,1,1,()=>{v=null}),De())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),p[o].d(),v&&v.d(),f=!1,lt(c)}}}function db(n,e,t){const i=rn(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new On}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function p(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ki(()=>import("./FilterAutocompleteInput.8c26964d.js"),[])).default),t(5,f=!1))}Un(()=>{v()});function b(M){dt.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function S(M){ge[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const C=()=>{p(!1),g()};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,p,g,b,y,S,$,C]}class Ho extends Ee{constructor(e){super(),Ae(this,e,db,cb,Oe,{value:0
<span class="txt">method</span>`,h(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Sb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",h(t,"class",W.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function $b(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",h(t,"class",W.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Cb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",h(t,"class",W.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Mb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Eu(n){let e;function t(l,o){return l[6]?Db:Tb}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Tb(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Pu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Pu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Db(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Pu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Lu(n){let e;return{c(){e=_("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Fu(n,e){var le,me,re;let t,i,s,l=((le=e[21].method)==null?void 0:le.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,p,g,v,b,y,S=(e[21].referer||"N/A")+"",$,C,M,D,L,O=e[21].status+"",F,E,j,U,Q,te,H,Y,K,Z,ee=(((me=e[21].meta)==null?void 0:me.errorMessage)||((re=e[21].meta)==null?void 0:re.errorData))&&Lu();U=new gi({props:{date:e[21].created}});function ae(){return e[16](e[21])}function ve(...de){return e[17](e[21],...de)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=R(l),a=T(),u=_("td"),f=_("span"),d=R(c),g=T(),ee&&ee.c(),v=T(),b=_("td"),y=_("span"),$=R(S),M=T(),D=_("td"),L=_("span"),F=R(O),E=T(),j=_("td"),z(U.$$.fragment),Q=T(),te=_("td"),te.innerHTML='<i class="ri-arrow-right-line"></i>',H=T(),h(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",p=e[21].url),h(u,"class","col-type-text col-field-url"),h(y,"class","txt txt-ellipsis"),h(y,"title",C=e[21].referer),X(y,"txt-hint",!e[21].referer),h(b,"class","col-type-text col-field-referer"),h(L,"class","label"),X(L,"label-danger",e[21].status>=400),h(D,"class","col-type-number col-field-status"),h(j,"class","col-type-date col-field-created"),h(te,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(de,fe){w(de,t,fe),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ee&&ee.m(u,null),m(t,v),m(t,b),m(b,y),m(y,$),m(t,M),m(t,D),m(D,L),m(L,F),m(t,E),m(t,j),q(U,j,null),m(t,Q),m(t,te),m(t,H),Y=!0,K||(Z=[G(t,"click",ae),G(t,"keydown",ve)],K=!0)},p(de,fe){var x,ye,He;e=de,(!Y||fe&8)&&l!==(l=((x=e[21].method)==null?void 0:x.toUpperCase())+"")&&be(o,l),(!Y||fe&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&h(s,"class",r),(!Y||fe&8)&&c!==(c=e[21].url+"")&&be(d,c),(!Y||fe&8&&p!==(p=e[21].url))&&h(f,"title",p),((ye=e[21].meta)==null?void 0:ye.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?ee||(ee=Lu(),ee.c(),ee.m(u,null)):ee&&(ee.d(1),ee=null),(!Y||fe&8)&&S!==(S=(e[21].referer||"N/A")+"")&&be($,S),(!Y||fe&8&&C!==(C=e[21].referer))&&h(y,"title",C),fe&8&&X(y,"txt-hint",!e[21].referer),(!Y||fe&8)&&O!==(O=e[21].status+"")&&be(F,O),fe&8&&X(L,"label-danger",e[21].status>=400);const ie={};fe&8&&(ie.date=e[21].created),U.$set(ie)},i(de){Y||(A(U.$$.fragment,de),Y=!0)},o(de){P(U.$$.fragment,de),Y=!1},d(de){de&&k(t),ee&&ee.d(),V(U),K=!1,lt(Z)}}}function Iu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&be(s,i),a&16&&be(o,r[4])},d(r){r&&k(e)}}}function Nu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),X(t,"btn-loading",n[6]),X(t,"btn-disabled",n[6]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&be(o,l),c&64&&X(t,"btn-loading",f[6]),c&64&&X(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function Ob(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L=[],O=new Map,F,E,j,U;function Q(x){n[11](x)}let te={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[wb]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),l=new xt({props:te}),ge.push(()=>Ie(l,"sort",Q));function H(x){n[12](x)}let Y={disable:!0,class:"col-type-text col-field-url",name:"url"
* Chart.js v3.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/const fg=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function cg(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,fg.call(window,()=>{s=!1,n.apply(e,l)}))}}function Pb(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Lb=n=>n==="start"?"left":n==="end"?"right":"center",Ru=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ui(){}const Fb=function(){let n=0;return function(){return n++}}();function Ct(n){return n===null||typeof n>"u"}function Lt(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 pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const qt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Pn(n,e){return qt(n)?n:e}function gt(n,e){return typeof n>"u"?e:n}const Ib=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,dg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function $t(n,e,t,i){let s,l,o;if(Lt(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(pt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function go(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 _o(n){if(Lt(n))return n.map(_o);if(pt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=_o(n[t[s]]);return e}return n}function hg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Nb(n,e,t,i){if(!hg(n))return;const s=e[n],l=t[n];pt(s)&&pt(l)?rl(s,l,i):e[n]=_o(l)}function rl(n,e,t){const i=Lt(e)?e:[e],s=i.length;if(!pt(n))return n;t=t||{};const l=t.merger||Nb;for(let o=0;o<s;++o){if(e=i[o],!pt(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 Qs(n,e){return rl(n,e,{merger:Rb})}function Rb(n,e,t){if(!hg(n))return;const i=e[n],s=t[n];pt(i)&&pt(s)?Qs(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=_o(s))}const Hb="",jb=".";function Hu(n,e){const t=n.indexOf(jb,e);return t===-1?n.length:t}function Ei(n,e){if(e===Hb)return n;let t=0,i=Hu(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=Hu(e,t);return n}function ga(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Vn=n=>typeof n<"u",Pi=n=>typeof n=="function",ju=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function qb(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const jt=Math.PI,At=2*jt,Vb=At+jt,bo=Number.POSITIVE_INFINITY,zb=jt/180,Ht=jt/2,Is=jt/4,qu=jt*2/3,In=Math.log10,ti=Math.sign;function Vu(n){const e=Math.round(n);n=xs(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(In(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Bb(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 al(n){return!isNaN(parseFloat(n))&&isFinite(n)}function xs(n,e,t){return Math.abs(n-e)<t}function Ub(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function pg(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 Zn(n){return n*(jt/180)}function _a(n){return n*(180/jt)}function zu(n){if(!qt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function mg(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*jt&&(l+=At),{angle:l,distance:s}}function Hr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Wb(n,e){return(n-e+Vb)%At-jt}function kn(n){return(n%At+At)%At}function ul(n,e,t,i){const s=kn(n),l=kn(e),o=kn(t),r=kn(l-s),a=kn(o-s),u=kn(s-l),f=kn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function sn(n,e,t){return Ma
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function kl(n){return n+.5|0}const Ti=(n,e,t)=>Math.max(Math.min(n,t),e);function Ws(n){return Ti(kl(n*2.55),0,255)}function Ai(n){return Ti(kl(n*255),0,255)}function di(n){return Ti(kl(n/2.55)/100,0,1)}function Wu(n){return Ti(kl(n*100),0,100)}const En={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},jr=[..."0123456789ABCDEF"],Kb=n=>jr[n&15],Zb=n=>jr[(n&240)>>4]+jr[n&15],jl=n=>(n&240)>>4===(n&15),Jb=n=>jl(n.r)&&jl(n.g)&&jl(n.b)&&jl(n.a);function Gb(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&En[n[1]]*17,g:255&En[n[2]]*17,b:255&En[n[3]]*17,a:e===5?En[n[4]]*17:255}:(e===7||e===9)&&(t={r:En[n[1]]<<4|En[n[2]],g:En[n[3]]<<4|En[n[4]],b:En[n[5]]<<4|En[n[6]],a:e===9?En[n[7]]<<4|En[n[8]]:255})),t}const Xb=(n,e)=>n<255?e(n):"";function Qb(n){var e=Jb(n)?Kb:Zb;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Xb(n.a,e):void 0}const xb=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function gg(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 ev(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 tv(n,e,t){const i=gg(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 nv(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 ba(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=nv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function va(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ai)}function ya(n,e,t){return va(gg,n,e,t)}function iv(n,e,t){return va(tv,n,e,t)}function sv(n,e,t){return va(ev,n,e,t)}function _g(n){return(n%360+360)%360}function lv(n){const e=xb.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ws(+e[5]):Ai(+e[5]));const s=_g(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=iv(s,l,o):e[1]==="hsv"?i=sv(s,l,o):i=ya(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function ov(n,e){var t=ba(n);t[0]=_g(t[0]+e),t=ya(t),n.r=t[0],n.g=t[1],n.b=t[2]}function rv(n){if(!n)return;const e=ba(n),t=e[0],i=Wu(e[1]),s=Wu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${di(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Yu={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ku={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v3.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class dy{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=fg.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 fi=new dy;const rf="transparent",hy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Ju(n||rf),s=i.valid&&Ju(e||rf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class py{constructor(e,t,i,s){const l=t[i];s=zl([e.to,s,l,e.from]);const o=zl([e.from,l,s]);this._active=!0,this._fn=e.fn||hy[e.type||typeof o],this._easing=el[e.easing]||el.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=zl([e.to,t,s,e.from]),this._from=zl([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 my=["x","y","borderWidth","radius","tension"],gy=["color","borderColor","backgroundColor"];_t.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 _y=Object.keys(_t.animation);_t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});_t.set("animations",{colors:{type:"color",properties:gy},numbers:{type:"number",properties:my}});_t.describe("animations",{_fallback:"animation"});_t.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 Fg{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!pt(s))return;const l={};for(co
`)>-1?n.split(`
`):n}function Ik(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 Rf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Sn(e.bodyFont),u=Sn(e.titleFont),f=Sn(e.footerFont),c=l.length,d=s.length,p=i.length,g=zn(e.padding);let v=g.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&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=p*C+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(C){b=Math.max(b,t.measureText(C).width+S)};return t.save(),t.font=u.string,$t(n.title,$),t.font=a.string,$t(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,$t(i,C=>{$t(C.before,$),$t(C.lines,$),$t(C.after,$)}),S=0,t.font=f.string,$t(n.footer,$),t.restore(),b+=g.width,{width:b,height:v}}function Nk(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Rk(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 Hk(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"),Rk(u,n,e,t)&&(u="center"),u}function Hf(n,e,t){const i=t.yAlign||e.yAlign||Nk(n,t);return{xAlign:t.xAlign||e.xAlign||Hk(n,e,t,i),yAlign:i}}function jk(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function qk(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function jf(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:p}=gs(o);let g=jk(e,r);const v=qk(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,p)+s),{x:sn(g,0,i.width-e.width),y:sn(v,0,i.height-e.height)}}function Jl(n,e,t){const i=zn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function qf(n){return Qn([],ci(n))}function Vk(n,e,t){return Fi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Vf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class Zr extends vi{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 Fg(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Vk(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=Qn(r,ci(s)),r=Qn(r,ci(l)),r=Qn(r,ci(o)),r}getBeforeBody(e,t){return qf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return $t(e,l=>{const o={before:[],lines:[],after:[]},r=Vf(i,l);Qn(o.before,ci(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.1.0
* https://www.chartjs.org
* (c) 2021 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const aw={datetime:et.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:et.TIME_WITH_SECONDS,minute:et.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Hg._date.override({_id:"luxon",_create:function(n){return et.fromMillis(n,this.options)},formats:function(){return aw},parse:function(n,e){const t=this.options;if(n===null||typeof n>"u")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=et.fromFormat(n,e,t):n=et.fromISO(n,t):n instanceof Date?n=et.fromJSDate(n,t):i==="object"&&!(n instanceof et)&&(n=et.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Jf(n){let e,t,i;return{c(){e=_("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=at(e,qn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=at(e,qn,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function uw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=R(n[1]),t=T(),s=R(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&be(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&be(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function fw(n){let e;return{c(){e=R("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function cw(n){let e,t,i,s,l,o,r=n[2]&&Jf();function a(c,d){return c[2]?fw:uw}let u=a(n),f=u(n);return{c(){e=_("div"),r&&r.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),f.c(),h(i,"class","chart-canvas svelte-vh4sl8"),Wa(i,"height","250px"),Wa(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),X(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),r&&r.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),o=!0},p(c,[d]){c[2]?r?d&4&&A(r,1):(r=Jf(),r.c(),A(r,1),r.m(e,t)):r&&(Te(),P(r,1,1,()=>{r=null}),De()),d&4&&X(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){o||(A(r),o=!0)},o(c){P(r),o=!1},d(c){c&&k(e),r&&r.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function dw(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),Se.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let g of p)r.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),Se.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Un(()=>(Mo.register(Ii,zo,$l,Ra,Ml,Fk,zk),t(6,o=new Mo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){ge[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.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.update())},
* 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 S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S($,C){C=C||{};var M,D;switch(r.util.type($)){case"Object":if(D=r.util.objId($),C[D])return C[D];M={},C[D]=M;for(var L in $)$.hasOwnProperty(L)&&(M[L]=S($[L],C));return M;case"Array":return D=r.util.objId($),C[D]?C[D]:(M=[],C[D]=M,$.forEach(function(O,F){M[F]=S(O,C)}),M);default:return $}},getLanguage:function(S){for(;S;){var $=s.exec(S.className);if($)return $[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,$){S.className=S.className.replace(RegExp(s,"gi"),""),S.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 S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var C in $)if($[C].src==S)return $[C]}return null}},isActive:function(S,$,C){for(var M="no-"+$;S;){var D=S.classList;if(D.contains($))return!0;if(D.contains(M))return!1;S=S.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var C=r.util.clone(r.languages[S]);for(var M in $)C[M]=$[M];return C},insertBefore:function(S,$,C,M){M=M||r.languages;var D=M[S],L={};for(var O in D)if(D.hasOwnProperty(O)){if(O==$)for(var F in C)C.hasOwnProperty(F)&&(L[F]=C[F]);C.hasOwnProperty(O)||(L[O]=D[O])}var E=M[S];return M[S]=L,r.languages.DFS(r.languages,function(j,U){U===E&&j!=S&&(this[j]=L)}),L},DFS:function S($,C,M,D){D=D||{};var L=r.util.objId;for(var O in $)if($.hasOwnProperty(O)){C.call($,O,$[O],M||O);var F=$[O],E=r.util.type(F);E==="Object"&&!D[L(F)]?(D[L(F)]=!0,S(F,C,null,D)):E==="Array"&&!D[L(F)]&&(D[L(F)]=!0,S(F,C,O,D))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,C){var M={callback:C,container:S,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 D=0,L;L=M.elements[D++];)r.highlightElement(L,$===!0,M.callback)},highlightElement:function(S,$,C){var M=r.util.getLanguage(S),D=r.languages[M];r.util.setLanguage(S,M);var L=S.parentElement;L&&L.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(L,M);var O=S.textContent,F={element:S,language:M,grammar:D,code:O};function E(U){F.highlightedCode=U,r.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,r.hooks.run("after-highlight",F),r.hooks.run("complete",F),C&&C.call(F.element)}if(r.hooks.run("before-sanity-check",F),L=F.element.parentElement,L&&L.nodeName.toLowerCase()==="pre"&&!L.hasAttribute("tabindex")&&L.setAttribute("tabindex","0"),!F.code){r.hooks.run("complete",F),C&&C.call(F.element);return}if(r.hooks.run("before-highlight",F),!F.grammar){E(r.util.encode(F.code));return}if($&&i.Worker){var j=new Worker(r.filename);j.onmessage=function(U){E(U.data)},j.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else E(r.highlight(F.code,F.grammar,F.language))},highlight:function(S,$,C){var M={code:S,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(S,$){var C=$.rest;if(C){for(var M in C)$[M]=C[M];delete $.rest}var D=new c;return d(D,D.head,S),f(S,D,$,D.head,0),g(D)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(F+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),S=0,$;$=y[S++];)t.highlightElement($)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(l_);const Vs=l_.exports;var pw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;r<l.length;++r)l.charCodeAt(r)==" ".charCodeAt(0)&&(o+=3);return l.length+o}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,o){o=e(this.defaults,o);for(var r in o){var a=i(r);r!=="normalize"&&a!=="setDefaults"&&o[r]&&this[a]&&(l=this[a].call(this,l,o[r]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,o){return o=o|0||4,l.replace(/\t/g,new Array(++o).join(" "))},spacesToTabs:function(l,o){return o=o|0||4,l.replace(RegExp(" {"+o+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var o=l.match(/^[^\S\n\r]*(?=\S)/gm);return!o||!o[0].length||(o.sort(function(r,a){return r.length-a.length}),!o[0].length)?l:l.replace(RegExp("^"+o[0],"gm"),"")},indent:function(l,o){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++o).join(" ")+"$&")},breakLines:function(l,o){o=o===!0?80:o|0||80;for(var r=l.split(`
`),a=0;a<r.length;++a)if(!(s(r[a])<=o)){for(var u=r[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>o&&(u[c]=`
`+u[c],f=d)}r[a]=u.join("")}return r.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var p=a[d];p==l.element?c=!0:p.nodeName==="#text"&&(c?f+=p.nodeValue:u+=p.nodeValue,r.removeChild(p),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=o.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(pw);function mw(n){let e,t;return{c(){e=_("div"),t=_("code"),h(t,"class","svelte-tv7jme"),h(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:oe,o:oe,d(i){i&&k(e)}}}function gw(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function o(r){return r=typeof r=="string"?r:"",r=Vs.plugins.NormalizeWhitespace.normalize(r,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Vs.highlight(r,Vs.languages[s]||Vs.languages.javascript,s)}return n.$$set=r=>{"content"in r&&t(1,i=r.content),"language"in r&&t(2,s=r.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof Vs<"u"&&i&&t(0,l=o(i))},[l,i,s]}class en extends Ee{constructor(e){super(),Ae(this,e,gw,mw,Oe,{content:1,language:2})}}const _w=n=>({}),Xf=n=>({}),bw=n=>({}),Qf=n=>({});function xf(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$=n[4]&&!n[2]&&ec(n);const C=n[18].header,M=$n(C,n,n[17],Qf);let D=n[4]&&n[2]&&tc(n);const L=n[18].default,O=$n(L,n,n[17],null),F=n[18].footer,E=$n(F,n,n[17],Xf);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),$&&$.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),E&&E.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(d,"class","overlay-panel-section panel-footer"),h(l,"class",p="overlay-panel "+n[1]+" "+n[8]),X(l,"popup",n[2]),h(e,"class","overlay-panel-container"),X(e,"padded",n[2]),X(e,"active",n[0])},m(j,U){w(j,e,U),m(e,t),m(e,s),m(e,l),m(l,o),$&&$.m(o,null),m(o,r),M&&M.m(o,null),m(o,a),D&&D.m(o,null),m(l,u),m(l,f),O&&O.m(f,null),n[20](f),m(l,c),m(l,d),E&&E.m(d,null),b=!0,y||(S=[G(t,"click",Vt(n[19])),G(f,"scroll",n[21])],y=!0)},p(j,U){n=j,n[4]&&!n[2]?$?$.p(n,U):($=ec(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!b||U&131072)&&Mn(M,C,n,n[17],b?Cn(C,n[17],U,bw):Tn(n[17]),Qf),n[4]&&n[2]?D?D.p(n,U):(D=tc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||U&131072)&&Mn(O,L,n,n[17],b?Cn(L,n[17],U,null):Tn(n[17]),null),E&&E.p&&(!b||U&131072)&&Mn(E,F,n,n[17],b?Cn(F,n[17],U,_w):Tn(n[17]),Xf),(!b||U&258&&p!==(p="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",p),U&262&&X(l,"popup",n[2]),U&4&&X(e,"padded",n[2]),U&1&&X(e,"active",n[0])},i(j){b||(Tt(()=>{i||(i=at(t,mo,{duration:hs,opacity:0},!0)),i.run(1)}),A(M,j),A(O,j),A(E,j),Tt(()=>{v&&v.end(1),g=Jp(l,jn,n[2]?{duration:hs,y:-10}:{duration:hs,x:50}),g.start()}),b=!0)},o(j){i||(i=at(t,mo,{duration:hs,opacity:0},!1)),i.run(0),P(M,j),P(O,j),P(E,j),g&&g.invalidate(),v=Gp(l,jn,n[2]?{duration:hs,y:10}:{duration:hs,x:50}),b=!1},d(j){j&&k(e),j&&i&&i.end(),$&&$.d(),M&&M.d(j),D&&D.d(),O&&O.d(j),n[20](null),E&&E.d(j),j&&v&&v.end(),y=!1,lt(S)}}}function ec(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Vt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function tc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=G(e,"click",Vt(n[5])),t=!0)},
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&h(e,"for",l);const S={};y&16&&(S.id=b[4]),y&1&&(S.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].exceptDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function $S(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[4]+".options.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.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"))&&h(e,"for",l);const S={};y&16&&(S.id=b[4]+".options.onlyDomains"),y&1&&(S.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].onlyDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function CS(n){let e,t,i,s,l,o,r;return i=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[SS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[$S,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(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&&k(e),V(i),V(o)}}}function MS(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 u_ extends Ee{constructor(e){super(),Ae(this,e,MS,CS,Oe,{key:1,options:0})}}function TS(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 u_({props:r}),ge.push(()=>Ie(e,"key",l)),ge.push(()=>Ie(e,"options",o)),{c(){z(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],Re(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],Re(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){V(e,a)}}}function DS(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 OS extends Ee{constructor(e){super(),Ae(this,e,DS,TS,Oe,{key:0,options:1})}}var gr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],_s={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/x
<span class='flatpickr-weekday'>
`+I.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ae(){t.calendarContainer.classList.add("hasWeeks");var N=wt("div","flatpickr-weekwrapper");N.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var I=wt("div","flatpickr-weeks");return N.appendChild(I),{weekWrapper:N,weekNumbers:I}}function ve(N,I){I===void 0&&(I=!0);var B=I?N:N-t.currentMonth;B<0&&t._hidePrevMonthArrow===!0||B>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=B,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,nt("onYearChange"),Q()),U(),nt("onMonthChange"),Xe())}function le(N,I){if(N===void 0&&(N=!0),I===void 0&&(I=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,I===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var B=yr(t.config),ne=B.hours,Ne=B.minutes,qe=B.seconds;p(ne,Ne,qe)}t.redraw(),N&&nt("onChange")}function me(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),nt("onClose")}function re(){t.config!==void 0&&nt("onDestroy");for(var N=t._handlers.length;N--;)t._handlers[N].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 I=t.calendarContainer.parentNode;if(I.lastChild&&I.removeChild(I.lastChild),I.parentNode){for(;I.firstChild;)I.parentNode.insertBefore(I.firstChild,I);I.parentNode.removeChild(I)}}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(B){try{delete t[B]}catch{}})}function de(N){return t.calendarContainer.contains(N)}function fe(N){if(t.isOpen&&!t.config.inline){var I=vn(N),B=de(I),ne=I===t.input||I===t.altInput||t.element.contains(I)||N.path&&N.path.indexOf&&(~N.path.indexOf(t.input)||~N.path.indexOf(t.altInput)),Ne=!ne&&!B&&!de(N.relatedTarget),qe=!t.config.ignoredFocusElements.some(function(it){return it.contains(I)});Ne&&qe&&(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 ie(N){if(!(!N||t.config.minDate&&N<t.config.minDate.getFullYear()||t.config.maxDate&&N>t.config.maxDate.getFullYear())){var I=N,B=t.currentYear!==I;t.currentYear=I||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)),B&&(t.redraw(),nt("onYearChange"),Q())}}function x(N,I){var B;I===void 0&&(I=!0);var ne=t.parseDate(N,void 0,I);if(t.config.minDate&&ne&&yn(ne,t.config.minDate,I!==void 0?I:!t.minDateHasTime)<0||t.config.maxDate&&ne&&yn(ne,t.config.maxDate,I!==void 0?I:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ne===vo
`),d=_("span"),p=_("span"),p.textContent="Choose presets",g=T(),z(v.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(p,"class","txt link-primary"),h(d,"class","inline-flex"),h(f,"class","help-block")},m(M,D){w(M,e,D),m(e,t),m(e,i),m(e,s),w(M,o,D),q(r,M,D),w(M,u,D),w(M,f,D),m(f,c),m(f,d),m(d,p),m(d,g),q(v,d,null),b=!0,y||(S=tt(Mt.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&h(e,"for",l);const L={};D&1024&&(L.id=M[10]),!a&&D&1&&(a=!0,L.value=M[0].mimeTypes,Re(()=>a=!1)),r.$set(L);const O={};D&2049&&(O.$$scope={dirty:D,ctx:M}),v.$set(O)},i(M){b||(A(r.$$.fragment,M),A(v.$$.fragment,M),b=!0)},o(M){P(r.$$.fragment,M),P(v.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(o),V(r,M),M&&k(u),M&&k(f),V(v),y=!1,S()}}}function n$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[9](b)}let v={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&1024&&l!==(l=b[10]))&&h(e,"for",l);const S={};y&1024&&(S.id=b[10]),!a&&y&1&&(a=!0,S.value=b[0].thumbs,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function i$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return i=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[QS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[xS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[t$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[n$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(a,"class","col-sm-12"),h(c,"class","col-sm-12"),h(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),p=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const S={};v&2&&(S.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(S.$$scope={dirty:v,ctx:g}),u.$set(S);const $={};v&2&&($.name="schema."+g[1]+".options.thumbs"),v&3073&&($.$$scope={dirty:v,ctx:g}),d.$set($)},i(g){p||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),p=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),p=!1},d(g){g&&k(e),V(i),V(o),V(u),V(d)}}}function s$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Dt(this.value),t(0,s)}function o(){s.maxSelect=Dt(this.value),t(0,s)}function r(p){n.$$.not_equal(s.mimeTypes,p)&&(s.mimeTypes=p,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(p){n.$$.not_equal(s.thumbs,p)&&(s.thumbs=p,t(0,s))}return n.$$set=p=>{"key"in p&&t(1,i=p.key),"options"in p&&t(0,s=p.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[b$,({uniqueId:U})=>({37:U}),({uniqueId:U})=>[0,U?64:0]]},$$scope:{ctx:n}}});const L=[O$,D$,T$,M$,C$,$$,S$,w$,k$,y$,v$],O=[];function F(U,Q){return U[0].type==="text"?0:U[0].type==="number"?1:U[0].type==="bool"?2:U[0].type==="email"?3:U[0].type==="url"?4:U[0].type==="date"?5:U[0].type==="select"?6:U[0].type==="json"?7:U[0].type==="file"?8:U[0].type==="relation"?9:U[0].type==="user"?10:-1}~(f=F(n))&&(c=O[f]=L[f](n)),g=new Fe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[A$,({uniqueId:U})=>({37:U}),({uniqueId:U})=>[0,U?64:0]]},$$scope:{ctx:n}}});let E=n[0].type!=="file"&&Ec(n),j=!n[0].toDelete&&Pc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),p=_("div"),z(g.$$.fragment),v=T(),b=_("div"),E&&E.c(),y=T(),j&&j.c(),S=T(),$=_("input"),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(u,"class","col-sm-12 hidden-empty"),h(p,"class","col-sm-4 flex"),h(b,"class","col-sm-4 flex"),h(t,"class","grid"),h($,"type","submit"),h($,"class","hidden"),h($,"tabindex","-1"),h(e,"class","field-form")},m(U,Q){w(U,e,Q),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,p),q(g,p,null),m(t,v),m(t,b),E&&E.m(b,null),m(t,y),j&&j.m(t,null),m(e,S),m(e,$),C=!0,M||(D=G(e,"submit",Vt(n[31])),M=!0)},p(U,Q){const te={};Q[0]&1&&(te.class="form-field required "+(U[0].id?"disabled":"")),Q[0]&2&&(te.name="schema."+U[1]+".type"),Q[0]&1|Q[1]&192&&(te.$$scope={dirty:Q,ctx:U}),s.$set(te);const H={};Q[0]&33&&(H.class=`
form-field
required
`+(U[5]?"":"invalid")+`
`+(U[0].id&&U[0].system?"disabled":"")+`
`),Q[0]&2&&(H.name="schema."+U[1]+".name"),Q[0]&33|Q[1]&192&&(H.$$scope={dirty:Q,ctx:U}),r.$set(H);let Y=f;f=F(U),f===Y?~f&&O[f].p(U,Q):(c&&(Te(),P(O[Y],1,1,()=>{O[Y]=null}),De()),~f?(c=O[f],c?c.p(U,Q):(c=O[f]=L[f](U),c.c()),A(c,1),c.m(u,null)):c=null);const K={};Q[0]&1|Q[1]&192&&(K.$$scope={dirty:Q,ctx:U}),g.$set(K),U[0].type!=="file"?E?(E.p(U,Q),Q[0]&1&&A(E,1)):(E=Ec(U),E.c(),A(E,1),E.m(b,null)):E&&(Te(),P(E,1,1,()=>{E=null}),De()),U[0].toDelete?j&&(j.d(1),j=null):j?j.p(U,Q):(j=Pc(U),j.c(),j.m(t,null))},i(U){C||(A(s.$$.fragment,U),A(r.$$.fragment,U),A(c),A(g.$$.fragment,U),A(E),C=!0)},o(U){P(s.$$.fragment,U),P(r.$$.fragment,U),P(c),P(g.$$.fragment,U),P(E),C=!1},d(U){U&&k(e),V(s),V(r),~f&&O[f].d(),V(g),E&&E.d(),j&&j.d(),M=!1,D()}}}function Fc(n){let e,t,i,s,l=n[0].system&&Ic(),o=!n[0].id&&Nc(n),r=n[0].required&&Rc(),a=n[0].unique&&Hc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),h(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Ic(),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=Nc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Rc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Hc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Ic(n){let e;return{c(){e=_("span"),e.textContent="System",h(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Nc(n){let e;return{c(){e=_("span"),e.textContent="New",h(e,"class","label"),X(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&X(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Rc(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Hc(n){let e;return{c(){e=_("span"),e.textContent="Unique",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jc(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=tt(Mt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=at(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=at(e,qn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function qc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",Hn(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function L$(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,p,g,v,b,y=!n[0].toDelete&&Fc(n),S=n[7]&&!n[0].system&&jc(),$=n[0].toDelete&&qc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=R(r),f=T(),y&&y.c(),c=T(),d=_("div"),p=T(),S&&S.c(),g=T(),$&&$.c(),v=ot(),h(i,"class",s=Ua(W.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),h(t,"class","icon field-type"),h(o,"class","title field-name svelte-1tpxlm5"),h(o,"title",u=n[0].name),X(o,"txt-strikethrough",n[0].toDelete),h(e,"class","inline-flex"),h(d,"class","flex-fill")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(C,f,M),y&&y.m(C,M),w(C,c,M),w(C,d,M),w(C,p,M),S&&S.m(C,M),w(C,g,M),$&&$.m(C,M),w(C,v,M),b=!0},p(C,M){(!b||M[0]&1&&s!==(s=Ua(W.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&h(i,"class",s),(!b||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&be(a,r),(!b||M[0]&1&&u!==(u=C[0].name))&&h(o,"title",u),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=Fc(C),y.c(),y.m(c.parentNode,c)),C[7]&&!C[0].system?S?M[0]&129&&A(S,1):(S=jc(),S.c(),A(S,1),S.m(g.parentNode,g)):S&&(Te(),P(S,1,1,()=>{S=null}),De()),C[0].toDelete?$?$.p(C,M):($=qc(C),$.c(),$.m(v.parentNode,v)):$&&($.d(1),$=null)},i(C){b||(A(S),b=!0)},o(C){P(S),b=!1},d(C){C&&k(e),C&&k(f),y&&y.d(C),C&&k(c),C&&k(d),C&&k(p),S&&S.d(C),C&&k(g),$&&$.d(C),C&&k(v)}}}function F$(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,$=T(),C=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",L=T(),O=_("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",F=T(),E=_("hr"),j=T(),U=_("p"),U.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(g,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h(S,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(D,"class","m-b-0"),h(O,"class","inline-flex flex-gap-5"),h(E,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(K,Z){w(K,e,Z),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let ee=0;ee<Y.length;ee+=1)Y[ee].m(o,null);m(i,p),m(i,g),m(i,v),m(i,b),m(i,y),m(i,S),m(i,$),m(i,C),m(i,M),m(i,D),m(i,L),m(i,O),m(i,F),m(i,E),m(i,j),m(i,U),te=!0},p(K,Z){if(Z&1){H=K[0].schema;let ee;for(ee=0;ee<H.length;ee+=1){const ae=Uc(K,H,ee);Y[ee]?Y[ee].p(ae,Z):(Y[ee]=Yc(ae),Y[ee].c(),Y[ee].m(o,null))}for(;ee<Y.length;ee+=1)Y[ee].d(1);Y.length=H.length}},i(K){te||(K&&Tt(()=>{Q||(Q=at(e,Xt,{duration:150},!0)),Q.run(1)}),te=!0)},o(K){K&&(Q||(Q=at(e,Xt,{duration:150},!1)),Q.run(0)),te=!1},d(K){K&&k(e),Rn(Y,K),K&&Q&&Q.end()}}}function q$(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&be(i,t)},d(s){s&&k(e)}}}function V$(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=R(t),s=R(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&be(i,t)},d(l){l&&k(e)}}}function Yc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?V$:q$}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function z$(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[14];for(let r=0;r<l.length;r+=1){let a=Bc(n,l,r),u=o(a);t.set(u,e[r]=Kc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ot()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&262235&&(l=Object.entries(r[6]),Te(),e=ft(e,a,o,1,r,l,t,i.parentNode,Ft,Kc,i,Bc),De())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function B$(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function U$(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[tt(Mt.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function W$(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[tt(Mt.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function Y$(n){let e;return{c(){e=R("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function K$(n){let e;return{c(){e=R("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Z$(n){let e,t=n[15]+"",i,s,l=Mi(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,p,g,v,b,y;function S(){return n[10](n[14])}const $=()=>n[11](u,f),C=()=>n[11](null,f);function M(j){n[12](j,n[14])}var D=n[4];function L(j){let U={baseCollection:j[0],disabled:Mi(j[0][j[14]])};return j[0][j[14]]!==void 0&&(U.value=j[0][j[14]]),{props:U}}D&&(u=new D(L(n)),$(),ge.push(()=>Ie(u,"value",M)));function O(j,U){return U&1&&(g=null),g==null&&(g=!!Mi(j[0][j[14]])),g?K$:Y$}let F=O(n,-1),E=F(n);return{c(){e=_("label"),i=R(t),s=R(" - "),o=R(l),a=T(),u&&z(u.$$.fragment),d=T(),p=_("div"),E.c(),h(e,"for",r=n[18]),h(p,"class","help-block")},m(j,U){w(j,e,U),m(e,i),m(e,s),m(e,o),w(j,a,U),u&&q(u,j,U),w(j,d,U),w(j,p,U),E.m(p,null),v=!0,b||(y=G(e,"click",S),b=!0)},p(j,U){n=j,(!v||U
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
</a>.`,s=T(),l=_("span"),r=R(o),a=T(),b&&b.c(),u=T(),c.c(),d=ot(),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex"),h(e,"class","block m-b-base")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(C,u,M),S[f].m(C,M),w(C,d,M),p=!0,g||(v=G(l,"click",n[7]),g=!0)},p(C,[M]){(!p||M&4)&&o!==(o=C[2]?"Hide available fields":"Show available fields")&&be(r,o),C[2]?b?(b.p(C,M),M&4&&A(b,1)):(b=Wc(C),b.c(),A(b,1),b.m(e,null)):b&&(Te(),P(b,1,1,()=>{b=null}),De());let D=f;f=$(C),f===D?S[f].p(C,M):(Te(),P(S[D],1,1,()=>{S[D]=null}),De(),c=S[f],c?c.p(C,M):(c=S[f]=y[f](C),c.c()),A(c,1),c.m(d.parentNode,d))},i(C){p||(A(b),A(c),p=!0)},o(C){P(b),P(c),p=!1},d(C){C&&k(e),b&&b.d(),C&&k(u),S[f].d(C),C&&k(d),g=!1,v()}}}function Mi(n){return n===null}function G$(n,e,t){let{collection:i=new On}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Ki(()=>import("./FilterAutocompleteInput.8c26964d.js"),[])).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Un(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var S;t(0,i[y]=s[y]||"",i),await li(),(S=o[y])==null||S.focus()},p=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},g=y=>{var S;return(S=o[y])==null?void 0:S.focus()};function v(y,S){ge[y?"unshift":"push"](()=>{o[S]=y,t(3,o)})}function b(y,S){n.$$.not_equal(i[S],y)&&(i[S]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,p,g,v,b]}class X$ extends Ee{constructor(e){super(),Ae(this,e,G$,J$,Oe,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gc(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xc(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=R(`Renamed collection
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&2&&l!==(l=p[1].originalName+"")&&be(o,l),g&2&&c!==(c=p[1].name+"")&&be(d,c)},d(p){p&&k(e)}}}function Qc(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=R(`Renamed field
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&16&&l!==(l=p[14].originalName+"")&&be(o,l),g&16&&c!==(c=p[14].name+"")&&be(d,c)},d(p){p&&k(e)}}}function xc(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=R("Removed field "),i=_("span"),l=R(s),o=T(),h(i,"class","txt-bold"),h(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&be(l,s)},d(r){r&&k(e)}}}function Q$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[3].length&&Gc(),g=n[5]&&Xc(n),v=n[4],b=[];for(let $=0;$<v.length;$+=1)b[$]=Qc(Jc(n,v,$));let y=n[3],S=[];for(let $=0;$<y.length;$+=1)S[$]=xc(Zc(n,y,$));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=T(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,o=T(),p&&p.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let $=0;$<b.length;$+=1)b[$].c();d=T();for(let $=0;$<S.length;$+=1)S[$].c();h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning"),h(f,"class","changes-list svelte-1ghly2p")},m($,C){w($,e,C),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),p&&p.m(s,null),w($,r,C),w($,a,C),w($,u,C),w($,f,C),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<S.length;M+=1)S[M].m(f,null)},p($,C){if($[3].length?p||(p=Gc(),p.c(),p.m(s,null)):p&&(p.d(1),p=null),$[5]?g?g.p($,C):(g=Xc($),g.c(),g.m(f,c)):g&&(g.d(1),g=null),C&16){v=$[4];let M;for(M=0;M<v.length;M+=1){const D=Jc($,v,M);b[M]?b[M].p(D,C):(b[M]=Qc(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if(C&8){y=$[3];let M;for(M=0;M<y.length;M+=1){const D=Zc($,y,M);S[M]?S[M].p(D,C):(S[M]=xc(D),S[M].c(),S[M].m(f,null))}for(;M<S.length;M+=1)S[M].d(1);S.length=y.length}},d($){$&&k(e),p&&p.d(),$&&k(r),$&&k(a),$&&k(u),$&&k(f),g&&g.d(),Rn(b,$),Rn(S,$)}}}function x$(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function e3(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=T(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-secondary"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,lt(l)}}}function t3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[e3],header:[x$],default:[Q$]},$$scope:{ctx:n}};return e=new yi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){q(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),V(e,s)}}}function n3(n,e,t){let i,s,l;const o=rn();let r,a;async function u(y){t(1,a=y),await li(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),p=()=>c();function g(y){ge[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){dt.call(this,n,y)}function b(y){dt.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,p,g,v,b]}class i3 extends Ee{constructor(e){super(),Ae(this,e,n3,t3,Oe,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function ed(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new X$({props:o}),ge.push(()=>Ie(t,"collection",l)),{c(){e=_("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Re(()=>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&&k(e),V(t)}}}function s3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new j$({props:a}),ge.push(()=>Ie(i,"collection",r));let u=n[9]===pl&&ed(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),l=T(),u&&u.c(),h(t,"class","tab-item"),X(t,"active",n[9]===xi),h(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),q(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],Re(()=>s=!1)),i.$set(d),c[0]&512&&X(t,"active",f[9]===xi),f[9]===pl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=ed(f),u.c(),A(u,1),u.m(e,null)):u&&(Te(),P(u,1,1,()=>{u=null}),De())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),V(i),u&&u.d()}}}function td(n){let e,t,i,s,l,o,r;return o=new ss({props:{class:"dropdown dropdown-right m-t
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function nd(n){let e;return{c(){e=_("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function o3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[2].system&&nd();return{c(){e=_("label"),t=R("Name"),s=T(),l=_("input"),u=T(),p&&p.c(),f=ot(),h(e,"for",i=n[38]),h(l,"type","text"),h(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],h(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,h(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),p&&p.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&h(e,"for",i),v[1]&128&&o!==(o=g[38])&&h(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?p||(p=nd(),p.c(),p.m(f.parentNode,f)):p&&(p.d(1),p=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),p&&p.d(g),g&&k(f),c=!1,d()}}}function id(n){let e,t,i,s,l,o;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=tt(t=Mt.call(null,e,n[12])),l=!0)},p(r,a){t&&Bn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=at(e,qn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=at(e,qn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function sd(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=tt(Mt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=at(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=at(e,qn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function r3(n){var j,U,Q,te,H,Y;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,p,g,v=!W.isEmpty((j=n[4])==null?void 0:j.schema),b,y,S,$,C=!W.isEmpty((U=n[4])==null?void 0:U.listRule)||!W.isEmpty((Q=n[4])==null?void 0:Q.viewRule)||!W.isEmpty((te=n[4])==null?void 0:te.createRule)||!W.isEmpty((H=n[4])==null?void 0:H.updateRule)||!W.isEmpty((Y=n[4])==null?void 0:Y.deleteRule),M,D,L,O=!n[2].isNew&&!n[2].system&&td(n);r=new Fe({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[o3,({uniqueId:K})=>({38:K}),({uniqueId:K})=>[0,K?128:0]]},$$scope:{ctx:n}}});let F=v&&id(n),E=C&&sd();return{c(){e=_("h4"),i=R(t),s=T(),O&&O.c(),l=T(),o=_("form"),z(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),p=_("span"),p.textContent="Fields",g=T(),F&&F.c(),b=T(),y=_("button"),S=_("span"),S.textContent="API Rules",$=T(),E&&E.c(),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(p,"class","txt"),h(d,"type","button"),h(d,"class","tab-item"),X(d,"active",n[9]===xi),h(S,"class","txt"),h(y,"type","button"),h(y,"class","tab-item"),X(y,"active",n[9]===pl),h(c,"class","tabs-header stretched")},m(K,Z){w(K,e,Z),m(e,i),w(K,s,Z),O&&O.m(K,Z),w(K,l,Z),w(K,o,Z),q(r,o,null),m(o,a),m(o,u),w(K,f,Z),w(K,c,Z),m(c,d),m(d,p),m(d,g),F&&F.m(d,null),m(c,b),m(c,y),m(y,S),m(y,$),E&&E.m(y,null),M=!0,D||(L=[G(o,"submit",Vt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(K,Z){var ae,ve,le,me,re,de;(!M||Z[0]&4)&&t!==(t=K[2].isNew?"New collection":"Edit collection")&&be(i,t),!K[2].isNew&&!K[2].system?O?(O.p(K,Z),Z[0]&4&&A(O,1)):(O=td(K),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(Te(),P(O,1,1,()=>{O=null}),De());const ee={};Z[0]&2048&&(ee.class="form-field required m-b-0 "+(K[11]?"disabled":"")),Z[0]&2052|Z[1]&384&&(ee.$$scope={dirty:Z,ctx:K}),r.$set(ee),Z[0]&16&&(v=!W.isEmpty((ae=K[4])==null?void 0:ae.schema)),v?F?(F.p(K,Z),Z[0]&16&&A(F,1)):(F=id(K),F.c(),A(F,1),F.m(d,null)):F&&(Te(),P(F,1,1,()=>{F=null}),De()),Z[0]&512&&X(d,"active",K[9]===xi),Z[0]&16&&(C=!W.isEmpty((ve=K[4])==null?void 0:ve.listRule)||!W.isEmpty((le=K[4])==null?void 0:le.viewRule)||!W.isEmpty((me=K[4])==null?void 0:me.createRule
<span class="txt">New collection</span>`,y=T(),z(S.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),X(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),X(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(c,"class","sidebar-content"),h(b,"type","button"),h(b,"class","btn btn-block btn-outline"),h(v,"class","sidebar-footer"),h(e,"class","page-sidebar collection-sidebar")},m(E,j){w(E,e,j),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Ce(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let U=0;U<d.length;U+=1)d[U].m(c,null);O&&O.m(c,null),m(e,g),m(e,v),m(v,b),w(E,y,j),q(S,E,j),$=!0,C||(M=[G(l,"click",n[8]),G(r,"input",n[9]),G(b,"click",n[11])],C=!0)},p(E,[j]){j&16&&X(l,"hidden",!E[4]),j&1&&r.value!==E[0]&&Ce(r,E[0]),j&16&&X(i,"active",E[4]),j&106&&(D=E[3],d=ft(d,j,L,1,E,D,p,c,ln,ad,null,ld),!D.length&&O?O.p(E,j):D.length?O&&(O.d(1),O=null):(O=od(E),O.c(),O.m(c,null)));const U={};S.$set(U)},i(E){$||(A(S.$$.fragment,E),$=!0)},o(E){P(S.$$.fragment,E),$=!1},d(E){E&&k(e);for(let j=0;j<d.length;j+=1)d[j].d();O&&O.d(),E&&k(y),n[12](null),V(S,E),C=!1,lt(M)}}}function p3(n,e,t){let i,s,l,o,r;cn(n,ni,b=>t(5,o=b)),cn(n,Ss,b=>t(7,r=b));let a,u="";function f(b){jp(ni,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const p=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){ge[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,p,g,v]}class m3 extends Ee{constructor(e){super(),Ae(this,e,p3,h3,Oe,{})}}function g3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q,te,H,Y,K,Z,ee,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le,Pe,ue,ce,ke,Be;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,t=T(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
quoted), number, null, true, false`,l=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=R(` - is one of:
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),p=_("code"),p.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),S=_("code"),S.textContent="!=",$=T(),C=_("span"),C.textContent="NOT equal",M=T(),D=_("li"),L=_("code"),L.textContent=">",O=T(),F=_("span"),F.textContent="Greater than",E=T(),j=_("li"),U=_("code"),U.textContent=">=",Q=T(),te=_("span"),te.textContent="Greater than or equal",H=T(),Y=_("li"),K=_("code"),K.textContent="<",Z=T(),ee=_("span"),ee.textContent="Less than or equal",ae=T(),ve=_("li"),le=_("code"),le.textContent="<=",me=T(),re=_("span"),re.textContent="Less than or equal",de=T(),fe=_("li"),ie=_("code"),ie.textContent="~",x=T(),ye=_("span"),ye.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,He=T(),Le=_("li"),Pe=_("code"),Pe.textContent="!~",ue=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ke=T(),Be=_("p"),Be.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,h(r,"class","txt-danger"),h(p,"class","filter-op svelte-1w7s5nw"),h(v,"class","txt-hint"),h(S,"class","filter-op svelte-1w7s5nw"),h(C,"class","txt-hint"),h(L,"class","filter-op svelte-1w7s5nw"),h(F,"class","txt-hint"),h(U,"class","filter-op svelte-1w7s5nw"),h(te,"class","txt-hint"),h(K,"class","filter-op svelte-1w7s5nw"),h(ee,"class","txt-hint"),h(le,"class","filter-op svelte-1w7s5nw"),h(re,"class","txt-hint"),h(ie,"class","filter-op svelte-1w7s5nw"),h(ye,"class","txt-hint"),h(Pe,"class","filter-op svelte-1w7s5nw"),h(ce,"class","txt-hint")},m(Ke,Ue){w(Ke,e,Ue),w(Ke,t,Ue),w(Ke,i,Ue),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,p),m(d,g),m(d,v),m(c,b),m(c,y),m(y,S),m(y,$),m(y,C),m(c,M),m(c,D),m(D,L),m(D,O),m(D,F),m(c,E),m(c,j),m(j,U),m(j,Q),m(j,te),m(c,H),m(c,Y),m(Y,K),m(Y,Z),m(Y,ee),m(c,ae),m(c,ve),m(ve,le),m(ve,me),m(ve,re),m(c,de),m(c,fe),m(fe,ie),m(fe,x),m(fe,ye),m(c,He),m(c,Le),m(Le,Pe),m(Le,ue),m(Le,ce),w(Ke,ke,Ue),w(Ke,Be,Ue)},p:oe,i:oe,o:oe,d(Ke){Ke&&k(e),Ke&&k(t),Ke&&k(i),Ke&&k(ke),Ke&&k(Be)}}}class _3 extends Ee{constructor(e){super(),Ae(this,e,null,g3,Oe,{})}}function ud(n,e,t){const i=n.slice();return i[8]=e[t],i}function fd(n,e,t){const i=n.slice();return i[8]=e[t],i}function cd(n,e,t){const i=n.slice();return i[13]=e[t],i}function dd(n,e,t){const i=n.slice();return i[13]=e[t],i}function hd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pd(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&be(s,i),f&24&&X(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function md(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&X(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function gd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&36&&X(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function _d(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&X(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function b3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",S,$,C,M,D,L,O,F=[],E=new Map,j,U,Q=[],te=new Map,H,Y,K,Z,ee,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le,Pe,ue,ce,ke,Be,Ke,Ue,Je,xe,J,se,pe,Ve,Ge,bt,rt,ut,yt,Pt,Zt,_e,we,Ze,nt,Et,he,$e,Xe,Jt,zt,Xn,ct,N,I,B,ne,Ne,qe,it,Ye,st,We,Qe=[],St=new Map,bn,Yt,Gt=[],ai=new Map,ki,Qt=n[1]&&hd(),rs=n[4];const Tl=Me=>Me[13].lang;for(let Me=0;Me<rs.length;Me+=1){let ze=dd(n,rs,Me),Ot=Tl(ze);E.set(Ot,F[Me]=pd(Ot,ze))}let Ni=n[4];const Dl=Me=>Me[13].lang;for(let Me=0;Me<Ni.length;Me+=1){let ze=cd(n,Ni,Me),Ot=Dl(ze);te.set(Ot,Q[Me]=md(Ot,ze))}Je=new en({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),ut=new en({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),Pt=new _3({}),Xe=new en({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let as=n[5];const Ol=Me=>Me[8].code;for(let Me=0;Me<as.length;Me+=1){let ze=fd(n,as,Me),Ot=Ol(ze);St.set(Ot,Qe[Me]=gd(Ot,ze))}let Ri=n[5];const Al=Me=>Me[8].code;for(let Me=0;Me<Ri.length;Me+=1){let ze=ud(n,Ri,Me),Ot=Al(ze);ai.set(Ot,Gt[Me]=_d(Ot,ze))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),Qt&&Qt.c(),d=T(),p=_("div"),g=_("p"),v=R("Fetch a paginated "),b=_("strong"),S=R(y),$=R(" records list."),C=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),L=_("div"),O=_("div");for(let Me=0;Me<F.length;Me+=1)F[Me].c();j=T(),U=_("div");for(let Me=0;Me<Q.length;Me+=1)Q[Me].c();H=T(),Y=_("div"),Y.textContent="Query parameters",K=T(),Z=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ae=T(),ve=_("tbody"),le=_("tr"),le.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,me=T(),re=_("tr"),re.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,de=T(),fe=_("tr"),ie=_("td"),ie.textContent="sort",x=T(),ye=_("td"),ye.innerHTML='<span class="label">String</span>',He=T(),Le=_("td"),Pe=R("Specify the records order attribute(s). "),ue=_("br"),ce=R(`
Add `),ke=_("code"),ke.textContent="-",Be=R(" / "),Ke=_("code"),Ke.textContent="+",Ue=R(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),z(Je.$$.fragment),xe=T(),J=_("tr"),se=_("td"),se.textContent="filter",pe=T(),Ve=_("td"),Ve.innerHTML='<span class="label">String</span>',Ge=T(),bt=_("td"),rt=R(`Filter the returned records. Ex.:
`),z(ut.$$.fragment),yt=T(),z(Pt.$$.fragment),Zt=T(),_e=_("tr"),we=_("td"),we.textContent="expand",Ze=T(),nt=_("td"),nt.innerHTML='<span class="label">String</span>',Et=T(),he=_("td"),$e=R(`Auto expand nested record relations. Ex.:
`),z(Xe.$$.fragment),Jt=R(`
Supports up to 6-levels depth nested relations expansion. `),zt=_("br"),Xn=R(`
The expanded relations will be appended to each individual record under the
`),ct=_("code"),ct.textContent="@expand",N=R(" property (eg. "),I=_("code"),I.textContent='"@expand": {"rel1": {...}, ...}',B=R(`). Only the
relations that the user has permissions to `),ne=_("strong"),ne.textContent="view",Ne=R(" will be expanded."),qe=T(),it=_("div"),it.textContent="Responses",Ye=T(),st=_("div"),We=_("div");for(let Me=0;Me<Qe.length;Me+=1)Qe[Me].c();bn=T(),Yt=_("div");for(let Me=0;Me<Gt.length;Me+=1)Gt[Me].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(p,"class","content m-b-base"),h(M,"class","section-title"),h(O,"class","tabs-header compact left"),h(U,"class","tabs-content"),h(L,"class","tabs m-b-lg"),h(Y,"class","section-title"),h(Z,"class","table-compact table-border m-b-lg"),h(it,"class","section-title"),h(We,"class","tabs-header compact left"),h(Yt,"class","tabs-content"),h(st,"class","tabs")},m(Me,ze){w(Me,e,ze),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Qt&&Qt.m(e,null),w(Me,d,ze),w(Me,p,ze),m(p,g),m(g,v),m(g,b),m(b,S),m(g,$),w(Me,C,ze),w(Me,M,ze),w(Me,D,ze),w(Me,L,ze),m(L,O);for(let Ot=0;Ot<F.length;Ot+=1)F[Ot].m(O,null);m(L,j),m(L,U);for(let Ot=0;Ot<Q.length;Ot+=1)Q[Ot].m(U,null);w(Me,H,ze),w(Me,Y,ze),w(Me,K,ze),w(Me,Z,ze),m(Z,ee),m(Z,ae),m(Z,ve),m(ve,le),m(ve,me),m(ve,re),m(ve,de),m(ve,fe),m(fe,ie),m(fe,x),m(fe,ye),m(fe,He),m(fe,Le),m(Le,Pe),m(Le,ue),m(Le,ce),m(Le,ke),m(Le,Be),m(Le,Ke),m(Le,Ue),q(Je,Le,null),m(ve,xe),m(ve,J),m(J,se),m(J,pe),m(J,Ve),m(J,Ge),m(J,bt),m(bt,rt),q(ut,bt,null),m(bt,yt),q(Pt,bt,null),m(ve,Zt),m(ve,_e),m(_e,we),m(_e,Ze),m(_e,nt),m(_e,Et),m(_e,he),m(he,$e),q(Xe,he,null),m(he,Jt),m(he,zt),m(he,Xn),m(he,ct),m(he,N),m(he,I),m(he,B),m(he,ne),m(he,Ne),w(Me,qe,ze),w(Me,it,ze),w(Me,Ye,ze),w(Me,st,ze),m(st,We);for(let Ot=0;Ot<Qe.length;Ot+=1)Qe[Ot].m(We,null);m(st,bn),m(st,Yt);for(let Ot=0;Ot<Gt.length;Ot+=1)Gt[Ot].m(Yt,null);ki=!0},p(Me,[ze]){(!ki||ze&1)&&a!==(a=Me[0].name+"")&&be(u,a),Me[1]?Qt||(Qt=hd(),Qt.c(),Qt.m(e,null)):Qt&&(Qt.d(1),Qt=null),(!ki||ze&1)&&y!==(y=Me[0].name+"")&&be(S,y),ze&24&&(rs=Me[4],F=ft(F,ze,Tl,1,Me,rs,E,O,ln,pd,null,dd)),ze&24&&(Ni=Me[4],Te(),Q=ft(Q,ze,Dl,1,Me,Ni,te,U,Ft,md,null,cd),De()),ze&36&&(as=Me[5],Qe=ft(Qe,ze,Ol,1,Me,as,St,We,ln,gd,null,fd)),ze&36&&(Ri=Me[5],Te(),Gt=ft(Gt,ze,Al,1,Me,Ri,ai,Yt,Ft,_d,null,ud),De())},i(Me){if(!ki){for(let ze=0;ze<Ni.length;ze+=1)A(Q[ze]);A(Je.$$.fragment,Me),A(ut.$$.fragment,Me),A(Pt.$$.fragment,Me),A(Xe.$$.fragment,Me);for(let ze=0;ze<Ri.length;ze+=1)A(Gt[ze]);ki=!0}},o(Me){for(let ze=0;ze<Q.length;ze+=1)P(Q[ze]);P(Je.$$.fragment,Me),P(ut.$$.fragment,Me),P(Pt.$$.fragment,Me),P(Xe.$$.fragment,Me);for(let ze=0;ze<Gt.length;ze+=1)P(Gt[ze]);ki=!1},d(Me){Me&&k(e),Qt&&Qt.d(),Me&&k(d),Me&&k(p),Me&&k(C),Me&&k(M),Me&&k(D),Me&&k(L);for(let ze=0;ze<F.length;ze+=1)F[ze].d();for(let ze=0;ze<Q.length;ze+=1)Q[ze].d();Me&&k(H),Me&&k(Y),Me&&k(K),Me&&k(Z),V(Je),V(ut),V(Pt),V(Xe),Me&&k(qe),Me&&k(it),Me&&k(Ye),Me&&k(st);for(let ze=0;ze<Qe.length;ze+=1)Qe[ze].d();for(let ze=0;ze<Gt.length;ze+=1)Gt[ze].d()}}}function v3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(s),W.dummyCollectionRecord(s)]},null,2)}),r.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.getList("${s==null?void 0:s.name}", { page: 2 })
.then(function (list) {
// success...
}).catch(function (error) {
// error...
});
// alternatively you can also fetch all records at once via getFullList:
client.Records.getFullList("${s==null?void 0:s.name}", 200 /* batch size */)
.then(function (records) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class y3 extends Ee{constructor(e){super(),Ae(this,e,v3,b3,Oe,{collection:0})}}function bd(n,e,t){const i=n.slice();return i[8]=e[t],i}function vd(n,e,t){const i=n.slice();return i[8]=e[t],i}function yd(n,e,t){const i=n.slice();return i[13]=e[t],i}function kd(n,e,t){const i=n.slice();return i[13]=e[t],i}function wd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sd(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&be(s,i),f&24&&X(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function $d(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&X(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Cd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&36&&X(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Md(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&X(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function k3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,S=n[0].name+"",$,C,M,D,L,O,F,E=[],j=new Map,U,Q,te=[],H=new Map,Y,K,Z,ee,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le,Pe,ue,ce,ke,Be,Ke,Ue,Je,xe,J,se,pe,Ve,Ge,bt,rt,ut,yt=[],Pt=new Map,Zt,_e,we=[],Ze=new Map,nt,Et=n[1]&&wd(),he=n[4];const $e=I=>I[13].lang;for(let I=0;I<he.length;I+=1){let B=kd(n,he,I),ne=$e(B);j.set(ne,E[I]=Sd(ne,B))}let Xe=n[4];const Jt=I=>I[13].lang;for(let I=0;I<Xe.length;I+=1){let B=yd(n,Xe,I),ne=Jt(B);H.set(ne,te[I]=$d(ne,B))}ce=new en({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let zt=n[5];const Xn=I=>I[8].code;for(let I=0;I<zt.length;I+=1){let B=vd(n,zt,I),ne=Xn(B);Pt.set(ne,yt[I]=Cd(ne,B))}let ct=n[5];const N=I=>I[8].code;for(let I=0;I<ct.length;I+=1){let B=bd(n,ct,I),ne=N(B);Ze.set(ne,we[I]=Md(ne,B))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Et&&Et.c(),p=T(),g=_("div"),v=_("p"),b=R("Fetch a single "),y=_("strong"),$=R(S),C=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",L=T(),O=_("div"),F=_("div");for(let I=0;I<E.length;I+=1)E[I].c();U=T(),Q=_("div");for(let I=0;I<te.length;I+=1)te[I].c();Y=T(),K=_("div"),K.textContent="Path Parameters",Z=T(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,ae=T(),ve=_("div"),ve.textContent="Query parameters",le=T(),me=_("table"),re=_("thead"),re.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,de=T(),fe=_("tbody"),ie=_("tr"),x=_("td"),x.textContent="expand",ye=T(),He=_("td"),He.innerHTML='<span class="label">String</span>',Le=T(),Pe=_("td"),ue=R(`Auto expand nested record relations. Ex.:
`),z(ce.$$.fragment),ke=R(`
Supports up to 6-levels depth nested relations expansion. `),Be=_("br"),Ke=R(`
The expanded relations will be appended to the record under the
`),Ue=_("code"),Ue.textContent="@expand",Je=R(" property (eg. "),xe=_("code"),xe.textContent='"@expand": {"rel1": {...}, ...}',J=R(`). Only the
relations that the user has permissions to `),se=_("strong"),se.textContent="view",pe=R(" will be expanded."),Ve=T(),Ge=_("div"),Ge.textContent="Responses",bt=T(),rt=_("div"),ut=_("div");for(let I=0;I<yt.length;I+=1)yt[I].c();Zt=T(),_e=_("div");for(let I=0;I<we.length;I+=1)we[I].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(K,"class","section-title"),h(ee,"class","table-compact table-border m-b-lg"),h(ve,"class","section-title"),h(me,"class","table-compact table-border m-b-lg"),h(Ge,"class","section-title"),h(ut,"class","tabs-header compact left"),h(_e,"class","tabs-content"),h(rt,"class","tabs")},m(I,B){w(I,e,B),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Et&&Et.m(e,null),w(I,p,B),w(I,g,B),m(g,v),m(v,b),m(v,y),m(y,$),m(v,C),w(I,M,B),w(I,D,B),w(I,L,B),w(I,O,B),m(O,F);for(let ne=0;ne<E.length;ne+=1)E[ne].m(F,null);m(O,U),m(O,Q);for(let ne=0;ne<te.length;ne+=1)te[ne].m(Q,null);w(I,Y,B),w(I,K,B),w(I,Z,B),w(I,ee,B),w(I,ae,B),w(I,ve,B),w(I,le,B),w(I,me,B),m(me,re),m(me,de),m(me,fe),m(fe,ie),m(ie,x),m(ie,ye),m(ie,He),m(ie,Le),m(ie,Pe),m(Pe,ue),q(ce,Pe,null),m(Pe,ke),m(Pe,Be),m(Pe,Ke),m(Pe,Ue),m(Pe,Je),m(Pe,xe),m(Pe,J),m(Pe,se),m(Pe,pe),w(I,Ve,B),w(I,Ge,B),w(I,bt,B),w(I,rt,B),m(rt,ut);for(let ne=0;ne<yt.length;ne+=1)yt[ne].m(ut,null);m(rt,Zt),m(rt,_e);for(let ne=0;ne<we.length;ne+=1)we[ne].m(_e,null);nt=!0},p(I,[B]){(!nt||B&1)&&a!==(a=I[0].name+"")&&be(u,a),I[1]?Et||(Et=wd(),Et.c(),Et.m(e,null)):Et&&(Et.d(1),Et=null),(!nt||B&1)&&S!==(S=I[0].name+"")&&be($,S),B&24&&(he=I[4],E=ft(E,B,$e,1,I,he,j,F,ln,Sd,null,kd)),B&24&&(Xe=I[4],Te(),te=ft(te,B,Jt,1,I,Xe,H,Q,Ft,$d,null,yd),De()),B&36&&(zt=I[5],yt=ft(yt,B,Xn,1,I,zt,Pt,ut,ln,Cd,null,vd)),B&36&&(ct=I[5],Te(),we=ft(we,B,N,1,I,ct,Ze,_e,Ft,Md,null,bd),De())},i(I){if(!nt){for(let B=0;B<Xe.length;B+=1)A(te[B]);A(ce.$$.fragment,I);for(let B=0;B<ct.length;B+=1)A(we[B]);nt=!0}},o(I){for(let B=0;B<te.length;B+=1)P(te[B]);P(ce.$$.fragment,I);for(let B=0;B<we.length;B+=1)P(we[B]);nt=!1},d(I){I&&k(e),Et&&Et.d(),I&&k(p),I&&k(g),I&&k(M),I&&k(D),I&&k(L),I&&k(O);for(let B=0;B<E.length;B+=1)E[B].d();for(let B=0;B<te.length;B+=1)te[B].d();I&&k(Y),I&&k(K),I&&k(Z),I&&k(ee),I&&k(ae),I&&k(ve),I&&k(le),I&&k(me),V(ce),I&&k(Ve),I&&k(Ge),I&&k(bt),I&&k(rt);for(let B=0;B<yt.length;B+=1)yt[B].d();for(let B=0;B<we.length;B+=1)we[B].d()}}}function w3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.getOne("${s==null?void 0:s.name}", "RECORD_ID")
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class S3 extends Ee{constructor(e){super(),Ae(this,e,w3,k3,Oe,{collection:0})}}function Td(n,e,t){const i=n.slice();return i[8]=e[t],i}function Dd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Od(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[16]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[16]=e[t],i}function Pd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ld(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&be(s,i),f&20&&X(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Fd(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&X(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function $3(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function C3(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function M3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function T3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function D3(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
Set to `),s=_("code"),s.textContent="null",l=R(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function O3(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function A3(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function E3(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function P3(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function L3(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Id(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=W.getFieldValueType(e[13])+"",p,g,v,b;function y(L,O){return L[13].required?C3:$3}let S=y(e),$=S(e);function C(L,O){if(L[13].type==="text")return L3;if(L[13].type==="number")return P3;if(L[13].type==="json")return E3;if(L[13].type==="email")return A3;if(L[13].type==="url")return O3;if(L[13].type==="file")return D3;if(L[13].type==="relation")return T3;if(L[13].type==="user")return M3}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(L,O){w(L,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(L,O){e=L,S!==(S=y(e))&&($.d(1),$=S(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&be(a,r),O&1&&d!==(d=W.getFieldValueType(e[13])+"")&&be(p,d),M===(M=C(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(L){L&&k(t),$.d(),D&&D.d()}}}function Nd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&be(s,i),f&10&&X(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Rd(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&X(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function F3(n){var Zt;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",S,$,C,M,D,L,O,F,E,j,U,Q=[],te=new Map,H,Y,K=[],Z=new Map,ee,ae,ve,le,me,re,de,fe=[],ie=new Map,x,ye,He,Le,Pe,ue=[],ce=new Map,ke,Be,Ke=[],Ue=new Map,Je,xe=n[5]&&Pd(),J=n[4];const se=_e=>_e[16].lang;for(let _e=0;_e<J.length;_e+=1){let we=Ed(n,J,_e),Ze=se(we);te.set(Ze,Q[_e]=Ld(Ze,we))}let pe=n[4];const Ve=_e=>_e[16].lang;for(let _e=0;_e<pe.length;_e+=1){let we=Ad(n,pe,_e),Ze=Ve(we);Z.set(Ze,K[_e]=Fd(Ze,we))}let Ge=(Zt=n[0])==null?void 0:Zt.schema;const bt=_e=>_e[13].name;for(let _e=0;_e<Ge.length;_e+=1){let we=Od(n,Ge,_e),Ze=bt(we);ie.set(Ze,fe[_e]=Id(Ze,we))}let rt=n[3];const ut=_e=>_e[8].code;for(let _e=0;_e<rt.length;_e+=1){let we=Dd(n,rt,_e),Ze=ut(we);ce.set(Ze,ue[_e]=Nd(Ze,we))}let yt=n[3];const Pt=_e=>_e[8].code;for(let _e=0;_e<yt.length;_e+=1){let we=Td(n,yt,_e),Ze=Pt(we);Ue.set(Ze,Ke[_e]=Rd(Ze,we))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),xe&&xe.c(),d=T(),p=_("div"),g=_("p"),v=R("Create a new "),b=_("strong"),S=R(y),$=R(" record."),C=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,D=T(),L=_("p"),L.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",O=T(),F=_("div"),F.textContent="Client SDKs example",E=T(),j=_("div"),U=_("div");for(let _e=0;_e<Q.length;_e+=1)Q[_e].c();H=T(),Y=_("div");for(let _e=0;_e<K.length;_e+=1)K[_e].c();ee=T(),ae=_("div"),ae.textContent="Body Parameters",ve=T(),le=_("table"),me=_("thead"),me.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,re=T(),de=_("tbody");for(let _e=0;_e<fe.length;_e+=1)fe[_e].c();x=T(),ye=_("div"),ye.textContent="Responses",He=T(),Le=_("div"),Pe=_("div");for(let _e=0;_e<ue.length;_e+=1)ue[_e].c();ke=T(),Be=_("div");for(let _e=0;_e<Ke.length;_e+=1)Ke[_e].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-success"),h(p,"class","content m-b-base"),h(F,"class","section-title"),h(U,"class","tabs-header compact left"),h(Y,"class","tabs-content"),h(j,"class","tabs m-b-lg"),h(ae,"class","section-title"),h(le,"class","table-compact table-border m-b-lg"),h(ye,"class","section-title"),h(Pe,"class","tabs-header compact left"),h(Be,"class","tabs-content"),h(Le,"class","tabs")},m(_e,we){w(_e,e,we),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),xe&&xe.m(e,null),w(_e,d,we),w(_e,p,we),m(p,g),m(g,v),m(g,b),m(b,S),m(g,$),m(p,C),m(p,M),m(p,D),m(p,L),w(_e,O,we),w(_e,F,we),w(_e,E,we),w(_e,j,we),m(j,U);for(let Ze=0;Ze<Q.length;Ze+=1)Q[Ze].m(U,null);m(j,H),m(j,Y);for(let Ze=0;Ze<K.length;Ze+=1)K[Ze].m(Y,null);w(_e,ee,we),w(_e,ae,we),w(_e,ve,we),w(_e,le,we),m(le,me),m(le,re),m(le,de);for(let Ze=0;Ze<fe.length;Ze+=1)fe[Ze].m(de,null);w(_e,x,we),w(_e,ye,we),w(_e,He,we),w(_e,Le,we),m(Le,Pe);for(let Ze=0;Ze<ue.length;Ze+=1)ue[Ze].m(Pe,null);m(Le,ke),m(Le,Be);for(let Ze=0;Ze<Ke.length;Ze+=1)Ke[Ze].m(Be,null);Je=!0},p(_e,[we]){var Ze;(!Je||we&1)&&a!==(a=_e[0].name+"")&&be(u,a),_e[5]?xe||(xe=Pd(),xe.c(),xe.m(e,null)):xe&&(xe.d(1),xe=null),(!Je||we&1)&&y!==(y=_e[0].name+"")&&be(S,y),we&20&&(J=_e[4],Q=ft(Q,we,se,1,_e,J,te,U,ln,Ld,null,Ed)),we&20&&(pe=_e[4],Te(),K=ft(K,we,Ve,1,_e,pe,Z,Y,Ft,Fd,null,Ad),De()),we&1&&(Ge=(Ze=_e[0])==null?void 0:Ze.schema,fe=ft(fe,we,bt,1,_e,Ge,ie,de,ln,Id,null,Od)),we&10&&(rt=_e[3],ue=ft(ue,we,ut,1,_e,rt,ce,Pe,ln,Nd,null,Dd)),we&10&&(yt=_e[3],Te(),Ke=ft(Ke,we,Pt,1,_e,yt,Ue,Be,Ft,Rd,null,Td),De())},i(_e){if(!Je){for(let we=0;we<pe.length;we+=1)A(K[we]);for(let we=0;we<yt.length;we+=1)A(Ke[we]);Je=!0}},o(_e){for(let we=0;we<K.length;we+=1)P(K[we]);for(let we=0;we<Ke.length;we+=1)P(Ke[we]);Je=!1},d(_e){_e&&k(e),xe&&xe.d(),_e&&k(d),_e&&k(p),_e&&k(O),_e&&k(F),_e&&k(E),_e&&k(j);for(let we=0;we<Q.length;we+=1)Q[we].d();for(let we=0;we<K.length;we+=1)K[we].d();_e&&k(ee),_e&&k(ae),_e&&k(ve),_e&&k(le);for(let we=0;we<fe.length;we+=1)fe[we].d();_e&&k(x),_e&&k(ye),_e&&k(He),_e&&k(Le);for(let we=0;we<ue.length;we+=1)ue[we].d();for(let we=0;we<Ke.length;we+=1)Ke[we].d()}}}function I3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
const data = { ... };
client.Records.create("${s==null?void 0:s.name}", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,o,r,a,i,u,f]}class N3 extends Ee{constructor(e){super(),Ae(this,e,I3,F3,Oe,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[8]=e[t],i}function jd(n,e,t){const i=n.slice();return i[8]=e[t],i}function qd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[16]=e[t],i}function zd(n,e,t){const i=n.slice();return i[16]=e[t],i}function Bd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ud(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&be(s,i),f&20&&X(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Wd(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&X(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function R3(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function H3(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function j3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function q3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function V3(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
Set to `),s=_("code"),s.textContent="null",l=R(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function z3(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function B3(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function U3(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function W3(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Y3(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Yd(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=W.getFieldValueType(e[13])+"",p,g,v,b;function y(L,O){return L[13].required?H3:R3}let S=y(e),$=S(e);function C(L,O){if(L[13].type==="text")return Y3;if(L[13].type==="number")return W3;if(L[13].type==="json")return U3;if(L[13].type==="email")return B3;if(L[13].type==="url")return z3;if(L[13].type==="file")return V3;if(L[13].type==="relation")return q3;if(L[13].type==="user")return j3}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(L,O){w(L,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(L,O){e=L,S!==(S=y(e))&&($.d(1),$=S(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&be(a,r),O&1&&d!==(d=W.getFieldValueType(e[13])+"")&&be(p,d),M===(M=C(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(L){L&&k(t),$.d(),D&&D.d()}}}function Kd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&be(s,i),f&10&&X(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Zd(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&X(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function K3(n){var Et;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,S=n[0].name+"",$,C,M,D,L,O,F,E,j,U,Q,te=[],H=new Map,Y,K,Z=[],ee=new Map,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le=[],Pe=new Map,ue,ce,ke,Be,Ke,Ue=[],Je=new Map,xe,J,se=[],pe=new Map,Ve,Ge=n[5]&&Bd(),bt=n[4];const rt=he=>he[16].lang;for(let he=0;he<bt.length;he+=1){let $e=zd(n,bt,he),Xe=rt($e);H.set(Xe,te[he]=Ud(Xe,$e))}let ut=n[4];const yt=he=>he[16].lang;for(let he=0;he<ut.length;he+=1){let $e=Vd(n,ut,he),Xe=yt($e);ee.set(Xe,Z[he]=Wd(Xe,$e))}let Pt=(Et=n[0])==null?void 0:Et.schema;const Zt=he=>he[13].name;for(let he=0;he<Pt.length;he+=1){let $e=qd(n,Pt,he),Xe=Zt($e);Pe.set(Xe,Le[he]=Yd(Xe,$e))}let _e=n[3];const we=he=>he[8].code;for(let he=0;he<_e.length;he+=1){let $e=jd(n,_e,he),Xe=we($e);Je.set(Xe,Ue[he]=Kd(Xe,$e))}let Ze=n[3];const nt=he=>he[8].code;for(let he=0;he<Ze.length;he+=1){let $e=Hd(n,Ze,he),Xe=nt($e);pe.set(Xe,se[he]=Zd(Xe,$e))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Ge&&Ge.c(),p=T(),g=_("div"),v=_("p"),b=R("Update a single "),y=_("strong"),$=R(S),C=R(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,L=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",F=T(),E=_("div"),E.textContent="Client SDKs example",j=T(),U=_("div"),Q=_("div");for(let he=0;he<te.length;he+=1)te[he].c();Y=T(),K=_("div");for(let he=0;he<Z.length;he+=1)Z[he].c();ae=T(),ve=_("div"),ve.textContent="Path parameters",le=T(),me=_("table"),me.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,re=T(),de=_("div"),de.textContent="Body Parameters",fe=T(),ie=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,ye=T(),He=_("tbody");for(let he=0;he<Le.length;he+=1)Le[he].c();ue=T(),ce=_("div"),ce.textContent="Responses",ke=T(),Be=_("div"),Ke=_("div");for(let he=0;he<Ue.length;he+=1)Ue[he].c();xe=T(),J=_("div");for(let he=0;he<se.length;he+=1)se[he].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-warning"),h(g,"class","content m-b-base"),h(E,"class","section-title"),h(Q,"class","tabs-header compact left"),h(K,"class","tabs-content"),h(U,"class","tabs m-b-lg"),h(ve,"class","section-title"),h(me,"class","table-compact table-border m-b-lg"),h(de,"class","section-title"),h(ie,"class","table-compact table-border m-b-lg"),h(ce,"class","section-title"),h(Ke,"class","tabs-header compact left"),h(J,"class","tabs-content"),h(Be,"class","tabs")},m(he,$e){w(he,e,$e),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Ge&&Ge.m(e,null),w(he,p,$e),w(he,g,$e),m(g,v),m(v,b),m(v,y),m(y,$),m(v,C),m(g,M),m(g,D),m(g,L),m(g,O),w(he,F,$e),w(he,E,$e),w(he,j,$e),w(he,U,$e),m(U,Q);for(let Xe=0;Xe<te.length;Xe+=1)te[Xe].m(Q,null);m(U,Y),m(U,K);for(let Xe=0;Xe<Z.length;Xe+=1)Z[Xe].m(K,null);w(he,ae,$e),w(he,ve,$e),w(he,le,$e),w(he,me,$e),w(he,re,$e),w(he,de,$e),w(he,fe,$e),w(he,ie,$e),m(ie,x),m(ie,ye),m(ie,He);for(let Xe=0;Xe<Le.length;Xe+=1)Le[Xe].m(He,null);w(he,ue,$e),w(he,ce,$e),w(he,ke,$e),w(he,Be,$e),m(Be,Ke);for(let Xe=0;Xe<Ue.length;Xe+=1)Ue[Xe].m(Ke,null);m(Be,xe),m(Be,J);for(let Xe=0;Xe<se.length;Xe+=1)se[Xe].m(J,null);Ve=!0},p(he,[$e]){var Xe;(!Ve||$e&1)&&a!==(a=he[0].name+"")&&be(u,a),he[5]?Ge||(Ge=Bd(),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null),(!Ve||$e&1)&&S!==(S=he[0].name+"")&&be($,S),$e&20&&(bt=he[4],te=ft(te,$e,rt,1,he,bt,H,Q,ln,Ud,null,zd)),$e&20&&(ut=he[4],Te(),Z=ft(Z,$e,yt,1,he,ut,ee,K,Ft,Wd,null,Vd),De()),$e&1&&(Pt=(Xe=he[0])==null?void 0:Xe.schema,Le=ft(Le,$e,Zt,1,he,Pt,Pe,He,ln,Yd,null,qd)),$e&10&&(_e=he[3],Ue=ft(Ue,$e,we,1,he,_e,Je,Ke,ln,Kd,null,jd)),$e&10&&(Ze=he[3],Te(),se=ft(se,$e,nt,1,he,Ze,pe,J,Ft,Zd,null,Hd),De())},i(he){if(!Ve){for(let $e=0;$e<ut.length;$e+=1)A(Z[$e]);for(let $e=0;$e<Ze.length;$e+=1)A(se[$e]);Ve=!0}},o(he){for(let $e=0;$e<Z.length;$e+=1)P(Z[$e]);for(let $e=0;$e<se.length;$e+=1)P(se[$e]);Ve=!1},d(he){he&&k(e),Ge&&Ge.d(),he&&k(p),he&&k(g),he&&k(F),he&&k(E),he&&k(j),he&&k(U);for(let $e=0;$e<te.length;$e+=1)te[$e].d();for(let $e=0;$e<Z.length;$e+=1)Z[$e].d();he&&k(ae),he&&k(ve),he&&k(le),he&&k(me),he&&k(re),he&&k(de),he&&k(fe),he&&k(ie);for(let $e=0;$e<Le.length;$e+=1)Le[$e].d();he&&k(ue),he&&k(ce),he&&k(ke),he&&k(Be);for(let $e=0;$e<Ue.length;$e+=1)Ue[$e].d();for(let $e=0;$e<se.length;$e+=1)se[$e].d()}}}function Z3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
const data = { ... };
client.Records.update("${s==null?void 0:s.name}", "RECORD_ID", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,o,r,a,i,u,f]}class J3 extends Ee{constructor(e){super(),Ae(this,e,Z3,K3,Oe,{collection:0})}}function Jd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Xd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[13]=e[t],i}function xd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function eh(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&be(s,i),f&24&&X(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function th(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&X(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function nh(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&36&&X(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function ih(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&X(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function G3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,S=n[0].name+"",$,C,M,D,L,O,F,E=[],j=new Map,U,Q,te=[],H=new Map,Y,K,Z,ee,ae,ve,le,me,re,de=[],fe=new Map,ie,x,ye=[],He=new Map,Le,Pe=n[1]&&xd(),ue=n[4];const ce=J=>J[13].lang;for(let J=0;J<ue.length;J+=1){let se=Qd(n,ue,J),pe=ce(se);j.set(pe,E[J]=eh(pe,se))}let ke=n[4];const Be=J=>J[13].lang;for(let J=0;J<ke.length;J+=1){let se=Xd(n,ke,J),pe=Be(se);H.set(pe,te[J]=th(pe,se))}let Ke=n[5];const Ue=J=>J[8].code;for(let J=0;J<Ke.length;J+=1){let se=Gd(n,Ke,J),pe=Ue(se);fe.set(pe,de[J]=nh(pe,se))}let Je=n[5];const xe=J=>J[8].code;for(let J=0;J<Je.length;J+=1){let se=Jd(n,Je,J),pe=xe(se);He.set(pe,ye[J]=ih(pe,se))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Pe&&Pe.c(),p=T(),g=_("div"),v=_("p"),b=R("Delete a single "),y=_("strong"),$=R(S),C=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",L=T(),O=_("div"),F=_("div");for(let J=0;J<E.length;J+=1)E[J].c();U=T(),Q=_("div");for(let J=0;J<te.length;J+=1)te[J].c();Y=T(),K=_("div"),K.textContent="Path parameters",Z=T(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,ae=T(),ve=_("div"),ve.textContent="Responses",le=T(),me=_("div"),re=_("div");for(let J=0;J<de.length;J+=1)de[J].c();ie=T(),x=_("div");for(let J=0;J<ye.length;J+=1)ye[J].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-danger"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(K,"class","section-title"),h(ee,"class","table-compact table-border m-b-lg"),h(ve,"class","section-title"),h(re,"class","tabs-header compact left"),h(x,"class","tabs-content"),h(me,"class","tabs")},m(J,se){w(J,e,se),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Pe&&Pe.m(e,null),w(J,p,se),w(J,g,se),m(g,v),m(v,b),m(v,y),m(y,$),m(v,C),w(J,M,se),w(J,D,se),w(J,L,se),w(J,O,se),m(O,F);for(let pe=0;pe<E.length;pe+=1)E[pe].m(F,null);m(O,U),m(O,Q);for(let pe=0;pe<te.length;pe+=1)te[pe].m(Q,null);w(J,Y,se),w(J,K,se),w(J,Z,se),w(J,ee,se),w(J,ae,se),w(J,ve,se),w(J,le,se),w(J,me,se),m(me,re);for(let pe=0;pe<de.length;pe+=1)de[pe].m(re,null);m(me,ie),m(me,x);for(let pe=0;pe<ye.length;pe+=1)ye[pe].m(x,null);Le=!0},p(J,[se]){(!Le||se&1)&&a!==(a=J[0].name+"")&&be(u,a),J[1]?Pe||(Pe=xd(),Pe.c(),Pe.m(e,null)):Pe&&(Pe.d(1),Pe=null),(!Le||se&1)&&S!==(S=J[0].name+"")&&be($,S),se&24&&(ue=J[4],E=ft(E,se,ce,1,J,ue,j,F,ln,eh,null,Qd)),se&24&&(ke=J[4],Te(),te=ft(te,se,Be,1,J,ke,H,Q,Ft,th,null,Xd),De()),se&36&&(Ke=J[5],de=ft(de,se,Ue,1,J,Ke,fe,re,ln,nh,null,Gd)),se&36&&(Je=J[5],Te(),ye=ft(ye,se,xe,1,J,Je,He,x,Ft,ih,null,Jd),De())},i(J){if(!Le){for(let se=0;se<ke.length;se+=1)A(te[se]);for(let se=0;se<Je.length;se+=1)A(ye[se]);Le=!0}},o(J){for(let se=0;se<te.length;se+=1)P(te[se]);for(let se=0;se<ye.length;se+=1)P(ye[se]);Le=!1},d(J){J&&k(e),Pe&&Pe.d(),J&&k(p),J&&k(g),J&&k(M),J&&k(D),J&&k(L),J&&k(O);for(let se=0;se<E.length;se+=1)E[se].d();for(let se=0;se<te.length;se+=1)te[se].d();J&&k(Y),J&&k(K),J&&k(Z),J&&k(ee),J&&k(ae),J&&k(ve),J&&k(le),J&&k(me);for(let se=0;se<de.length;se+=1)de[se].d();for(let se=0;se<ye.length;se+=1)ye[se].d()}}}function X3(n,e,t){let i,{collection:s=new On}=e,l=204,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:204,body:`
null
`}),r.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.delete("${s==null?void 0:s.name}", "RECORD_ID")
.then(function () {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class Q3 extends Ee{constructor(e){super(),Ae(this,e,X3,G3,Oe,{collection:0})}}function sh(n,e,t){const i=n.slice();return i[4]=e[t],i}function lh(n,e,t){const i=n.slice();return i[4]=e[t],i}function oh(n,e){let t,i=e[4].lang+"",s,l,o,r;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[4].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[4].lang+"")&&be(s,i),f&6&&X(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),o=!1,r()}}}function rh(n,e){let t,i,s,l;return i=new en({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[4].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[4].code),i.$set(a),r&6&&X(t,"active",e[1]===e[4].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function x3(n){let e,t,i,s,l,o,r,a,u=[],f=new Map,c,d,p=[],g=new Map,v,b,y,S,$,C=n[2];const M=O=>O[4].lang;for(let O=0;O<C.length;O+=1){let F=lh(n,C,O),E=M(F);f.set(E,u[O]=oh(E,F))}let D=n[2];const L=O=>O[4].lang;for(let O=0;O<D.length;O+=1){let F=sh(n,D,O),E=L(F);g.set(E,p[O]=rh(E,F))}return S=new en({props:{content:JSON.stringify({action:"create",record:W.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
<div class="content"><p>/api/realtime</p></div>`,t=T(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
<p>Events are send for <strong>create</strong>, <strong>update</strong>
and <strong>delete</strong> record operations (see &quot;Event data format&quot; section below).</p>
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
<p>When you subscribe to a <strong>single record</strong>, the collection&#39;s
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p>
<p>When you subscribe to an <strong>entire collection</strong>, the collection&#39;s
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p></div></div>`,s=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),r=_("div"),a=_("div");for(let O=0;O<u.length;O+=1)u[O].c();c=T(),d=_("div");for(let O=0;O<p.length;O+=1)p[O].c();v=T(),b=_("div"),b.textContent="Event data format",y=T(),z(S.$$.fragment),h(e,"class","alert"),h(i,"class","content m-b-base"),h(l,"class","section-title"),h(a,"class","tabs-header compact left"),h(d,"class","tabs-content"),h(r,"class","tabs m-b-base"),h(b,"class","section-title")},m(O,F){w(O,e,F),w(O,t,F),w(O,i,F),w(O,s,F),w(O,l,F),w(O,o,F),w(O,r,F),m(r,a);for(let E=0;E<u.length;E+=1)u[E].m(a,null);m(r,c),m(r,d);for(let E=0;E<p.length;E+=1)p[E].m(d,null);w(O,v,F),w(O,b,F),w(O,y,F),q(S,O,F),$=!0},p(O,[F]){F&6&&(C=O[2],u=ft(u,F,M,1,O,C,f,a,ln,oh,null,lh)),F&6&&(D=O[2],Te(),p=ft(p,F,L,1,O,D,g,d,Ft,rh,null,sh),De());const E={};F&1&&(E.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(O[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),S.$set(E)},i(O){if(!$){for(let F=0;F<D.length;F+=1)A(p[F]);A(S.$$.fragment,O),$=!0}},o(O){for(let F=0;F<p.length;F+=1)P(p[F]);P(S.$$.fragment,O),$=!1},d(O){O&&k(e),O&&k(t),O&&k(i),O&&k(s),O&&k(l),O&&k(o),O&&k(r);for(let F=0;F<u.length;F+=1)u[F].d();for(let F=0;F<p.length;F+=1)p[F].d();O&&k(v),O&&k(b),O&&k(y),V(S,O)}}}function e4(n,e,t){let{collection:i=new On}=e,s="JavaScript",l=[];const o=r=>t(1,s=r.lang);return n.$$set=r=>{"collection"in r&&t(0,i=r.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
// (Optionally) authenticate
client.Users.authViaEmail("test@example.com", "123456");
// Subscribe to changes in any record from the collection
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
console.log(e.record);
});
// Unsubscribe
client.Realtime.unsubscribe() // remove all subscriptions
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
`}])},[i,s,l,o]}class t4 extends Ee{constructor(e){super(),Ae(this,e,e4,x3,Oe,{collection:0})}}function ah(n,e,t){const i=n.slice();return i[14]=e[t],i}function uh(n,e,t){const i=n.slice();return i[14]=e[t],i}function fh(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&z(t.$$.fragment),i=T(),h(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&q(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Te();const f=t;P(f.$$.fragment,1,0,()=>{V(f,1)}),De()}l?(t=new l(o(r)),z(t.$$.fragment),A(t.$$.fragment,1),q(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&V(t)}}}function ch(n,e){let t,i,s,l=e[4]===e[14].id&&fh(e);return{key:n,first:null,c(){t=ot(),l&&l.c(),i=ot(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=fh(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Te(),P(l,1,1,()=>{l=null}),De())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function n4(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=ah(n,l,r),u=o(a);i.set(u,t[r]=ch(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Te(),t=ft(t,a,o,1,r,l,i,e,Ft,ch,null,ah),De())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function dh(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=R(s),o=T(),h(i,"class","txt"),h(t,"tabindex","0"),h(t,"class","tab-item"),X(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[G(t,"click",u),G(t,"keydown",Bp(f))],r=!0)},p(c,d){e=c,d&48&&X(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,lt(a)}}}function i4(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let p=uh(n,f,d),g=c(p);u.set(g,a[d]=dh(g,p))}return{c(){e=_("h4"),t=_("strong"),s=R(i),l=R(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();h(r,"class","tabs-header stretched")},m(d,p){w(d,e,p),m(e,t),m(t,s),m(e,l),w(d,o,p),w(d,r,p);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,p){p&8&&i!==(i=d[3].name+"")&&be(s,i),p&114&&(f=d[5],a=ft(a,p,c,1,d,f,u,r,ln,dh,null,uh))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let p=0;p<a.length;p+=1)a[p].d()}}}function s4(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',h(e,"type","button"),h(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function l4(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[s4],header:[i4],default:[n4]},$$scope:{ctx:n}};return e=new yi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function o4(n,e,t){const i=[{id:"list",label:"List",component:y3},{id:"view",label:"View",component:S3},{id:"create",label:"Create",component:N3},{id:"update",label:"Update",component:J3},{id:"delete",label:"Delete",component:Q3},{id:"realtime",label:"Realtime",component:t4}];let s,l=new On,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,S){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(S))}const c=()=>a(),d=y=>u(y.id),p=(y,S)=>f(S,y.id);function g(y){ge[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){dt.call(this,n,y)}function b(y){dt.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,p,g,v,b]}class r4 extends Ee{constructor(e
<span class="txt">Upload new file</span>`,h(t,"type","file"),h(t,"class","hidden"),t.multiple=n[5],h(s,"type","button"),h(s,"class","btn btn-secondary btn-sm btn-block"),h(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,lt(o)}}}function oC(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,p,g,v,b=n[4];const y=D=>D[25];for(let D=0;D<b.length;D+=1){let L=mh(n,b,D),O=y(L);d.set(O,c[D]=gh(O,L))}let S=n[0],$=[];for(let D=0;D<S.length;D+=1)$[D]=_h(ph(n,S,D));const C=D=>P($[D],1,1,()=>{$[D]=null});let M=!n[8]&&bh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();p=T();for(let D=0;D<$.length;D+=1)$[D].c();g=T(),M&&M.c(),h(t,"class",i=W.getFieldTypeIcon(n[3].type)),h(l,"class","txt"),h(e,"for",a=n[21]),h(f,"class","files-list")},m(D,L){w(D,e,L),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,L),w(D,f,L);for(let O=0;O<c.length;O+=1)c[O].m(f,null);m(f,p);for(let O=0;O<$.length;O+=1)$[O].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,L){if((!v||L&8&&i!==(i=W.getFieldTypeIcon(D[3].type)))&&h(t,"class",i),(!v||L&8)&&o!==(o=D[3].name+"")&&be(r,o),(!v||L&2097152&&a!==(a=D[21]))&&h(e,"for",a),L&1558&&(b=D[4],Te(),c=ft(c,L,y,1,D,b,d,f,Ft,gh,p,mh),De()),L&2049){S=D[0];let O;for(O=0;O<S.length;O+=1){const F=ph(D,S,O);$[O]?($[O].p(F,L),A($[O],1)):($[O]=_h(F),$[O].c(),A($[O],1),$[O].m(f,g))}for(Te(),O=S.length;O<$.length;O+=1)C(O);De()}D[8]?M&&(M.d(1),M=null):M?M.p(D,L):(M=bh(D),M.c(),M.m(f,null))},i(D){if(!v){for(let L=0;L<b.length;L+=1)A(c[L]);for(let L=0;L<S.length;L+=1)A($[L]);v=!0}},o(D){for(let L=0;L<c.length;L+=1)P(c[L]);$=$.filter(Boolean);for(let L=0;L<$.length;L+=1)P($[L]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let L=0;L<c.length;L+=1)c[L].d();Rn($,D),M&&M.d(),n[19](null)}}}function rC(n){let e,t;return e=new Fe({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[oC,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function aC(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new _n}=e,c,d;function p(O){W.removeByValue(u,O),t(1,u)}function g(O){W.pushUnique(u,O),t(1,u)}function v(O){W.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=>p(O),S=O=>g(O),$=O=>v(O);function C(O){ge[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)},D=()=>c==null?void 0:c.click();function L(O){ge[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,F;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((O=f.options)==null?void 0:O.maxSelect)>1),n.$$.dirty&4128&&W.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=W.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((F=f.options)==null?void 0:F.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,p,g,v,r,y,S,$,C,M,D,L]}class uC extends Ee{constructor(e){super(),Ae(this,e,aC,rC,Oe,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function vh(n){let e,t;return{c(){e=_("small"),t=R(n[1]),h(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&be(t,i[1])},d(i){i&&k(e)}}}function fC(n){let e,t,i,s,l,o=n[0].id
`,h(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function PC(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new AC({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function LC(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new yC({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FC(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new uC({props:u}),ge.push(()=>Ie(e,"value",o)),ge.push(()=>Ie(e,"uploadedFiles",r)),ge.push(()=>Ie(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],Re(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],Re(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],Re(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function IC(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new z4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function NC(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new H4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function RC(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new F4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function HC(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new A4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function jC(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new M4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function qC(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new w4({props:l}),ge.push(()=>Ie(e,"value",
<span class="txt">Delete</span>`,h(e,"tabindex","0"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function WC(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&Dh(n);return{c(){e=_("h4"),i=R(t),s=T(),o=R(l),r=R(" record"),a=T(),c&&c.c(),u=ot()},m(d,p){w(d,e,p),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,p),c&&c.m(d,p),w(d,u,p),f=!0},p(d,p){(!f||p[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&be(i,t),(!f||p[0]&1)&&l!==(l=d[0].name+"")&&be(o,l),!d[2].isNew&&d[10]?c?(c.p(d,p),p[0]&1028&&A(c,1)):(c=Dh(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Te(),P(c,1,1,()=>{c=null}),De())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function YC(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=R(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[11]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],X(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=G(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&be(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&X(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function KC(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[YC],header:[WC],default:[BC]},$$scope:{ctx:n}};return e=new yi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),V(e,s)}}}function Oh(n){return JSON.stringify(n)}function ZC(n,e,t){let i,s,l,o;const r=rn(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new ao,p=!1,g=!1,v={},b={},y="";function S(ie){return C(ie),t(8,g=!0),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function C(ie){Li({}),c=ie||{},t(2,d=ie!=null&&ie.clone?ie.clone():new ao),t(3,v={}),t(4,b={}),await li(),t(15,y=Oh(d))}function M(){if(p||!l)return;t(7,p=!0);const ie=L();let x;d.isNew?x=Se.Records.create(u==null?void 0:u.id,ie):x=Se.Records.update(u==null?void 0:u.id,d.id,ie),x.then(async ye=>{dn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),$(),r("save",ye)}).catch(ye=>{Se.errorResponseHandler(ye)}).finally(()=>{t(7,p=!1)})}function D(){!(c!=null&&c.id)||_i("Do you really want to delete the selected record?",()=>Se.Records.delete(c["@collectionId"],c.id).then(()=>{$(),dn("Successfully deleted record."),r("delete",c)}).catch(ie=>{Se.errorResponseHandler(ie)}))}function L(){const ie=(d==null?void 0:d.export())||{},x=new FormData,ye={};for(const He of(u==null?void 0:u.schema)||[])ye[He.name]=He;for(const He in ie)!ye[He]||(typeof ie[He]>"u"&&(ie[He]=null),W.addValueToFormData(x,He,ie[He]));for(const He in v){const Le=W.toArray(v[He]);for(const Pe of Le)x.append(He,Pe)}for(const He in b){const Le=W.toArray(b[He]);for(const Pe of Le)x.append(He+"."+Pe,"")}return x}const O=()=>$(),F=()=>D();function E(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function j(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function U(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function Q(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function te(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function H(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function Y(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function K(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function Z(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function ee(ie,x){n.$$.not_equal(v[x.name],ie)&&(v[x.name]=ie,t(3,v))}function ae(ie,x){n.$$.not_e
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Vh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function zh(n,e){let t,i,s;return i=new p_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=ot(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Bh(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,S,$,C,M,D,L,O,F,E,j,U;function Q(){return e[25](e[35])}p=new Wo({props:{id:e[35].id}});let te=e[11];const H=Z=>Z[38].name;for(let Z=0;Z<te.length;Z+=1){let ee=Rh(e,te,Z),ae=H(ee);b.set(ae,v[Z]=zh(ae,ee))}$=new gi({props:{date:e[35].created}}),D=new gi({props:{date:e[35].updated}});function Y(){return e[26](e[35])}function K(...Z){return e[27](e[35],...Z)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),z(p.$$.fragment),g=T();for(let Z=0;Z<v.length;Z+=1)v[Z].c();y=T(),S=_("td"),z($.$$.fragment),C=T(),M=_("td"),z(D.$$.fragment),L=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),h(l,"type","checkbox"),h(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],h(u,"for",f="checkbox_"+e[35].id),h(s,"class","form-field"),h(i,"class","bulk-select-col min-width"),h(d,"class","col-type-text col-field-id"),h(S,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Z,ee){w(Z,t,ee),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),q(p,d,null),m(t,g);for(let ae=0;ae<v.length;ae+=1)v[ae].m(t,null);m(t,y),m(t,S),q($,S,null),m(t,C),m(t,M),q(D,M,null),m(t,L),m(t,O),m(t,F),E=!0,j||(U=[G(l,"change",Q),G(s,"click",Hn(e[19])),G(t,"click",Y),G(t,"keydown",K)],j=!0)},p(Z,ee){e=Z,(!E||ee[0]&8&&o!==(o="checkbox_"+e[35].id))&&h(l,"id",o),(!E||ee[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!E||ee[0]&8&&f!==(f="checkbox_"+e[35].id))&&h(u,"for",f);const ae={};ee[0]&8&&(ae.id=e[35].id),p.$set(ae),ee[0]&2056&&(te=e[11],Te(),v=ft(v,ee,H,1,e,te,b,t,Ft,zh,y,Rh),De());const ve={};ee[0]&8&&(ve.date=e[35].created),$.$set(ve);const le={};ee[0]&8&&(le.date=e[35].updated),D.$set(le)},i(Z){if(!E){A(p.$$.fragment,Z);for(let ee=0;ee<te.length;ee+=1)A(v[ee]);A($.$$.fragment,Z),A(D.$$.fragment,Z),E=!0}},o(Z){P(p.$$.fragment,Z);for(let ee=0;ee<v.length;ee+=1)P(v[ee]);P($.$$.fragment,Z),P(D.$$.fragment,Z),E=!1},d(Z){Z&&k(t),V(p);for(let ee=0;ee<v.length;ee+=1)v[ee].d();V($),V(D),j=!1,lt(U)}}}function Uh(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&be(s,i),a[0]&16&&be(o,r[4])},d(r){r&&k(e)}}}function Wh(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),X(t,"btn-loading",n[8]),X(t,"btn-disabled",n[8]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&be(o,l),c[0]&256&&X(t,"btn-loading",f[8]),c[0]&256&&X(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Yh(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,p,g,v,b,y,S;return{c(){e=_("div"),t=_("div"),i=R("Selected "),s=_("strong"),l=R(n[6]),o=T(),a=R(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),p=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),X(f,"bt
<span class="txt">API Preview</span>`,S=T(),$=_("button"),$.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,C=T(),z(M.$$.fragment),D=T(),z(L.$$.fragment),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(d,"type","button"),h(d,"class","btn btn-secondary btn-circle"),h(y,"type","button"),h(y,"class","btn btn-outline"),h($,"type","button"),h($,"class","btn btn-expanded"),h(b,"class","btns-group"),h(s,"class","page-header"),h(i,"class","page-wrapper")},m(Y,K){q(e,Y,K),w(Y,t,K),w(Y,i,K),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,f),m(s,c),m(s,d),m(s,p),q(g,s,null),m(s,v),m(s,b),m(b,y),m(b,S),m(b,$),m(i,C),q(M,i,null),m(i,D),q(L,i,null),E=!0,j||(U=[tt(Mt.call(null,d,{text:"Edit collection",position:"right"})),G(d,"click",n[12]),G(y,"click",n[14]),G($,"click",n[15])],j=!0)},p(Y,K){(!E||K&4)&&u!==(u=Y[2].name+"")&&be(f,u);const Z={};K&1&&(Z.value=Y[0]),K&4&&(Z.autocompleteCollection=Y[2]),M.$set(Z);const ee={};K&4&&(ee.collection=Y[2]),!O&&K&1&&(O=!0,ee.filter=Y[0],Re(()=>O=!1)),!F&&K&2&&(F=!0,ee.sort=Y[1],Re(()=>F=!1)),L.$set(ee)},i(Y){E||(A(e.$$.fragment,Y),A(g.$$.fragment,Y),A(M.$$.fragment,Y),A(L.$$.fragment,Y),E=!0)},o(Y){P(e.$$.fragment,Y),P(g.$$.fragment,Y),P(M.$$.fragment,Y),P(L.$$.fragment,Y),E=!1},d(Y){V(e,Y),Y&&k(t),Y&&k(i),V(g),V(M),n[17](null),V(L),j=!1,lt(U)}}}function yM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,h(t,"class","icon"),h(s,"class","m-b-10"),h(o,"type","button"),h(o,"class","btn btn-expanded-lg btn-lg"),h(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=G(o,"click",n[11]),r=!0)},p:oe,i:oe,o:oe,d(u){u&&k(e),r=!1,a()}}}function kM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function wM(n){let e,t,i,s,l,o,r,a,u;const f=[kM,yM,vM],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let p={};s=new Va({props:p}),n[21](s);let g={};o=new r4({props:g}),n[22](o);let v={collection:n[2]};return a=new h_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,[y]){let S=e;e=d(b),e===S?c[e].p(b,y):(Te(),P(c[S],1,1,()=>{c[S]=null}),De(),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&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&&k(i),n[21](null),V(s,b),b&&k(l),n[22](null),V(o,b),b&&k(r),n[23](null),V(a,b)}}}function SM(n,e,t){var te;let i,s,l,o;cn(n,ni,H=>t(2,s=H)),cn(n,Ss,H=>t(10,l=H)),cn(n,Xr,H=>t(8,o=H));const r=W.getQueryParams((te=window.location)==null?void 0:te.href);let a,u,f,c,d=r.filter||"",p=r.sort||"-created",g=r.collectionId;W.setDocumentTitle("Collections"),Rw(g);const v=()=>a==null?void 0:a.show(),b=()=>a==null?void 0:a.show(s),y=()=>c==null?void 0:c.load(),S=()=>u==null?void 0:u.show(s),$=()=>f==null?void 0:f.show(),C=H=>t(0,d=H.detail);function M(H){ge[H?"unshift":"push"](()=>{c=H,t(6,c)})}function D(H){d=H,t(0,d),t(2,s),t(9,g)}function L(H){p=H,t(1,p),t(2,s),t(9,g)}const O=H=>f==null?void 0:f.show(H==null?void 0:H.detail);function F(H){ge[H?"unshift":"push"](()=>{a=H,t(3,a)})}function E(H){ge[H?"unshift":"push"](()=>{u=H,t(4,u)})}function j(H){ge[H?"unshift":"push"](()=>{f=H,t(5,f)})}const U=()=>c==null?void 0:c.load(),Q=()=>c==null?void 0:c.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(H=>H.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&g!=s.id&&(t(9,g=s.id),t(1,p="-created"),t(0,d="")),n.$$.dirty&7&&(p||d||(s==null?void 0:s.id))&&W.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:d,sort:p})},[d,p,s,a,u,f,c,i,o,g,l,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q]}class $M extends Ee{constructor(e){super(),Ae(this,e,SM,wM,Oe,{})}}function Kh(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[CM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function CM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","text"),h(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&h(e,"for",l),c[1]&1&&a!==(a=f[31])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Zh(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',h(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=tt(Mt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function MM(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Zh();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[31]),h(a,"type","email"),h(a,"autocomplete","off"),h(a,"id",u=n[31]),a.required=!0},m(p,g){w(p,e,g),m(e,t),m(e,i),m(e,s),w(p,o,g),d&&d.m(p,g),w(p,r,g),w(p,a,g),Ce(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(p,g){g[1]&1&&l!==(l=p[31])&&h(e,"for",l),p[1].verified?d||(d=Zh(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=p[31])&&h(a,"id",u),g[0]&4&&a.value!==p[2]&&C
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function LM(n){let e,t,i,s,l=!n[1].verified&&xh(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(t,"type","button"),h(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=xh(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function FM(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&Qh(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[5],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],X(l,"btn-loading",n[5])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?p&&(Te(),P(p,1,1,()=>{p=null}),De()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=Qh(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&be(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&X(l,"btn-loading",g[5])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function IM(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[FM],header:[PM],default:[EM]},$$scope:{ctx:n}};return e=new yi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(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[25](null),V(e,s)}}}function NM(n,e,t){let i;const s=rn(),l="user_"+W.randomString(5);let o,r=new uo,a=!1,u=!1,f="",c="",d="",p=!1,g=!0;function v(Z){return y(Z),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Z){Li({}),t(1,r=Z!=null&&Z.clone?Z.clone():new uo),S()}function S(){t(3,p=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function $(){if(a||!i)return;t(5,a=!0);const Z={email:f};(r.isNew||p)&&(Z.password=c,Z.passwordConfirm=d);let ee;r.isNew?ee=Se.Users.create(Z):ee=Se.Users.update(r.id,Z),ee.then(async ae=>{g&&M(!1),t(6,u=!1),b(),dn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",ae)}).catch(ae=>{Se.errorResponseHandler(ae)}).finally(()=>{t(5,a=!1)})}function C(){!(r!=null&&r.id)||_i("Do you really want to delete the selected user?",()=>Se.Users.delete(r.id).then(()=>{t(6,u=!1),b(),dn("Successfully deleted user."),s("delete",r)}).catch(Z=>{Se.errorResponseHandler(Z)}))}function M(Z=!0){return Se.Users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),Z&&dn(`Successfully sent verification email to ${r.email}.`)}).catch(ee=>{Se.errorResponseHandler(ee)})}const D=()=>M(),L=()=>C(),O=()=>b();function F(){f=this.value,t(2,f)}function E(){p=this.checked,t(3,p)}function j(){c=this.value,t(7,c)}function U(){d=this.value,t(8,d)}function Q(){g=this.checked,t(9,g)}const te=()=>i&&u?(_i("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function H(Z){ge[Z?"unshift":"push"](()=>{o=Z,t(4,o)})}function Y(Z){dt.call(this,n,Z)}function K(Z){dt.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||p||f!==r.email)},[b,r,f,p,o,a,u,c,d,g,i,l,$,C,M,v,D,L,O,F,E,j,U,Q,te,H,Y,K]}class RM extends Ee{constructor(e){super(),Ae(this,e,NM,IM,Oe,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function ep(n,e,t){const i=n.slice();return i[38]=e[t],i}function tp(n,e,t){const i=n.slice();return i[41]=e[t],i}function np(n,e,t){const i=n.slice();return i[41]=e[t],i}function HM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F=[],E=new Map,j,U,Q,te,H,Y,K,Z,ee,ae,ve=[],le=new Map,me,re,de,fe,ie;r=new jo({}),r.$on("refresh",n[16]),p=new Ho({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),p.$o
<span class="txt">New user</span>`,d=T(),z(p.$$.fragment),g=T(),v=_("div"),b=_("table"),y=_("thead"),S=_("tr"),z($.$$.fragment),M=T(),z(D.$$.fragment),O=T();for(let pe=0;pe<F.length;pe+=1)F[pe].c();j=T(),z(U.$$.fragment),te=T(),z(H.$$.fragment),K=T(),Z=_("th"),ee=T(),ae=_("tbody");for(let pe=0;pe<ve.length;pe+=1)ve[pe].c();xe&&xe.c(),me=T(),J&&J.c(),re=T(),se&&se.c(),h(i,"class","breadcrumbs"),h(l,"type","button"),h(l,"class","btn btn-secondary btn-circle"),h(u,"class","flex-fill"),h(c,"type","button"),h(c,"class","btn btn-expanded"),h(t,"class","page-header"),h(Z,"class","col-type-action min-width"),h(b,"class","table"),X(b,"table-loading",n[10]),h(v,"class","table-wrapper"),h(e,"class","page-wrapper")},m(pe,Ve){w(pe,e,Ve),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),q(r,t,null),m(t,a),m(t,u),m(t,f),m(t,c),m(e,d),q(p,e,null),m(e,g),m(e,v),m(v,b),m(b,y),m(y,S),q($,S,null),m(S,M),q(D,S,null),m(S,O);for(let Ge=0;Ge<F.length;Ge+=1)F[Ge].m(S,null);m(S,j),q(U,S,null),m(S,te),q(H,S,null),m(S,K),m(S,Z),m(b,ee),m(b,ae);for(let Ge=0;Ge<ve.length;Ge+=1)ve[Ge].m(ae,null);xe&&xe.m(ae,null),m(e,me),J&&J.m(e,null),m(e,re),se&&se.m(e,null),de=!0,fe||(ie=[tt(Mt.call(null,l,{text:"Edit profile collection",position:"right"})),G(l,"click",n[15]),G(c,"click",n[17])],fe=!0)},p(pe,Ve){const Ge={};Ve[0]&8&&(Ge.value=pe[3]),p.$set(Ge);const bt={};Ve[1]&32768&&(bt.$$scope={dirty:Ve,ctx:pe}),!C&&Ve[0]&16&&(C=!0,bt.sort=pe[4],Re(()=>C=!1)),$.$set(bt);const rt={};Ve[1]&32768&&(rt.$$scope={dirty:Ve,ctx:pe}),!L&&Ve[0]&16&&(L=!0,rt.sort=pe[4],Re(()=>L=!1)),D.$set(rt),Ve[0]&4096&&(Pe=pe[12],F=ft(F,Ve,ue,1,pe,Pe,E,S,ln,ip,j,np));const ut={};Ve[1]&32768&&(ut.$$scope={dirty:Ve,ctx:pe}),!Q&&Ve[0]&16&&(Q=!0,ut.sort=pe[4],Re(()=>Q=!1)),U.$set(ut);const yt={};Ve[1]&32768&&(yt.$$scope={dirty:Ve,ctx:pe}),!Y&&Ve[0]&16&&(Y=!0,yt.sort=pe[4],Re(()=>Y=!1)),H.$set(yt),Ve[0]&5450&&(Ue=pe[1],Te(),ve=ft(ve,Ve,Je,1,pe,Ue,le,ae,Ft,rp,null,ep),De(),!Ue.length&&xe?xe.p(pe,Ve):Ue.length?xe&&(xe.d(1),xe=null):(xe=sp(pe),xe.c(),xe.m(ae,null))),Ve[0]&1024&&X(b,"table-loading",pe[10]),pe[1].length?J?J.p(pe,Ve):(J=ap(pe),J.c(),J.m(e,re)):J&&(J.d(1),J=null),pe[1].length&&pe[13]?se?se.p(pe,Ve):(se=up(pe),se.c(),se.m(e,null)):se&&(se.d(1),se=null)},i(pe){if(!de){A(r.$$.fragment,pe),A(p.$$.fragment,pe),A($.$$.fragment,pe),A(D.$$.fragment,pe),A(U.$$.fragment,pe),A(H.$$.fragment,pe);for(let Ve=0;Ve<Ue.length;Ve+=1)A(ve[Ve]);de=!0}},o(pe){P(r.$$.fragment,pe),P(p.$$.fragment,pe),P($.$$.fragment,pe),P(D.$$.fragment,pe),P(U.$$.fragment,pe),P(H.$$.fragment,pe);for(let Ve=0;Ve<ve.length;Ve+=1)P(ve[Ve]);de=!1},d(pe){pe&&k(e),V(r),V(p),V($),V(D);for(let Ve=0;Ve<F.length;Ve+=1)F[Ve].d();V(U),V(H);for(let Ve=0;Ve<ve.length;Ve+=1)ve[Ve].d();xe&&xe.d(),J&&J.d(),se&&se.d(),fe=!1,lt(ie)}}}function jM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading users...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function qM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function VM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ip(n,e){let t,i,s,l,o,r,a,u=e[41].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=R("profile."),f=R(u),h(s,"class",l=W.getFieldTypeIcon(e[41].type)),h(r,"class","txt"),h(i,"class","col-header-content"),h(t,"class",c="col-type-"+e[41].type+" col-field-"+e[41].name),h(t,"name",d=e[41].name),this.first=t},m(p,g){w(p,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(p,g){e=p,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[41].type))&&h(s,"class",l),g[0]&4096&&u!==(u=e[41].name+"")&&be(f,u),g[0]&4096&&c!==(c="col-type-"+e[41].type+" col-field-"+e[41].name)&&h(t,"class",c),g[0]&4096&&d!==(d=e[41].name)&&h(t,"name",d)},d(p){p&&k(t)}}}function zM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function BM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function sp(n){let e;function t(l,o){return l[10]?WM:UM}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function UM(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&lp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=lp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function WM(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function lp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[25]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function op(n,e){let t,i,s;return i=new p_({props:{field:e[41],record:e[38].profile||{}}}),{key:n,first:null,c(){t=ot(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[41]),o[0]&2&&(r.record=e[38].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function rp(n,e){let t,i,s,l,o,r,a,u=e[38].email+"",f,c,d,p,g=e[38].verified?"Verified":"Unverified",v,b,y=[],S=new Map,$,C,M,D,L,O,F,E,j,U,Q,te,H,Y,K;s=new Wo({props:{id:e[38].id}});let Z=e[12];const ee=le=>le[41].name;for(let le=0;le<Z.length;le+=1){let me=tp(e,Z,le),re=ee(me);S.set(re,y[le]=op(re,me))}M=new gi({props:{date:e[38].created}}),O=new gi({props:{date:e[38].updated}});function ae(){return e[23](e[38])}function ve(){return e[24](e[38])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),z(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=R(u),d=T(),p=_("span"),v=R(g),b=T();for(let le=0;le<y.length;le+=1)y[le].c();$=T(),C=_("td"),z(M.$$.fragment),D=T(),L=_("td"),z(O.$$.fragment),F=T(),E=_("td"),j=_("button"),j.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,U=T(),Q=_("button"),Q.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,te=T(),h(i,"class","col-type-text col-field-id"),h(a,"class","txt"),h(a,"title",c=e[38].email),h(p,"class","label"),X(p,"label-success",e[38].verified),X(p,"label-warning",!e[38].verified),h(r,"class","inline-flex"),h(o,"class","col-type-email col-field-email"),h(C,"class","col-type-date col-field-created"),h(L,"class","col-type-date col-field-updated"),h(j,"type","button"),h(j,"class","btn btn-sm btn-outline"),h(Q,"type","button"),h(Q,"class","btn btn-sm m-l-10"),h(E,"class","col-type-action min-width"),this.first=t},m(le,me){w(le,t,me),m(t,i),q(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,p),m(p,v),m(t,b);for(let re=0;re<y.length;re+=1)y[re].m(t,null);m(t,$),m(t,C),q(M,C,null),m(t,D),m(t,L),q(O,L,null),m(t,F),m(t,E),m(E,j),m(E,U),m(E,Q),m(t,te),H=!0,Y||(K=[G(j,"click",Hn(ae)),G(Q,"click",Hn(ve))],Y=!0)},p(le,me){e=le;const re={};me[0]&2&&(re.id=e[38].id),s.$set(re),(!H||me[0]&2)&&u!==(u=e[38].email+"")&&be(f,u),(!H||me[0]&2&&c!==(c=e[38].email))&&h(a,"title",c),(!H||me[0]&2)&&g!==(g=e[38].verified?"Verified":"Unverified")&&be(v,g),me[0]&2&&X(p,"label-success",e[38].verified),me[0]&2&&X(p,"label-warning",!e[38].verified),me[0]&4098&&(Z=e[12],Te(),y=ft(y,me,ee,1,e,Z,S,t,Ft,op,$,tp),De());const de={};me[0]&2&&(de.date=e[38].created),M.$set(de);const fe={};me[0]&2&&(fe.date=e[38].updated),O.$set(fe)},i(le){if(!H){A(s.$$.fragment,le);for(let me=0;me<Z.length;me+=1)A(y[me]);A(M.$$.fragment,le),A(O.$$.fragment,le),H=!0}},o(le){P(s.$$.fragment,le);for(let me=0;me<y.length;me+=1)P(y[me]);P(M.$$.fragment,le),P(O.$$.fragment,le),H=!1},d(le){le&&k(t),V(s);for(let me=0;me<y.length;me+=1)y[me].d();V(M),V(O),Y=!1,lt(K)}}}function ap(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[2]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&be(s,i),a[0]&4&&be(o,r[2])},d(r){r&&k(e)}}}function up(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),X(t,"btn-loading",n[10]),X(t,"btn-disabled",n[10]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[26]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&be(o,l),c[0]&1024&&X(t,"btn-loading",f[10]),c[0]&1024&&X(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function YM(n){let e,t,i,s,l,o,r,a,u;const f=[jM,HM],c=[];function d(b,y){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let p={};s=new RM({props:p}),n[27](s),s.$on("save",n[28]),s.$on("delete",n[29]);let g={};o=new Va({props:g}),n[30](o),o.$on("save",n[31]);let v={collection:n[5]};return a=new h_({props:v}),n[32](a),a.$on("save",n[33]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,y){let S=e;e=d(b),e===S?c[e].p(b,y):(Te(),P(c[S],1,1,()=>{c[S]=null}),De(),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]&32&&(M.collection=b[5]),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&&k(i),n[27](null),V(s,b),b&&k(l),n[30](null),V(o,b),b&&k(r),n[32](null),V(a,b)}}}function KM(n,e,t){var de;let i,s;const l=W.getQueryParams((de=window.location)==null?void 0:de.href),o=["id","userId","created","updated"];let r,a,u,f=[],c=1,d=0,p=!1,g=l.filter||"",v=l.sort||"-created",b=new On,y=!1;W.setDocumentTitle("Users"),M();async function S(fe=1){return t(10,p=!0),fe<=1&&$(),Se.Users.getList(fe,50,{sort:v||"-created",filter:g}).then(ie=>{t(10,p=!1),t(1,f=f.concat(ie.items)),t(9,c=ie.page),t(2,d=ie.totalItems)}).catch(ie=>{ie!=null&&ie.isAbort||(t(10,p=!1),console.warn(ie),$(),Se.errorResponseHandler(ie,!1))})}func
<span class="txt">Application</span>`,o=T(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=T(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=T(),c=_("div"),c.textContent="Authentication",d=T(),p=_("a"),p.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,b=T(),y=_("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(c,"class","sidebar-title"),h(p,"href","/settings/auth-providers"),h(p,"class","sidebar-list-item"),h(v,"href","/settings/tokens"),h(v,"class","sidebar-list-item"),h(y,"href","/settings/admins"),h(y,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,p),m(t,g),m(t,v),m(t,b),m(t,y),S||($=[tt(xn.call(null,l,{path:"/settings"})),tt(wn.call(null,l)),tt(xn.call(null,r,{path:"/settings/mail/?.*"})),tt(wn.call(null,r)),tt(xn.call(null,u,{path:"/settings/storage/?.*"})),tt(wn.call(null,u)),tt(xn.call(null,p,{path:"/settings/auth-providers/?.*"})),tt(wn.call(null,p)),tt(xn.call(null,v,{path:"/settings/tokens/?.*"})),tt(wn.call(null,v)),tt(xn.call(null,y,{path:"/settings/admins/?.*"})),tt(wn.call(null,y))],S=!0)},p:oe,i:oe,o:oe,d(C){C&&k(e),S=!1,lt($)}}}class Os extends Ee{constructor(e){super(),Ae(this,e,null,JM,Oe,{})}}function fp(n,e,t){const i=n.slice();return i[31]=e[t],i}function cp(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[GM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function GM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","text"),h(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&h(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function dp(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=T(),Jn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[31]),h(e,"tabindex","0"),h(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[G(e,"click",a),G(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(f){f&&k(e),o=!1,lt(r)}}}function XM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),r=_("input"),h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[3]),u||(f=G(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&8&&r.value!==c[3]&&Ce(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function hp(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[QM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[30]),h(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&h(s,"for",o)},d(u){u&&k(e)
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function sT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&mp(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],X(l,"btn-loading",n[6])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?p&&(Te(),P(p,1,1,()=>{p=null}),De()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=mp(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&be(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&X(l,"btn-loading",g[6])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function lT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[sT],header:[nT],default:[tT]},$$scope:{ctx:n}};return e=new yi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function oT(n,e,t){let i;const s=rn(),l="admin_"+W.randomString(5);let o,r=new vs,a=!1,u=!1,f=0,c="",d="",p="",g=!1;function v(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){Li({}),t(1,r=K!=null&&K.clone?K.clone():new vs),S()}function S(){t(4,g=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,p="")}function $(){if(a||!i)return;t(6,a=!0);const K={email:c,avatar:f};(r.isNew||g)&&(K.password=d,K.passwordConfirm=p);let Z;r.isNew?Z=Se.Admins.create(K):Z=Se.Admins.update(r.id,K),Z.then(async ee=>{var ae;t(7,u=!1),b(),dn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ee),((ae=Se.AuthStore.model)==null?void 0:ae.id)===ee.id&&Se.AuthStore.save(Se.AuthStore.token,ee)}).catch(ee=>{Se.errorResponseHandler(ee)}).finally(()=>{t(6,a=!1)})}function C(){!(r!=null&&r.id)||_i("Do you really want to delete the selected admin?",()=>Se.Admins.delete(r.id).then(()=>{t(7,u=!1),b(),dn("Successfully deleted admin."),s("delete",r)}).catch(K=>{Se.errorResponseHandler(K)}))}const M=()=>C(),D=()=>b(),L=K=>t(2,f=K),O=(K,Z)=>{(Z.code==="Enter"||Z.code==="Space")&&(Z.preventDefault(),t(2,f=K))};function F(){c=this.value,t(3,c)}function E(){g=this.checked,t(4,g)}function j(){d=this.value,t(8,d)}function U(){p=this.value,t(9,p)}const Q=()=>i&&u?(_i("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function te(K){ge[K?"unshift":"push"](()=>{o=K,t(5,o)})}function H(K){dt.call(this,n,K)}function Y(K){dt.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,p,i,l,$,C,v,M,D,L,O,F,E,j,U,Q,te,H,Y]}class rT extends Ee{constructor(e){super(),Ae(this,e,oT,lT,Oe,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function gp(n,e,t){const i=n.slice();return i[22]=e[t],i}function aT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function uT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function fT(n){let e,t,i,s;return{c(){
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function bp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function vp(n){let e;return{c(){e=_("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yp(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g=e[22].email+"",v,b,y,S,$,C,M,D,L,O,F,E,j,U;u=new Wo({props:{id:e[22].id}});let Q=e[22].id===e[6].id&&vp();$=new gi({props:{date:e[22].created}}),D=new gi({props:{date:e[22].updated}});function te(){return e[14](e[22])}function H(...Y){return e[15](e[22],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),z(u.$$.fragment),f=T(),Q&&Q.c(),c=T(),d=_("td"),p=_("span"),v=R(g),y=T(),S=_("td"),z($.$$.fragment),C=T(),M=_("td"),z(D.$$.fragment),L=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),Jn(l.src,o="/_/images/avatars/avatar"+(e[22].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(a,"class","col-type-text col-field-id"),h(p,"class","txt txt-ellipsis"),h(p,"title",b=e[22].email),h(d,"class","col-type-email col-field-email"),h(S,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Y,K){w(Y,t,K),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),q(u,a,null),m(a,f),Q&&Q.m(a,null),m(t,c),m(t,d),m(d,p),m(p,v),m(t,y),m(t,S),q($,S,null),m(t,C),m(t,M),q(D,M,null),m(t,L),m(t,O),m(t,F),E=!0,j||(U=[G(t,"click",te),G(t,"keydown",H)],j=!0)},p(Y,K){e=Y,(!E||K&16&&!Jn(l.src,o="/_/images/avatars/avatar"+(e[22].avatar||0)+".svg"))&&h(l,"src",o);const Z={};K&16&&(Z.id=e[22].id),u.$set(Z),e[22].id===e[6].id?Q||(Q=vp(),Q.c(),Q.m(a,null)):Q&&(Q.d(1),Q=null),(!E||K&16)&&g!==(g=e[22].email+"")&&be(v,g),(!E||K&16&&b!==(b=e[22].email))&&h(p,"title",b);const ee={};K&16&&(ee.date=e[22].created),$.$set(ee);const ae={};K&16&&(ae.date=e[22].updated),D.$set(ae)},i(Y){E||(A(u.$$.fragment,Y),A($.$$.fragment,Y),A(D.$$.fragment,Y),E=!0)},o(Y){P(u.$$.fragment,Y),P($.$$.fragment,Y),P(D.$$.fragment,Y),E=!1},d(Y){Y&&k(t),V(u),Q&&Q.d(),V($),V(D),j=!1,lt(U)}}}function kp(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),r=R(o),h(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&be(s,i),u&16&&o!==(o=a[4].length+"")&&be(r,o)},d(a){a&&k(e)}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q,te,H,Y,K,Z,ee,ae=[],ve=new Map,le,me,re,de,fe,ie;e=new Os({}),r=new jo({}),r.$on("refresh",n[7]),p=new Ho({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),p.$on("submit",n[9]);function x(J){n[10](J)}let ye={class:"col-type-text",name:"id",$$slots:{default:[aT]},$$scope:{ctx:n}};n[2]!==void 0&&(ye.sort=n[2]),M=new xt({props:ye}),ge.push(()=>Ie(M,"sort",x));function He(J){n[11](J)}let Le={class:"col-type-email col-field-email",name:"email",$$slots:{default:[uT]},$$scope:{ctx:n}};n[2]!==void 0&&(Le.sort=n[2]),O=new xt({props:Le}),ge.push(()=>Ie(O,"sort",He));function Pe(J){n[12](J)}let ue={class:"col-type-date col-field-created",name:"created",$$slots:{default:[fT]},$$scope:{ctx:n}};n[2]!==void 0&&(ue.sort=n[2]),j=new xt({props:ue}),ge.push(()=>Ie(j,"sort",Pe));function ce(J){n[13](J)}let ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[cT]},$$scope:{ctx:n}};n[2]!==void 0&&(ke.sort=n[2]),te=new xt({props:ke}),ge.push(()=>Ie(te,"sort",ce));let Be=n[4];const Ke=J=>J[22].id;for(let J=0;J<Be.length;J+=1){let se=gp(n,Be,J),pe=Ke(se);ve.set(pe,ae[J]=yp(pe,se))}let Ue=null;Be.length||(Ue=_p(n));let Je=n[4].length&&kp(n),xe={};return re=new rT({props:xe}),n[17](re),re.$on("save",n[18]),re.
<div class="breadcrumb-item">Admins</div>`,o=T(),z(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,d=T(),z(p.$$.fragment),g=T(),v=_("div"),b=_("table"),y=_("thead"),S=_("tr"),$=_("th"),C=T(),z(M.$$.fragment),L=T(),z(O.$$.fragment),E=T(),z(j.$$.fragment),Q=T(),z(te.$$.fragment),Y=T(),K=_("th"),Z=T(),ee=_("tbody");for(let J=0;J<ae.length;J+=1)ae[J].c();Ue&&Ue.c(),le=T(),Je&&Je.c(),me=T(),z(re.$$.fragment),h(l,"class","breadcrumbs"),h(u,"class","flex-fill"),h(c,"type","button"),h(c,"class","btn btn-expanded"),h(s,"class","page-header"),h($,"class","min-width"),h(K,"class","col-type-action min-width"),h(b,"class","table"),X(b,"table-loading",n[5]),h(v,"class","table-wrapper"),h(i,"class","page-wrapper")},m(J,se){q(e,J,se),w(J,t,se),w(J,i,se),m(i,s),m(s,l),m(s,o),q(r,s,null),m(s,a),m(s,u),m(s,f),m(s,c),m(i,d),q(p,i,null),m(i,g),m(i,v),m(v,b),m(b,y),m(y,S),m(S,$),m(S,C),q(M,S,null),m(S,L),q(O,S,null),m(S,E),q(j,S,null),m(S,Q),q(te,S,null),m(S,Y),m(S,K),m(b,Z),m(b,ee);for(let pe=0;pe<ae.length;pe+=1)ae[pe].m(ee,null);Ue&&Ue.m(ee,null),m(i,le),Je&&Je.m(i,null),w(J,me,se),q(re,J,se),de=!0,fe||(ie=G(c,"click",n[8]),fe=!0)},p(J,[se]){const pe={};se&2&&(pe.value=J[1]),p.$set(pe);const Ve={};se&33554432&&(Ve.$$scope={dirty:se,ctx:J}),!D&&se&4&&(D=!0,Ve.sort=J[2],Re(()=>D=!1)),M.$set(Ve);const Ge={};se&33554432&&(Ge.$$scope={dirty:se,ctx:J}),!F&&se&4&&(F=!0,Ge.sort=J[2],Re(()=>F=!1)),O.$set(Ge);const bt={};se&33554432&&(bt.$$scope={dirty:se,ctx:J}),!U&&se&4&&(U=!0,bt.sort=J[2],Re(()=>U=!1)),j.$set(bt);const rt={};se&33554432&&(rt.$$scope={dirty:se,ctx:J}),!H&&se&4&&(H=!0,rt.sort=J[2],Re(()=>H=!1)),te.$set(rt),se&122&&(Be=J[4],Te(),ae=ft(ae,se,Ke,1,J,Be,ve,ee,Ft,yp,null,gp),De(),!Be.length&&Ue?Ue.p(J,se):Be.length?Ue&&(Ue.d(1),Ue=null):(Ue=_p(J),Ue.c(),Ue.m(ee,null))),se&32&&X(b,"table-loading",J[5]),J[4].length?Je?Je.p(J,se):(Je=kp(J),Je.c(),Je.m(i,null)):Je&&(Je.d(1),Je=null);const ut={};re.$set(ut)},i(J){if(!de){A(e.$$.fragment,J),A(r.$$.fragment,J),A(p.$$.fragment,J),A(M.$$.fragment,J),A(O.$$.fragment,J),A(j.$$.fragment,J),A(te.$$.fragment,J);for(let se=0;se<Be.length;se+=1)A(ae[se]);A(re.$$.fragment,J),de=!0}},o(J){P(e.$$.fragment,J),P(r.$$.fragment,J),P(p.$$.fragment,J),P(M.$$.fragment,J),P(O.$$.fragment,J),P(j.$$.fragment,J),P(te.$$.fragment,J);for(let se=0;se<ae.length;se+=1)P(ae[se]);P(re.$$.fragment,J),de=!1},d(J){V(e,J),J&&k(t),J&&k(i),V(r),V(p),V(M),V(O),V(j),V(te);for(let se=0;se<ae.length;se+=1)ae[se].d();Ue&&Ue.d(),Je&&Je.d(),J&&k(me),n[17](null),V(re,J),fe=!1,ie()}}}function mT(n,e,t){var F;let i;cn(n,ma,E=>t(6,i=E));const s=W.getQueryParams((F=window.location)==null?void 0:F.href);let l,o=[],r=!1,a=s.filter||"",u=s.sort||"-created";W.setDocumentTitle("Admins");function f(){return t(5,r=!0),t(4,o=[]),Se.Admins.getFullList(100,{sort:u||"-created",filter:a}).then(E=>{t(4,o=E),t(5,r=!1)}).catch(E=>{E!=null&&E.isAbort||(t(5,r=!1),console.warn(E),c(),Se.errorResponseHandler(E,!1))})}function c(){t(4,o=[])}const d=()=>f(),p=()=>l==null?void 0:l.show(),g=E=>t(1,a=E.detail);function v(E){u=E,t(2,u)}function b(E){u=E,t(2,u)}function y(E){u=E,t(2,u)}function S(E){u=E,t(2,u)}const $=E=>l==null?void 0:l.show(E),C=(E,j)=>{(j.code==="Enter"||j.code==="Space")&&(j.preventDefault(),l==null||l.show(E))},M=()=>t(1,a="");function D(E){ge[E?"unshift":"push"](()=>{l=E,t(3,l)})}const L=()=>f(),O=()=>f();return n.$$.update=()=>{n.$$.dirty&6&&u!==-1&&a!==-1&&(W.replaceClientQueryParams({filter:a,sort:u}),f())},[f,a,u,l,o,r,i,d,p,g,v,b,y,S,$,C,M,D,L,O]}class gT extends Ee{constructor(e){super(),Ae(this,e,mT,pT,Oe,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[7]),h(l,"type","email"),h(l,"id",o=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=G(l,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&h(e,"for",i),f&128&&o!==(o=u[7])&&h(l,"id",o),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function bT(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=R("Password"),s=T(),l=_("input"),r=T(),a=_("div"),u=
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),X(a,"btn-disabled",n[2]),X(a,"btn-loading",n[2]),h(e,"class","block")},m(d,p){w(d,e,p),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),m(e,a),u=!0,f||(c=G(e,"submit",Vt(n[3])),f=!0)},p(d,p){const g={};p&385&&(g.$$scope={dirty:p,ctx:d}),s.$set(g);const v={};p&386&&(v.$$scope={dirty:p,ctx:d}),o.$set(v),p&4&&X(a,"btn-disabled",d[2]),p&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&&k(e),V(s),V(o),f=!1,c()}}}function yT(n){let e,t;return e=new ag({props:{$$slots:{default:[vT]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(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){V(e,i)}}}function kT(n,e,t){var f;const i=W.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",o=!1;function r(){if(!o)return t(2,o=!0),Se.Admins.authViaEmail(s,l).then(()=>{$s("/")}).catch(()=>{ig("Invalid login credentials.")}).finally(()=>{t(2,o=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,o,r,a,u]}class wT extends Ee{constructor(e){super(),Ae(this,e,kT,yT,Oe,{})}}function ST(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S;return i=new Fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[CT,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[MT,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[TT,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),p=_("button"),g=_("span"),g.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(c,"class","flex-fill"),h(g,"class","txt"),h(p,"type","submit"),h(p,"class","btn btn-expanded"),p.disabled=v=!n[3]||n[2],X(p,"btn-loading",n[2]),h(f,"class","col-lg-12 flex"),h(e,"class","grid")},m($,C){w($,e,C),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,p),m(p,g),b=!0,y||(S=G(p,"click",n[9]),y=!0)},p($,C){const M={};C&12289&&(M.$$scope={dirty:C,ctx:$}),i.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const L={};C&12289&&(L.$$scope={dirty:C,ctx:$}),a.$set(L),(!b||C&12&&v!==(v=!$[3]||$[2]))&&(p.disabled=v),C&4&&X(p,"btn-loading",$[2])},i($){b||(A(i.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),b=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),b=!1},d($){$&&k(e),V(i),V(o),V(a),y=!1,S()}}}function $T(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function CT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application name"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","text"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appName),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Ce(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function MT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application url"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","text"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appUrl),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Ce(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Logs max days retention"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","num
<div class="breadcrumb-item">Application</div></nav>`,l=T(),o=_("div"),r=_("form"),u.c(),h(s,"class","page-header"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(b,y){q(e,b,y),w(b,t,y),w(b,i,y),m(i,s),m(i,l),m(i,o),m(o,r),g[a].m(r,null),f=!0,c||(d=G(r,"submit",Vt(n[4])),c=!0)},p(b,[y]){let S=a;a=v(b),a===S?g[a].p(b,y):(Te(),P(g[S],1,1,()=>{g[S]=null}),De(),u=g[a],u?u.p(b,y):(u=g[a]=p[a](b),u.c()),A(u,1),u.m(r,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){P(e.$$.fragment,b),P(u),f=!1},d(b){V(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function OT(n,e,t){let i,s={},l=!1,o=!1,r="";W.setDocumentTitle("Application settings"),a();async function a(){t(1,l=!0);try{const v=await Se.Settings.getAll()||{};f(v)}catch(v){Se.errorResponseHandler(v)}t(1,l=!1)}async function u(){if(!(o||!i)){t(2,o=!0);try{const v=await Se.Settings.update(W.filterRedactedProps(s));f(v),dn("Successfully saved application settings.")}catch(v){Se.errorResponseHandler(v)}t(2,o=!1)}}function f(v={}){t(0,s={meta:(v==null?void 0:v.meta)||{},logs:(v==null?void 0:v.logs)||{}}),t(5,r=JSON.stringify(s))}function c(){s.meta.appName=this.value,t(0,s)}function d(){s.meta.appUrl=this.value,t(0,s)}function p(){s.logs.maxDays=Dt(this.value),t(0,s)}const g=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=r!=JSON.stringify(s))},[s,l,o,i,u,r,c,d,p,g]}class AT extends Ee{constructor(e){super(),Ae(this,e,OT,DT,Oe,{})}}function ET(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ht(l,s[o]);return{c(){e=_("input"),ii(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Ce(e,n[0]),t||(i=G(e,"input",n[8]),t=!0)},p(o,r){ii(e,l=hn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Ce(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function PT(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=ht(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=T(),s=_("input"),h(t,"type","button"),h(t,"class","btn btn-secondary btn-circle"),h(e,"class","form-field-addon"),ii(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[tt(Mt.call(null,t,{position:"left",text:"Set new value"})),G(t,"click",n[6])],l=!0)},p(u,f){ii(s,a=hn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,lt(o)}}}function LT(n){let e;function t(l,o){return l[3]?PT:ET}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function FT(n,e,t){const i=["value","mask"];let s=Wt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await li(),r==null||r.focus()}const f=()=>u();function c(p){ge[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=ht(ht({},e),si(p)),t(5,s=Wt(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class za extends Ee{constructor(e){super(),Ae(this,e,FT,LT,Oe,{value:0,mask:1})}}function IT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q;i=new Fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[RT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[HT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[jT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),f=new Fe({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[qT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:
<br/>
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
below.</strong></p>`,y=T(),z(S.$$.fragment),$=T(),te&&te.c(),C=T(),M=_("div"),D=_("div"),L=T(),O=_("button"),F=_("span"),F.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid"),h(b,"class","content m-b-sm"),h(D,"class","flex-fill"),h(F,"class","txt"),h(O,"type","submit"),h(O,"class","btn btn-expanded"),O.disabled=E=!n[3]||n[2],X(O,"btn-loading",n[2]),h(M,"class","flex")},m(H,Y){w(H,e,Y),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),q(f,e,null),m(e,c),q(d,e,null),w(H,p,Y),w(H,g,Y),w(H,v,Y),w(H,b,Y),w(H,y,Y),q(S,H,Y),w(H,$,Y),te&&te.m(H,Y),w(H,C,Y),w(H,M,Y),m(M,D),m(M,L),m(M,O),m(O,F),j=!0,U||(Q=G(O,"click",n[18]),U=!0)},p(H,Y){const K={};Y&12582913&&(K.$$scope={dirty:Y,ctx:H}),i.$set(K);const Z={};Y&12582913&&(Z.$$scope={dirty:Y,ctx:H}),o.$set(Z);const ee={};Y&12582913&&(ee.$$scope={dirty:Y,ctx:H}),a.$set(ee);const ae={};Y&12582913&&(ae.$$scope={dirty:Y,ctx:H}),f.$set(ae);const ve={};Y&12582913&&(ve.$$scope={dirty:Y,ctx:H}),d.$set(ve);const le={};Y&12582913&&(le.$$scope={dirty:Y,ctx:H}),S.$set(le),H[0].smtp.enabled?te?(te.p(H,Y),Y&1&&A(te,1)):(te=wp(H),te.c(),A(te,1),te.m(C.parentNode,C)):te&&(Te(),P(te,1,1,()=>{te=null}),De()),(!j||Y&12&&E!==(E=!H[3]||H[2]))&&(O.disabled=E),Y&4&&X(O,"btn-loading",H[2])},i(H){j||(A(i.$$.fragment,H),A(o.$$.fragment,H),A(a.$$.fragment,H),A(f.$$.fragment,H),A(d.$$.fragment,H),A(S.$$.fragment,H),A(te),j=!0)},o(H){P(i.$$.fragment,H),P(o.$$.fragment,H),P(a.$$.fragment,H),P(f.$$.fragment,H),P(d.$$.fragment,H),P(S.$$.fragment,H),P(te),j=!1},d(H){H&&k(e),V(i),V(o),V(a),V(f),V(d),H&&k(p),H&&k(g),H&&k(v),H&&k(b),H&&k(y),V(S,H),H&&k($),te&&te.d(H),H&&k(C),H&&k(M),U=!1,Q()}}}function NT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function RT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender name"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderName),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Ce(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function HT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender address"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","email"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderAddress),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Ce(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User verification page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userVerificationUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[9]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userVerificationUrl&&Ce(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function qT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User reset password page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userResetPasswordUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[10]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&Ce(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function VT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User confirm email change page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userConfirmEmailChangeUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&Ce(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function zT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Use SMTP mail server"),h(e,"type","checkbox"),h(e,"id",t=n[22]),e.required=!0,h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[12]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function wp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$;return i=new Fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[BT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[UT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[WT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[YT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),v=new Fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[KT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),$=!0},p(C,M){const D={};M&12582913&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const L={};M&12582913&&(L.$$scope={dirty:M,ctx:C}),o.$set(L);const O={};M&12582913&&(O.$$scope={dirty:M,ctx:C}),u.$set(O);const F={};M&12582913&&(F.$$scope={dirty:M,ctx:C}),d.$set(F);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:C}),v.$set(E)},i(C){$||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(v.$$.fragment,C),C&&Tt(()=>{S||(S=at(e,Xt,{duration:150},!0)),S.run(1)}),$=!0)},o(C){P(i.$$.fragment,C),P(o.$$.fragment,C),P(u.$$.fragment,C),P(d.$$.fragment,C),P(v.$$.fragment,C),C&&(S||(S=at(e,Xt,{duration:150},!1)),S.run(0)),$=!1},d(C){C&&k(e),V(i),V(o),V(u),V(d),V(v),C&&S&&S.end()}}}function BT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("SMTP server host"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.host),r||(a=G(l,"input",n[13]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Ce(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Port"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","number"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.port),r||(a=G(l,"input",n[14]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].smtp.port&&Ce(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function WT(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new ls({props:u}),ge.push(()=>Ie(
<div class="breadcrumb-item">Mail settings</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content txt-xl m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[19])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function JT(n,e,t){let i;const s=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let l={},o=!1,r=!1,a="";W.setDocumentTitle("Mail settings"),u();async function u(){t(1,o=!0);try{const F=await Se.Settings.getAll()||{};c(F)}catch(F){Se.errorResponseHandler(F)}t(1,o=!1)}async function f(){if(!(r||!i)){t(2,r=!0);try{const F=await Se.Settings.update(W.filterRedactedProps(l));c(F),dn("Successfully saved mail settings.")}catch(F){Se.errorResponseHandler(F)}t(2,r=!1)}}function c(F={}){t(0,l={meta:(F==null?void 0:F.meta)||{},smtp:(F==null?void 0:F.smtp)||{}}),t(6,a=JSON.stringify(l))}function d(){l.meta.senderName=this.value,t(0,l)}function p(){l.meta.senderAddress=this.value,t(0,l)}function g(){l.meta.userVerificationUrl=this.value,t(0,l)}function v(){l.meta.userResetPasswordUrl=this.value,t(0,l)}function b(){l.meta.userConfirmEmailChangeUrl=this.value,t(0,l)}function y(){l.smtp.enabled=this.checked,t(0,l)}function S(){l.smtp.host=this.value,t(0,l)}function $(){l.smtp.port=Dt(this.value),t(0,l)}function C(F){n.$$.not_equal(l.smtp.tls,F)&&(l.smtp.tls=F,t(0,l))}function M(){l.smtp.username=this.value,t(0,l)}function D(F){n.$$.not_equal(l.smtp.password,F)&&(l.smtp.password=F,t(0,l))}const L=()=>f(),O=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,o,r,i,s,f,a,d,p,g,v,b,y,S,$,C,M,D,L,O]}class GT extends Ee{constructor(e){super(),Ae(this,e,JT,ZT,Oe,{})}}function XT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[xT,({uniqueId:b})=>({17:b}),({uniqueId:b})=>b?131072:0]},$$scope:{ctx:n}}});let g=n[3]!=n[0].enabled&&Sp(n),v=n[0].enabled&&$p(n);return{c(){z(e.$$.fragment),t=T(),g&&g.c(),i=T(),v&&v.c(),s=T(),l=_("div"),o=_("div"),r=T(),a=_("button"),u=_("span"),u.textContent="Save changes",h(o,"class","flex-fill"),h(u,"class","txt"),h(a,"type","submit"),h(a,"class","btn btn-expanded"),a.disabled=f=!n[4]||n[2],X(a,"btn-loading",n[2]),h(l,"class","flex")},m(b,y){q(e,b,y),w(b,t,y),g&&g.m(b,y),w(b,i,y),v&&v.m(b,y),w(b,s,y),w(b,l,y),m(l,o),m(l,r),m(l,a),m(a,u),c=!0,d||(p=G(a,"click",n[13]),d=!0)},p(b,y){const S={};y&393217&&(S.$$scope={dirty:y,ctx:b}),e.$set(S),b[3]!=b[0].enabled?g?(g.p(b,y),y&9&&A(g,1)):(g=Sp(b),g.c(),A(g,1),g.m(i.parentNode,i)):g&&(Te(),P(g,1,1,()=>{g=null}),De()),b[0].enabled?v?(v.p(b,y),y&1&&A(v,1)):(v=$p(b),v.c(),A(v,1),v.m(s.parentNode,s)):v&&(Te(),P(v,1,1,()=>{v=null}),De()),(!c||y&20&&f!==(f=!b[4]||b[2]))&&(a.disabled=f),y&4&&X(a,"btn-loading",b[2])},i(b){c||(A(e.$$.fragment,b),A(g),A(v),c=!0)},o(b){P(e.$$.fragment,b),P(g),P(v),c=!1},d(b){V(e,b),b&&k(t),g&&g.d(b),b&&k(i),v&&v.d(b),b&&k(s),b&&k(l),d=!1,p()}}}function QT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function xT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Use S3 storage"),h(e,"type","checkbox"),h(e,"id",t=n[17]),e.required=!0,h(s,"for",o=n[17])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[7]),r=!0)},p(u,f){f&131072&&t!==(t=u[17])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&131072&&o!==(o=u[17])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Sp(n){let e,t,i,s,l,o,r,a=n[3]?"S3 storage":"local file system",u,f,c,d=n[0].enabled?"S3 storage":"local file system",p,g,v,b,y,S,$,C,M,D
the
`),r=_("strong"),u=R(a),f=R(`
to the
`),c=_("strong"),p=R(d),g=R(`.
`),v=_("br"),b=R(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,S=R(`,
`),$=_("a"),$.textContent=`s5cmd
`,C=R(", etc."),M=T(),D=_("div"),h(i,"class","icon"),h(y,"href","https://github.com/rclone/rclone"),h(y,"target","_blank"),h(y,"rel","noopener"),h(y,"class","txt-bold"),h($,"href","https://github.com/peak/s5cmd"),h($,"target","_blank"),h($,"rel","noopener"),h($,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(D,"class","clearfix m-t-base")},m(F,E){w(F,e,E),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,p),m(l,g),m(l,v),m(l,b),m(l,y),m(l,S),m(l,$),m(l,C),m(e,M),m(e,D),O=!0},p(F,E){(!O||E&8)&&a!==(a=F[3]?"S3 storage":"local file system")&&be(u,a),(!O||E&1)&&d!==(d=F[0].enabled?"S3 storage":"local file system")&&be(p,d)},i(F){O||(F&&Tt(()=>{L||(L=at(e,Xt,{duration:150},!0)),L.run(1)}),O=!0)},o(F){F&&(L||(L=at(e,Xt,{duration:150},!1)),L.run(0)),O=!1},d(F){F&&k(e),F&&L&&L.end()}}}function $p(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$;return i=new Fe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[eD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[tD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[nD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[iD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),v=new Fe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[sD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-12"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),$=!0},p(C,M){const D={};M&393217&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const L={};M&393217&&(L.$$scope={dirty:M,ctx:C}),o.$set(L);const O={};M&393217&&(O.$$scope={dirty:M,ctx:C}),u.$set(O);const F={};M&393217&&(F.$$scope={dirty:M,ctx:C}),d.$set(F);const E={};M&393217&&(E.$$scope={dirty:M,ctx:C}),v.$set(E)},i(C){$||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(v.$$.fragment,C),C&&Tt(()=>{S||(S=at(e,Xt,{duration:150},!0)),S.run(1)}),$=!0)},o(C){P(i.$$.fragment,C),P(o.$$.fragment,C),P(u.$$.fragment,C),P(d.$$.fragment,C),P(v.$$.fragment,C),C&&(S||(S=at(e,Xt,{duration:150},!1)),S.run(0)),$=!1},d(C){C&&k(e),V(i),V(o),V(u),V(d),V(v),C&&S&&S.end()}}}function eD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Endpoint"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].endpoint),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].endpoint&&Ce(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function tD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Bucket"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].bucket),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].bucket&&Ce(l,u[0].bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Region"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].region),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17
<div class="breadcrumb-item">Files storage</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content txt-xl m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[14])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function oD(n,e,t){let i,s={},l=!1,o=!1,r="",a=!1;W.setDocumentTitle("Files storage"),u();async function u(){t(1,l=!0);try{const C=await Se.Settings.getAll()||{};c(C)}catch(C){Se.errorResponseHandler(C)}t(1,l=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const C=await Se.Settings.update(W.filterRedactedProps({s3:s}));c(C),Li({}),dn("Successfully saved Files storage settings.")}catch(C){Se.errorResponseHandler(C)}t(2,o=!1)}}function c(C={}){t(0,s=(C==null?void 0:C.s3)||{}),t(3,a=s.enabled),t(6,r=JSON.stringify(s))}function d(){s.enabled=this.checked,t(0,s)}function p(){s.endpoint=this.value,t(0,s)}function g(){s.bucket=this.value,t(0,s)}function v(){s.region=this.value,t(0,s)}function b(){s.accessKey=this.value,t(0,s)}function y(C){n.$$.not_equal(s.secret,C)&&(s.secret=C,t(0,s))}const S=()=>f(),$=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=r!=JSON.stringify(s))},[s,l,o,a,i,f,r,d,p,g,v,b,y,S,$]}class rD extends Ee{constructor(e){super(),Ae(this,e,oD,lD,Oe,{})}}function aD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[16]),h(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Cp(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Fe({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[uD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field "+(W.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[fD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field "+(W.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[cD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-12 m-t-sm"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(e,"class","grid")},m(d,p){w(d,e,p),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),c=!0},p(d,p){const g={};p&196609&&(g.$$scope={dirty:p,ctx:d}),i.$set(g);const v={};p&1&&(v.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),p&196609&&(v.$$scope={dirty:p,ctx:d}),o.$set(v);const b={};p&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),p&196609&&(b.$$scope={dirty:p,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=at(e,Xt,{duration:150},!0)),f.run(1)}),c=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),d&&(f||(f=at(e,Xt,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),V(i),V(o),V(u),d&&f&&f.end()}}}function uD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Minimum password length"),s=T(),l=_("input"),h(e,"for",i=n[16]),h(l,"type","number"),h(l,"id",o=n[16]),l.required=!0,h(l,"min","5"),h(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].minPasswordLength),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&65536&&i!==(i=u[16])&&h(e,"for",i),f&65536&&o!==(o=u[16])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].minPasswordLength&&Ce(l,u[0].m
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&h(e,"for",l);const S={};y&65536&&(S.id=b[16]),y&1&&(S.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].exceptDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function cD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]+".config.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&h(e,"for",l);const S={};y&65536&&(S.id=b[16]+".config.onlyDomains"),y&1&&(S.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].onlyDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function dD(n){let e,t,i,s;e=new Fe({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[aD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Cp(n);return{c(){z(e.$$.fragment),t=T(),l&&l.c(),i=ot()},m(o,r){q(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Cp(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Te(),P(l,1,1,()=>{l=null}),De())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function hD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pD(n){let e;return{c(){e=_("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mp(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=tt(Mt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=at(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=at(e,qn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function mD(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].enabled?pD:hD}let u=a(n),f=u(n),c=n[2]&&Mp();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=T(),f.c(),i=T(),s=_("div"),l=T(),c&&c.c(),o=ot(),h(e,"class","inline-flex"),h(s,"class","flex-fill")},m(d,p){w(d,e,p),w(d,t,p),f.m(d,p),w(d,i,p),w(d,s,p),w(d,l,p),c&&c.m(d,p),w(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?p&4&&A(c,1):(c=Mp(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Te(),P(c,1,1,()=>{c=null}),De())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function gD(n){let e,t;const i=[n[3]];let s={$$slots:{header:[mD],default:[dD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ht(s,i[l]);return e=new ja({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){z(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&8?hn(i,[oi(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function _D(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Wt(e,s),o;cn(n,ns,C=>t(7,o=C));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function p(){r.minPasswordLength=Dt(this.value),t(0,r)}function g(C){n.$$.not_equal(r.exceptDomains,C)&&(r.exceptDomains=C,t(0,r))}function v(C){n.$$.not_equal(r.onlyDomains,C)&&(r.onlyDomains=C,t(0,r))}function b(C){ge[C?"unshift":"push"](()=>{a=C,t(1,a)})}function y(C){dt.call(this,n,C)}function S(C){dt.call(this,n,C)}function $(C){dt.call(this,n,C)}return n.$$set=C=>{e=ht(ht({},e),si(C)),t(3,l=Wt(e,s)),"config"in C&&t(0,r=C.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(o==null?void 0:o.emailPassword))},[r,a,i,l,u,f,c,o,d,p,g,v,b,y,S,$]}class bD extends Ee{constructor(e){super(),Ae(this,e,_D,gD,Oe,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function vD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[22]),h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Tp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;l=new Fe({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[yD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[kD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Fe({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[wD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Dp(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),z(l.$$.fragment),o=T(),r=_("div"),z(a.$$.fragment),u=T(),f=_("div"),z(c.$$.fragment),d=T(),v&&v.c(),h(t,"class","col-12 spacing"),h(s,"class","col-lg-6"),h(r,"class","col-lg-6"),h(f,"class","col-lg-12"),h(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),q(l,s,null),m(e,o),m(e,r),q(a,r,null),m(e,u),m(e,f),q(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const S={};y&2&&(S.name=b[1]+".clientId"),y&12582913&&(S.$$scope={dirty:y,ctx:b}),l.$set(S);const $={};y&2&&($.name=b[1]+".clientSecret"),y&12582913&&($.$$scope={dirty:y,ctx:b}),a.$set($);const C={};y&2&&(C.name=b[1]+".allowRegistrations"),y&12582913&&(C.$$scope={dirty:y,ctx:b}),c.$set(C),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=Dp(b),v.c(),A(v,1),v.m(e,null)):v&&(Te(),P(v,1,1,()=>{v=null}),De())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{p||(p=at(e,Xt,{duration:200},!0)),p.run(1)}),g=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(p||(p=at(e,Xt,{duration:200},!1)),p.run(0)),g=!1},d(
<div class="breadcrumb-item">Auth providers</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[5])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function ID(n,e,t){let i,s,l={},o=!1,r=!1,a="";W.setDocumentTitle("Auth providers"),u();async function u(){t(2,o=!0);try{const $=await Se.Settings.getAll()||{};c($)}catch($){Se.errorResponseHandler($)}t(2,o=!1)}async function f(){if(!(r||!i)){t(3,r=!0);try{const $=await Se.Settings.update(W.filterRedactedProps(l));c($),Li({}),s==null||s.collapseSiblings(),dn("Successfully updated auth providers.")}catch($){Se.errorResponseHandler($)}t(3,r=!1)}}function c($){$=$||{},t(0,l={}),t(0,l.emailAuth=Object.assign({enabled:!0},$.emailAuth),l);const C=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of C)t(0,l[M]=Object.assign({enabled:!1,allowRegistrations:!0},$[M]),l);t(6,a=JSON.stringify(l))}function d($){ge[$?"unshift":"push"](()=>{s=$,t(1,s)})}function p($){n.$$.not_equal(l.emailAuth,$)&&(l.emailAuth=$,t(0,l))}function g($){n.$$.not_equal(l.googleAuth,$)&&(l.googleAuth=$,t(0,l))}function v($){n.$$.not_equal(l.facebookAuth,$)&&(l.facebookAuth=$,t(0,l))}function b($){n.$$.not_equal(l.githubAuth,$)&&(l.githubAuth=$,t(0,l))}function y($){n.$$.not_equal(l.gitlabAuth,$)&&(l.gitlabAuth=$,t(0,l))}const S=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(l))},[l,s,o,r,i,f,a,d,p,g,v,b,y,S]}class ND extends Ee{constructor(e){super(),Ae(this,e,ID,FD,Oe,{})}}function Ep(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function RD(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,p=n[4];const g=v=>v[12].key;for(let v=0;v<p.length;v+=1){let b=Ep(n,p,v),y=g(b);t.set(y,e[v]=Pp(y,b))}return{c(){for(let v=0;v<e.length;v+=1)e[v].c();i=T(),s=_("div"),l=_("div"),o=T(),r=_("button"),a=_("span"),a.textContent="Save changes",h(l,"class","flex-fill"),h(a,"class","txt"),h(r,"type","submit"),h(r,"class","btn btn-expanded"),r.disabled=u=!n[3]||n[2],X(r,"btn-loading",n[2]),h(s,"class","flex")},m(v,b){for(let y=0;y<e.length;y+=1)e[y].m(v,b);w(v,i,b),w(v,s,b),m(s,l),m(s,o),m(s,r),m(r,a),f=!0,c||(d=G(r,"click",n[9]),c=!0)},p(v,b){b&32785&&(p=v[4],Te(),e=ft(e,b,g,1,v,p,t,i.parentNode,Ft,Pp,i,Ep),De()),(!f||b&12&&u!==(u=!v[3]||v[2]))&&(r.disabled=u),b&4&&X(r,"btn-loading",v[2])},i(v){if(!f){for(let b=0;b<p.length;b+=1)A(e[b]);f=!0}},o(v){for(let b=0;b<e.length;b+=1)P(e[b]);f=!1},d(v){for(let b=0;b<e.length;b+=1)e[b].d(v);v&&k(i),v&&k(s),c=!1,d()}}}function HD(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function jD(n){let e,t=n[12].label+"",i,s,l,o,r,a,u,f,c,d,p;function g(){n[7].call(r,n[12])}function v(){return n[8](n[12])}return{c(){e=_("label"),i=R(t),s=R(" duration (in seconds)"),o=T(),r=_("input"),u=T(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",h(e,"for",l=n[15]),h(r,"type","number"),h(r,"id",a=n[15]),r.required=!0,h(c,"class","link-primary"),X(c,"txt-success",n[0][n[12].key].secret),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,i),m(e,s),w(b,o,y),w(b,r,y),Ce(r,n[0][n[12].key].duration),w(b,u,y),w(b,f,y),m(f,c),d||(p=[G(r,"input",g),G(c,"click",v)],d=!0)},p(b,y){n=b,y&32768&&l!==(l=n[15])&&h(e,"for",l),y&32768&&a!==(a=n[15])&&h(r,"id",a),y&17&&Dt(r.value)!==n[0][n[12].key].duration&&Ce(r,n[0][n[12].key].duration),y&17&&X(c,"txt-success",n[0][n[12].key].secret)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(u),b&&k(f),d=!1,lt(p)}}}function Pp(n,e){let t,i,s;return i=new Fe({props:{class:"form-field required",nam
<div class="breadcrumb-item">Token options</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML="<p>Adjust common token options.</p>",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content m-b-sm txt-xl"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[5])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function VD(n,e,t){let i;const s=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];let l={},o=!1,r=!1,a="";W.setDocumentTitle("Token options"),u();async function u(){t(1,o=!0);try{const v=await Se.Settings.getAll()||{};c(v)}catch(v){Se.errorResponseHandler(v)}t(1,o=!1)}async function f(){if(!(r||!i)){t(2,r=!0);try{const v=await Se.Settings.update(W.filterRedactedProps(l));c(v),dn("Successfully saved tokens options.")}catch(v){Se.errorResponseHandler(v)}t(2,r=!1)}}function c(v){var b;v=v||{},t(0,l={});for(const y of s)t(0,l[y.key]={duration:((b=v[y.key])==null?void 0:b.duration)||0},l);t(6,a=JSON.stringify(l))}function d(v){l[v.key].duration=Dt(this.value),t(0,l)}const p=v=>{l[v.key].secret?(delete l[v.key].secret,t(0,l)):t(0,l[v.key].secret=W.randomString(50),l)},g=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,o,r,i,s,f,a,d,p,g]}class zD extends Ee{constructor(e){super(),Ae(this,e,VD,qD,Oe,{})}}const un=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?$s("/"):!0}],BD={"/login":tn({component:wT,conditions:un.concat([n=>!Se.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":tn({asyncComponent:()=>Ki(()=>import("./PageAdminRequestPasswordReset.1ed2f260.js"),[]),conditions:un.concat([n=>!Se.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":tn({asyncComponent:()=>Ki(()=>import("./PageAdminConfirmPasswordReset.6fd392db.js"),[]),conditions:un.concat([n=>!Se.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":tn({component:$M,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":tn({component:Fw,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users":tn({component:ZM,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmPasswordReset.3d4f00c0.js"),[]),conditions:un.concat([()=>(Se.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmVerification.0b9a252c.js"),[]),conditions:un.concat([()=>(Se.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmEmailChange.70884449.js"),[]),conditions:un.concat([()=>(Se.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/settings":tn({component:AT,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":tn({component:gT,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":tn({component:GT,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":tn({component:rD,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":tn({component:ND,conditions:un.concat([n=>Se.AuthStore.isValid]),userDat
<span class="txt">Manage admins</span>`,t=T(),i=_("hr"),s=T(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"tabindex","0"),h(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[tt(wn.call(null,e)),G(l,"click",n[4])],o=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,lt(r)}}}function iO(n){var c;let e,t,i,s,l,o,r,a,u,f=((c=n[1])==null?void 0:c.id)&&n[0]&&Ip(n);return s=new I_({props:{routes:BD}}),s.$on("routeLoading",n[2]),s.$on("conditionsFailed",n[3]),o=new GD({}),a=new tO({}),{c(){e=_("div"),f&&f.c(),t=T(),i=_("div"),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment),h(i,"class","app-body"),h(e,"class","app-layout")},m(d,p){w(d,e,p),f&&f.m(e,null),m(e,t),m(e,i),q(s,i,null),w(d,l,p),q(o,d,p),w(d,r,p),q(a,d,p),u=!0},p(d,[p]){var g;((g=d[1])==null?void 0:g.id)&&d[0]?f?(f.p(d,p),p&3&&A(f,1)):(f=Ip(d),f.c(),A(f,1),f.m(e,t)):f&&(Te(),P(f,1,1,()=>{f=null}),De())},i(d){u||(A(f),A(s.$$.fragment,d),A(o.$$.fragment,d),A(a.$$.fragment,d),u=!0)},o(d){P(f),P(s.$$.fragment,d),P(o.$$.fragment,d),P(a.$$.fragment,d),u=!1},d(d){d&&k(e),f&&f.d(),V(s),d&&k(l),V(o,d),d&&k(r),V(a,d)}}}function sO(n,e,t){let i;cn(n,ma,u=>t(1,i=u));let s,l=!1;function o(u){var f,c,d,p;((f=u==null?void 0:u.detail)==null?void 0:f.location)!==s&&(t(0,l=!!((d=(c=u==null?void 0:u.detail)==null?void 0:c.userData)!=null&&d.showAppSidebar)),s=(p=u==null?void 0:u.detail)==null?void 0:p.location,W.setDocumentTitle(""),Li({}),r_())}function r(){$s("/")}function a(){Se.logout()}return[l,i,o,r,a]}class lO extends Ee{constructor(e){super(),Ae(this,e,sO,iO,Oe,{})}}new lO({target:document.getElementById("app")});export{lt as A,dn as B,W as C,$s as D,ot as E,ag as F,cn as G,Ss as H,rn as I,On as J,Un as K,ge as L,Ee as S,P as a,T as b,z as c,V as d,_ as e,h as f,w as g,m as h,Ae as i,tt as j,Te as k,wn as l,q as m,De as n,k as o,Se as p,Fe as q,X as r,Oe as s,A as t,G as u,Vt as v,R as w,be as x,oe as y,Ce as z};