pocketbase/ui/dist/assets/index-e3487feb.js

204 lines
925 KiB
JavaScript
Raw Normal View History

2023-04-13 20:38:12 +08:00
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function Q(){}const Sl=n=>n;function qe(n,e){for(const t in e)n[t]=e[t];return n}function yb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function L_(n){return n()}function cu(){return Object.create(null)}function Ae(n){n.forEach(L_)}function zt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function Cn(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function kb(n){return Object.keys(n).length===0}function N_(n,...e){if(n==null)return Q;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ke(n,e,t){n.$$.on_destroy.push(N_(e,t))}function Ct(n,e,t,i){if(n){const s=F_(n,e,t,i);return n[0](s)}}function F_(n,e,t,i){return n[1]&&i?qe(t.ctx.slice(),n[1](i(e))):t.ctx}function Mt(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 Ot(n,e,t,i,s,l){if(s){const o=F_(e,t,i,l);n.p(o,s)}}function Et(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 Ut(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ge(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 Oi(n){return n??""}function tn(n,e,t){return n.set(t),e}function Ee(n){return n&&zt(n.destroy)?n.destroy:Q}function du(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const R_=typeof window<"u";let Ro=R_?()=>window.performance.now():()=>Date.now(),_a=R_?n=>requestAnimationFrame(n):Q;const vs=new Set;function q_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&_a(q_)}function qo(n){let e;return vs.size===0&&_a(q_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function v(n,e){n.appendChild(e)}function j_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function wb(n){const e=y("style");return Sb(j_(n),e),e.sheet}function Sb(n,e){return v(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function y(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function D(){return U(" ")}function Se(){return U("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function pt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Mn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ti(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 $b(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function gt(n){return n===""?null:+n}function Tb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function ue(n,e){n.value
`;for(let b=0;b<=1;b+=a){const k=e+(t-e)*l(b);u+=b*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
2023-04-13 20:38:12 +08:00
}`,d=`__svelte_${Cb(f)}_${r}`,p=j_(n),{stylesheet:m,rules:_}=ho.get(p)||Mb(p,n);_[d]||(_[d]=!0,m.insertRule(`@keyframes ${d} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${d} ${i}ms linear ${s}ms 1 both`,_o+=1,d}function cl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),_o-=s,_o||Ob())}function Ob(){_a(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),ho.clear())})}function Eb(n,e,t,i){if(!e)return Q;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return Q;const{delay:l=0,duration:o=300,easing:r=Sl,start:a=Ro()+l,end:u=a+o,tick:f=Q,css:d}=t(n,{from:e,to:s},i);let p=!0,m=!1,_;function g(){d&&(_=fl(n,0,1,o,l,r,d)),l||(m=!0)}function b(){d&&cl(n,_),p=!1}return qo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),b()),!p)return!1;if(m){const $=k-a,T=0+1*r($/o);f(T,1-T)}return!0}),g(),f(0,1),b}function Db(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,H_(n,s)}}function H_(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 dl;function fi(n){dl=n}function $l(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Xt(n){$l().$$.on_mount.push(n)}function Ab(n){$l().$$.after_update.push(n)}function z_(n){$l().$$.on_destroy.push(n)}function wt(){const n=$l();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=V_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bs=[],se=[];let ys=[];const jr=[],B_=Promise.resolve();let Vr=!1;function U_(){Vr||(Vr=!0,B_.then(ga))}function un(){return U_(),B_}function tt(n){ys.push(n)}function ye(n){jr.push(n)}const ir=new Set;let ds=0;function ga(){if(ds!==0)return;const n=dl;do{try{for(;ds<bs.length;){const e=bs[ds];ds++,fi(e),Ib(e.$$)}}catch(e){throw bs.length=0,ds=0,e}for(fi(null),bs.length=0,ds=0;se.length;)se.pop()();for(let e=0;e<ys.length;e+=1){const t=ys[e];ir.has(t)||(ir.add(t),t())}ys.length=0}while(bs.length);for(;jr.length;)jr.pop()();Vr=!1,ir.clear(),fi(n)}function Ib(n){if(n.fragment!==null){n.update(),Ae(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}function Pb(n){const e=[],t=[];ys.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let js;function ba(){return js||(js=Promise.resolve(),js.then(()=>{js=null})),js}function Xi(n,e,t){n.dispatchEvent(V_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Qn;function re(){Qn={r:0,c:[],p:Qn}}function ae(){Qn.r||Ae(Qn.c),Qn=Qn.p}function I(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Qn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const va={duration:0};function Lb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&cl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=Sl,tick:g=Q,css:b}=s||va;b&&(o=fl(n,0,1,m,p,_,b,a++)),g(0,1);const k=Ro()+p,$=k+m;r&&r.abort(),l=!0,tt(()=>Xi(n,!0,"start")),r=qo(T=>{if(l){if(T>=$)return g(1,0),Xi(n,!0,"end"),u(),l=!1;if(T>=k){const C=_((T-k)/m);g(C,1-C)}}return l})}let d=!1;return{start(){d||(d=!0,cl(n),zt(s)?(s=s(i),ba().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Nb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Qn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=Sl,tick:p=Q,css:m}=s||va;m&&(o=fl(n,1,0,f,u,d,m));const _=Ro()+u,g=_+f;tt(()=>Xi(n,!1,"start")),qo(b=>{if(l){if(b>=g)return p(0,1),Xi(n,!1,"end"),--r.r||Ae(r.c),!1;if(b>=_){con
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+c.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
2023-04-13 20:38:12 +08:00
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=z.parseIndex(e);return i.tableName=t,z.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=z.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?z.buildIndex(s):e}}const Uo=On([]);function Qg(n,e=4e3){return Wo(n,"info",e)}function Yt(n,e=3e3){return Wo(n,"success",e)}function ml(n,e=4500){return Wo(n,"error",e)}function uy(n,e=4500){return Wo(n,"warning",e)}function Wo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{xg(i)},t)};Uo.update(s=>(Aa(s,i.message),z.pushOrReplaceByKey(s,i,"message"),s))}function xg(n){Uo.update(e=>(Aa(e,n),e))}function Da(){Uo.update(n=>{for(let e of n)Aa(n,e);return[]})}function Aa(n,e){let t;typeof e=="string"?t=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}const _i=On({});function fn(n){_i.set(n||{})}function Ei(n){_i.update(e=>(z.deleteByPath(e,n),e))}const Ia=On({});function Xr(n){Ia.set(n||{})}const dr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ii("/login")};Vo.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&ml(l)}if(z.isEmpty(s.data)||fn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ii("/")};Vo.prototype.getAdminFileToken=async function(){let n=localStorage.getItem(dr)||"";return(!n||Q_(n,15))&&(n&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),n=await this._adminFileTokenRequest,localStorage.setItem(dr,n),this._adminFileTokenRequest=null),n};class fy extends x_{save(e,t){super.save(e,t),t instanceof ts&&Xr(t)}clear(){super.clear(),Xr(null)}}const he=new Vo("../",new fy("pb_admin_auth"));he.authStore.model instanceof ts&&Xr(he.authStore.model);function cy(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=Ct(m,n,n[2],null);return{c(){e=y("div"),t=y("main"),_&&_.c(),i=D(),s=y("footer"),l=y("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=D(),r=y("span"),r.textContent="|",a=D(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.15.0-WIP",h(t,"class","page-content"),h(l,"href","https://pocketbase.io/docs/"),h(l,"target","_blank"),h(l,"rel","noopener noreferrer"),h(r,"class","delimiter"),h(f,"class","txt"),h(u,"href","https://github.com/pocketbase/pocketbase/releases"),h(u,"target","_blank"),h(u,"rel","noopener noreferrer"),h(u,"title","Releases"),h(s,"class","page-footer"),h(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(g,b){S(g,e,b),v(e,t),_&&_.m(t,null),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(u,f),p=!0},p(g,[b]){_&&_.p&&(!p||b&4)&&Ot(_,m,g,g[2],p?Mt(m,g[2],b,null):Et(g[2]),null),(!p||b&2&&d!==(d="page-wrapper "+g[1]))&&h(e,"class",d),(!p||b&3)&&x(e,"center-content",g[0])},i(g){p||(I(_,g),p=!0)},o(g){P(_,g),p=!1},d(g){g&&w(e),_&&_.d(g)}}}function dy(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class En extends ve{constructor(e){super(),be(this,e,dy,cy,_e,{center:0,class:1})}}function Wu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=y("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function py(n){let e,t,i,s=!n[0]&&Wu();const l=n[1].default,o=Ct(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=D(),o&&o.c(),h(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Wu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Ot(o,l,r,r[2],i?Mt(l,r[2],a,null):Et(r[2]),null)},i(r){i||(I(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function my(n){let e,t;return e=new En({props:{class:"full-page",center:!0,$$slots:{default:[py]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function hy(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class e1 extends ve{constructor(e){super(),be(this,e,hy,my,_e,{nobranding:0})}}function Yo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ni(n,{delay:e=0,duration:t=400,easing:i=Yo,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),[d,p]=du(s),[m,_]=du(l);return{delay:e,duration:t,easing:i,css:(g,b)=>`
transform: ${u} translate(${(1-g)*d}${p}, ${(1-g)*m}${_});
2023-04-13 20:38:12 +08:00
opacity: ${a-f*b}`}}function St(n,{delay:e=0,duration:t=400,easing:i=Yo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${f[0]}`]),p=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),b=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*d}px;padding-${u[1]}: ${k*p}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*_}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*b}px;`}}function Ht(n,{delay:e=0,duration:t=400,easing:i=Yo,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:(d,p)=>`
transform: ${a} scale(${1-u*p});
opacity: ${r-f*p}
2023-04-13 20:38:12 +08:00
`}}let Qr,zi;const xr="app-tooltip";function Yu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ci(){return zi=zi||document.querySelector("."+xr),zi||(zi=document.createElement("div"),zi.classList.add(xr),document.body.appendChild(zi)),zi}function t1(n,e){let t=Ci();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ea(){clearTimeout(Qr),Ci().classList.remove("active"),Ci().activeNode=void 0}function _y(n,e){Ci().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Ci().classList.add("active"),t1(n,e)},isNaN(e.delay)?0:e.delay)}function Ue(n,e){let t=Yu(e);function i(){_y(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&z.isFocusable(n))&&n.addEventListener("click",s),Ci(),{update(l){var o,r;t=Yu(l),(r=(o=Ci())==null?void 0:o.activeNode)!=null&&r.contains(n)&&t1(n,t)},destroy(){var l,o;(o=(l=Ci())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Ku(n,e,t){const i=n.slice();return i[12]=e[t],i}const gy=n=>({}),Ju=n=>({uniqueId:n[4]});function by(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=Zu(Ku(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=Ku(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=Zu(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){dt(s,o),o&&w(e)}}}function vy(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-error-warning-fill txt-danger"),h(e,"class","form-field-addon")},m(a,u){S(a,e,u),v(e,t),l=!0,o||(r=Ee(i=Ue.call(null,t,{position:"left",text:n[3].map(ko).join(`
`)})),o=!0)},p(a,u){i&&zt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(ko).join(`
2023-04-13 20:38:12 +08:00
`)})},i(a){l||(a&&tt(()=>{l&&(s||(s=Ve(t,Ht,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Ht,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function Zu(n){let e,t,i=ko(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=U(i),l=D(),h(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=ko(a[12])+"")&&le(s,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=Ve(e,St,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,St,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function yy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Ct(a,n,n[8],Ju),f=[vy,by],d=[];function p(m,_){return m[0]&&m[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=D(),s.c(),h(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){S(m,e,_),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Ot(u,a,m,m[8],l?Mt(a,m[8],_,gy):Et(m[8]),Ju);let g=i;i=p(m),i===g?d[i].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),s=d[i],s?s.p(m,_):(s=d[i]=f[i](m),s.c()),I(s,1),s.m(e,null)),(!l||_&2)&&h(e,"class",m[1]),(!l||_&10)&&x(e,"error",m[3].length)},i(m){l||(I(u,m),I(s),l=!0)},o(m){P(u,m),P(s),l=!1},d(m){m&&w(e),u&&u.d(m),d[i].d(),n[11](null),o=!1,r()}}}const Gu="Invalid value";function ko(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Gu:n||Gu}function ky(n,e,t){let i;Ke(n,_i,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){Ei(r)}Xt(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function m(g){pe.call(this,n,g)}function _(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=z.toArray(z.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,ky,yy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function wy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=D(),l=y("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){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(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]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Sy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Password"),s=D(),l=y("input"),r=D(),a=y("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(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[1]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&h(e,"for",i),p&512&&o!==(o=d[9])&&h(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function $y(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Password confirm"),s=D(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[7]),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&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Ty(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;return s=new de({props:{class:"form-field required",name:"email",$$slots:{default:[wy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[Sy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:
<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){S(_,e,g),v(e,t),v(e,i),j(s,e,null),v(e,l),j(o,e,null),v(e,r),j(a,e,null),v(e,u),v(e,f),d=!0,p||(m=J(e,"submit",pt(n[4])),p=!0)},p(_,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:_}),s.$set(b);const k={};g&1538&&(k.$$scope={dirty:g,ctx:_}),o.$set(k);const $={};g&1540&&($.$$scope={dirty:g,ctx:_}),a.$set($),(!d||g&8)&&x(f,"btn-disabled",_[3]),(!d||g&8)&&x(f,"btn-loading",_[3])},i(_){d||(I(s.$$.fragment,_),I(o.$$.fragment,_),I(a.$$.fragment,_),d=!0)},o(_){P(s.$$.fragment,_),P(o.$$.fragment,_),P(a.$$.fragment,_),d=!1},d(_){_&&w(e),V(s),V(o),V(a),p=!1,m()}}}function Cy(n,e,t){const i=wt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await he.admins.create({email:s,password:l,passwordConfirm:o}),await he.admins.authWithPassword(s,l),i("submit")}catch(p){he.errorResponseHandler(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class My extends ve{constructor(e){super(),be(this,e,Cy,Ty,_e,{})}}function Xu(n){let e,t;return e=new e1({props:{$$slots:{default:[Oy]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Oy(n){let e,t;return e=new My({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:Q,i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ey(n){let e,t,i=n[0]&&Xu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&I(i,1)):(i=Xu(s),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(I(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Dy(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){he.logout(!1),t(0,i=!0);return}he.authStore.isValid?Ii("/collections"):he.logout()}return[i,async()=>{t(0,i=!1),await un(),window.location.search=""}]}class Ay extends ve{constructor(e){super(),be(this,e,Dy,Ey,_e,{})}}const Lt=On(""),wo=On(""),Ms=On(!1);function Iy(n){let e,t,i,s;return{c(){e=y("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),ue(e,n[7]),i||(s=J(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]&&ue(e,l[7])},i:Q,o:Q,d(l){l&&w(e),n[13](null),i=!1,s()}}}function Py(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>me(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ye(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>me(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),I(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&V(e,a)}}}function Qu(n){let e,t,i;return{c(){e=y("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){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=Ve(e,ni,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ni,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function xu(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',h(e,"type","button"
<span class="txt">Method</span>`,h(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Zy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="URL",h(t,"class",z.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Gy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Referer",h(t,"class",z.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Xy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="User IP",h(t,"class",z.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Qy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Status",h(t,"class",z.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function xy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Created",h(t,"class",z.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function sf(n){let e;function t(l,o){return l[6]?t2:e2}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function e2(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&lf(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=lf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function t2(n){let e;return{c(){e=y("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function lf(n){let e,t,i;return{c(){e=y("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){S(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function of(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rf(n,e){var Ce,Je,ht;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,m,_,g,b,k,$=(e[23].referer||"N/A")+"",T,C,O,M,E,A=(e[23].userIp||"N/A")+"",L,F,R,N,q,Y=e[23].status+"",B,Z,ee,ie,X,fe,G,ce,ge,Me,je=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((ht=e[23].meta)==null?void 0:ht.errorData))&&of();ie=new mi({props:{date:e[23].created}});function He(){return e[17](e[23])}function we(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=U(l),a=D(),u=y("td"),f=y("span"),p=U(d),_=D(),je&&je.c(),g=D(),b=y("td"),k=y("span"),T=U($),O=D(),M=y("td"),E=y("span"),L=U(A),R=D(),N=y("td"),q=y("span"),B=U(Y),Z=D(),ee=y("td"),H(ie.$$.fragment),X=D(),fe=y("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',G=D(),h(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",m=e[23].url),h(u,"class","col-type-text col-field-url"),h(k,"class","txt txt-ellipsis"),h(k,"title",C=e[23].referer),x(k,"txt-hint",!e[23].referer),h(b,"class","col-type-text col-field-referer"),h(E,"class","txt txt-ellipsis"),h(E,"title",F=e[23].userIp),x(E,"txt-hint",!e[23].userIp),h(M,"class","col-type-number col-field-userIp"),h(q,"class","label"),x(q,"label-danger",e[23].status>=400),h(N,"class","col-type-number col-field-status"),h(ee,"class","col-type-date col-field-created"),h(fe,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Ze,We){S(Ze,t,We),v(t,i),v(i,s),v(s,o),v(t,a),v(t,u),v(u,f),v(f,p),v(u,_),je&&je.m(u,null),v(t,g),v(t,b),v(b,k),v(k,T),v(t,O),v(t,M),v(M,E),v(E,L),v(t,R),v(t,N),v(N,q),v(q,B),v(t,Z),v(t,ee),j(ie,ee,null),v(t,X),v(t,fe),v(t,G),ce=!0,ge||(Me=[J(t,"click",He),J(t,"keydown",we)],ge=!0)},p(Ze,We){var Re,Qe,Jt;e=Ze,(!ce||We&8)&&l!==(l=((Re=e[23].method)==null?void 0:Re.toUpperCase())+"")&&le(o,l),(!ce||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&h(s,"class",r),(!ce||We&8)&&d!==(d=e[23].url+"")&&le(p,d),(!ce||We&8&&m!==(m=e[23].url))&&h(f,"title",m),(Qe=e[23].meta)!=null&&Qe.errorMessage||(Jt=e[23].meta)!=null&&Jt.errorData?je||(je=of(),je.c(),je.m(u,null)):je&&(je.d(1),je=null),(!ce||We&8)&&$!==($=(e[23].referer||"N/A")+"")&&le(T,$),(!ce||We&8&&C!==(C=e[23].referer))&&h(k,"title",C),(!ce||We&8)&&x(k,"txt-hint",!e[23].referer),(!ce||We&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&le(L,A),(!ce||We&8&&F!==(F=e[23].userIp))&&h(E,"title",F),(!ce||We&8)&&x(E,"txt-hint",!e[23].userIp),(!ce||We&8)&&Y!==(Y=e[23].status+"")&&le(B,Y),(!ce||We&8)&&x(q,"label-danger",e[23].status>=400);const te={};We&8&&(te.date=e[23].created),ie.$set(te)},i(Ze){ce||(I(ie.$$.fragment,Ze),ce=!0)},o(Ze){P(ie.$$.fragment,Ze),ce=!1},d(Ze){Ze&&w(t),je&&je.d(),V(ie),ge=!1,Ae(Me)}}}function n2(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,E,A,L=[],F=new Map,R;function N(we){n[11](we)}let q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Jy]},$$scope:{ctx:n}};n[1]!==void 0&&(q.sort=n[1]),s=new xt({props:q}),se.push(()=>me(s,"sort",N));function Y(we){n[12](we)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Zy]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new xt({props:B}),se.push(()=>me(r,"sort",Y));function Z(we){n[13](we)}let ee={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Gy]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),f=new xt({props:ee}),se.push(()=>me(f,"sort",Z));function ie(we){n[14](we)}let X={disable:!0,class:"col-type-number col-fie
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-04-13 20:38:12 +08:00
*/function oi(){}const o2=function(){let n=0;return function(){return n++}}();function ct(n){return n===null||typeof n>"u"}function yt(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 xe(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Rt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Pn(n,e){return Rt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const r2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,n1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function At(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let s,l,o;if(yt(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(xe(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function So(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(yt(n))return n.map($o);if(xe(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 i1(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function a2(n,e,t,i){if(!i1(n))return;const s=e[n],l=t[n];xe(s)&&xe(l)?hl(s,l,i):e[n]=$o(l)}function hl(n,e,t){const i=yt(e)?e:[e],s=i.length;if(!xe(n))return n;t=t||{};const l=t.merger||a2;for(let o=0;o<s;++o){if(e=i[o],!xe(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 il(n,e){return hl(n,e,{merger:u2})}function u2(n,e,t){if(!i1(n))return;const i=e[n],s=t[n];xe(i)&&xe(s)?il(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=$o(s))}const ff={"":n=>n,x:n=>n.x,y:n=>n.y};function Di(n,e){return(ff[e]||(ff[e]=f2(e)))(n)}function f2(n){const e=c2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function c2(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Na(n){return n.charAt(0).toUpperCase()+n.slice(1)}const jn=n=>typeof n<"u",Ai=n=>typeof n=="function",cf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function d2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Nt=Math.PI,_t=2*Nt,p2=_t+Nt,To=Number.POSITIVE_INFINITY,m2=Nt/180,It=Nt/2,Us=Nt/4,df=Nt*2/3,Rn=Math.log10,ei=Math.sign;function pf(n){const e=Math.round(n);n=sl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Rn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function h2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function sl(n,e,t){return Math.abs(n-e)<t}function _2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function s1(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 Yn(n){return n*(Nt/180)}function Fa(n){return n*(180/Nt)}function mf(n){if(!Rt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function l1(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*Nt&&(l+=_t),{angle:l,distance:s}}function ta(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function g2(n,e){return(n-e+p2)%_t-Nt}function Sn(n){return(n%_t+_t)%_t}function _l(n,e,t,i){const s=Sn(n),l=Sn(e),o=Sn(t),r=Sn(l-s),a=Sn(o-s),u=Sn(s-l),f=Sn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function en(n,e,t){return Math.max(e,Math.min(t,n))}function b2(n){return en(n,-32768,32767)}function gl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ra(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Gi=(n,e,t,i)=>Ra(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),v2=(n,e,t)=>Ra(n,t,i=>n[i][e]>=t);function y2(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
2023-04-13 20:38:12 +08:00
*/function Dl(n){return n+.5|0}const Si=(n,e,t)=>Math.max(Math.min(n,t),e);function xs(n){return Si(Dl(n*2.55),0,255)}function Mi(n){return Si(Dl(n*255),0,255)}function ui(n){return Si(Dl(n/2.55)/100,0,1)}function vf(n){return Si(Dl(n*100),0,100)}const In={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],$2=n=>na[n&15],T2=n=>na[(n&240)>>4]+na[n&15],Yl=n=>(n&240)>>4===(n&15),C2=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function M2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const O2=(n,e)=>n<255?e(n):"";function E2(n){var e=C2(n)?$2:T2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+O2(n.a,e):void 0}const D2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function d1(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 A2(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 I2(n,e,t){const i=d1(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 P2(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 qa(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=P2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function ja(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Mi)}function Va(n,e,t){return ja(d1,n,e,t)}function L2(n,e,t){return ja(I2,n,e,t)}function N2(n,e,t){return ja(A2,n,e,t)}function p1(n){return(n%360+360)%360}function F2(n){const e=D2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?xs(+e[5]):Mi(+e[5]));const s=p1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=L2(s,l,o):e[1]==="hsv"?i=N2(s,l,o):i=Va(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function R2(n,e){var t=qa(n);t[0]=p1(t[0]+e),t=Va(t),n.r=t[0],n.g=t[1],n.b=t[2]}function q2(n){if(!n)return;const e=qa(n),t=e[0],i=vf(e[1]),s=vf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ui(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const yf={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"},kf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-04-13 20:38:12 +08:00
*/class Hk{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=a1.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 ri=new Hk;const Pf="transparent",zk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Sf(n||Pf),s=i.valid&&Sf(e||Pf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Bk{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||zk[e.type||typeof o],this._easing=ll[e.easing]||ll.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 Uk=["x","y","borderWidth","radius","tension"],Wk=["color","borderColor","backgroundColor"];lt.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 Yk=Object.keys(lt.animation);lt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:Wk},numbers:{type:"number",properties:Uk}});lt.describe("animations",{_fallback:"animation"});lt.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 O1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!xe(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!xe(s))return;const l={};for(con
`)>-1?n.split(`
2023-04-13 20:38:12 +08:00
`):n}function aS(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 fc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=$n(e.bodyFont),u=$n(e.titleFont),f=$n(e.footerFont),d=l.length,p=s.length,m=i.length,_=Vn(e.padding);let g=_.height,b=0,k=i.reduce((C,O)=>C+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}p&&(g+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let $=0;const T=function(C){b=Math.max(b,t.measureText(C).width+$)};return t.save(),t.font=u.string,mt(n.title,T),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),T),$=e.displayColors?o+2+e.boxPadding:0,mt(i,C=>{mt(C.before,T),mt(C.lines,T),mt(C.after,T)}),$=0,t.font=f.string,mt(n.footer,T),t.restore(),b+=_.width,{width:b,height:g}}function uS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function fS(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 cS(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"),fS(u,n,e,t)&&(u="center"),u}function cc(n,e,t){const i=t.yAlign||e.yAlign||uS(n,t);return{xAlign:t.xAlign||e.xAlign||cS(n,e,t,i),yAlign:i}}function dS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function pS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function dc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:m}=ws(o);let _=dS(e,r);const g=pS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,p)+s:r==="right"&&(_+=Math.max(d,m)+s),{x:en(_,0,i.width-e.width),y:en(g,0,i.height-e.height)}}function no(n,e,t){const i=Vn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function pc(n){return Xn([],ai(n))}function mS(n,e,t){return Pi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function mc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends gi{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 O1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=mS(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=Xn(r,ai(s)),r=Xn(r,ai(l)),r=Xn(r,ai(o)),r}getBeforeBody(e,t){return pc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=mc(i,l);Xn(o.before,ai(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
2023-04-13 20:38:12 +08:00
*/const NS={datetime:ze.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:ze.TIME_WITH_SECONDS,minute:ze.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};P1._date.override({_id:"luxon",_create:function(n){return ze.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return NS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=ze.fromFormat(n,e,t):n=ze.fromISO(n,t):n instanceof Date?n=ze.fromJSDate(n,t):i==="object"&&!(n instanceof ze)&&(n=ze.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function wc(n){let e,t,i;return{c(){e=y("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Ht,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function FS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=D(),s=U(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function RS(n){let e;return{c(){e=U("Loading...")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function qS(n){let e,t,i,s,l,o=n[2]&&wc();function r(f,d){return f[2]?RS:FS}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=D(),i=y("canvas"),s=D(),l=y("div"),u.c(),h(i,"class","chart-canvas svelte-vh4sl8"),qr(i,"height","250px"),qr(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(f,d){S(f,e,d),o&&o.m(e,null),v(e,t),v(e,i),n[8](i),S(f,s,d),S(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&I(o,1):(o=wc(),o.c(),I(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){I(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function jS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),he.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{d();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(d(),console.warn(m),he.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}Xt(()=>(Po.register(Li,Xo,Zo,nu,Ll,rS,hS),t(6,o=new Po(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.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
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
2023-04-13 20:38:12 +08:00
*/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 $(T){return T instanceof a?new a(T.type,$(T.content),T.alias):Array.isArray(T)?T.map($):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(T,C){C=C||{};var O,M;switch(r.util.type(T)){case"Object":if(M=r.util.objId(T),C[M])return C[M];O={},C[M]=O;for(var E in T)T.hasOwnProperty(E)&&(O[E]=$(T[E],C));return O;case"Array":return M=r.util.objId(T),C[M]?C[M]:(O=[],C[M]=O,T.forEach(function(A,L){O[L]=$(A,C)}),O);default:return T}},getLanguage:function($){for(;$;){var T=s.exec($.className);if(T)return T[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,T){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(O){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(O.stack)||[])[1];if($){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==$)return T[C]}return null}},isActive:function($,T,C){for(var O="no-"+T;$;){var M=$.classList;if(M.contains(T))return!0;if(M.contains(O))return!1;$=$.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,T){var C=r.util.clone(r.languages[$]);for(var O in T)C[O]=T[O];return C},insertBefore:function($,T,C,O){O=O||r.languages;var M=O[$],E={};for(var A in M)if(M.hasOwnProperty(A)){if(A==T)for(var L in C)C.hasOwnProperty(L)&&(E[L]=C[L]);C.hasOwnProperty(A)||(E[A]=M[A])}var F=O[$];return O[$]=E,r.languages.DFS(r.languages,function(R,N){N===F&&R!=$&&(this[R]=E)}),E},DFS:function $(T,C,O,M){M=M||{};var E=r.util.objId;for(var A in T)if(T.hasOwnProperty(A)){C.call(T,A,T[A],O||A);var L=T[A],F=r.util.type(L);F==="Object"&&!M[E(L)]?(M[E(L)]=!0,$(L,C,null,M)):F==="Array"&&!M[E(L)]&&(M[E(L)]=!0,$(L,C,A,M))}}},plugins:{},highlightAll:function($,T){r.highlightAllUnder(document,$,T)},highlightAllUnder:function($,T,C){var O={callback:C,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",O),O.elements=Array.prototype.slice.apply(O.container.querySelectorAll(O.selector)),r.hooks.run("before-all-elements-highlight",O);for(var M=0,E;E=O.elements[M++];)r.highlightElement(E,T===!0,O.callback)},highlightElement:function($,T,C){var O=r.util.getLanguage($),M=r.languages[O];r.util.setLanguage($,O);var E=$.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,O);var A=$.textContent,L={element:$,language:O,grammar:M,code:A};function F(N){L.highlightedCode=N,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),C&&C.call(L.element)}if(r.hooks.run("before-sanity-check",L),E=L.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),C&&C.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){F(r.util.encode(L.code));return}if(T&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(N){F(N.data)},R.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else F(r.highlight(L.code,L.grammar,L.language))},highlight:function($,T,C){var O={code:$,grammar:T,language:C};if(r.hooks.run("before-tokenize",O),!O.grammar)throw new Error('The language "'+O.language+'" has no grammar.');return O.tokens=r.tokenize(O.code,O.grammar),r.hooks.run("after-tokenize",O),a.stringify(r.util.encode(O.tokens),O.language)},tokenize:function($,T){var C=T.rest;if(C){for(var O in C)T[O]=C[O];delete T.rest}var M=new d;return p(M,M.head,$),f($,M,T,M.head,0),_(M)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}k.textContent=M,t.highlightElement(k)},function(M){b.setAttribute(r,f),k.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var k=(b||document).querySelectorAll(d),$=0,T;T=k[$++];)t.highlightElement(T)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(HS);const Gs=ma;var $c={},zS={get exports(){return $c},set exports(n){$c=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),d=0,p=0;p<f.length;++p){var m=s(f[p]);d+=m,d>r&&(f[p]=`
`+f[p],d=m)}a[u]=f.join("")}return a.join(`
2023-04-13 20:38:12 +08:00
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var d=JSON.parse(a.getAttribute("data-"+u)||"true");typeof d===f&&(o.settings[u]=d)}catch{}}for(var p=a.childNodes,m="",_="",g=!1,b=0;b<p.length;++b){var k=p[b];k==o.element?g=!0:k.nodeName==="#text"&&(g?_+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+_,o.code=r.normalize(o.code,o.settings);else{var $=m+o.element.innerHTML+_;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(zS);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function BS(n){let e,t,i;return{c(){e=y("div"),t=y("code"),h(t,"class","svelte-10s5tkd"),h(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),v(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&h(e,"class",i)},i:Q,o:Q,d(s){s&&w(e)}}}function US(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Gs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Gs.highlight(a,Gs.languages[l]||Gs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Gs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class x1 extends ve{constructor(e){super(),be(this,e,US,BS,_e,{class:0,content:2,language:3})}}const WS=n=>({}),Tc=n=>({}),YS=n=>({}),Cc=n=>({});function Mc(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T=n[4]&&!n[2]&&Oc(n);const C=n[19].header,O=Ct(C,n,n[18],Cc);let M=n[4]&&n[2]&&Ec(n);const E=n[19].default,A=Ct(E,n,n[18],null),L=n[19].footer,F=Ct(L,n,n[18],Tc);return{c(){e=y("div"),t=y("div"),s=D(),l=y("div"),o=y("div"),T&&T.c(),r=D(),O&&O.c(),a=D(),M&&M.c(),u=D(),f=y("div"),A&&A.c(),d=D(),p=y("div"),F&&F.c(),h(t,
<span class="txt">New index</span>`,f=D(),H(d.$$.fragment),h(e,"class","section-title"),h(u,"type","button"),h(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),h(r,"class","indexes-list svelte-167lbwu")},m(E,A){S(E,e,A),v(e,t),v(e,s),v(e,l),S(E,o,A),S(E,r,A);for(let L=0;L<k.length;L+=1)k[L]&&k[L].m(r,null);v(r,a),v(r,u),S(E,f,A),j(d,E,A),m=!0,_||(g=J(u,"click",n[5]),_=!0)},p(E,[A]){var F,R,N;if((!m||A&1)&&i!==(i=(((R=(F=E[0])==null?void 0:F.indexes)==null?void 0:R.length)||0)+"")&&le(s,i),A&7){b=((N=E[0])==null?void 0:N.indexes)||[];let q;for(q=0;q<b.length;q+=1){const Y=jc(E,b,q);k[q]?k[q].p(Y,A):(k[q]=Hc(Y),k[q].c(),k[q].m(r,a))}for(;q<k.length;q+=1)k[q].d(1);k.length=b.length}const L={};!p&&A&1&&(p=!0,L.collection=E[0],ye(()=>p=!1)),d.$set(L)},i(E){m||(I(d.$$.fragment,E),m=!0)},o(E){P(d.$$.fragment,E),m=!1},d(E){E&&w(e),E&&w(o),E&&w(r),dt(k,E),E&&w(f),n[6](null),V(d,E),_=!1,g()}}}const zc=n=>n.name;function M$(n,e,t){let i;Ke(n,_i,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==m){t(0,s.indexes[g]=_,s),Ei("indexes."+g);return}s.indexes.push(_),t(0,s)}const r=(m,_)=>l==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){se[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const d=m=>{for(let _=0;_<s.indexes.length;_++)if(s.indexes[_]==m.detail){s.indexes.splice(_,1),Ei("indexes."+_);break}t(0,s)},p=m=>{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,d,p]}class O$ extends ve{constructor(e){super(),be(this,e,M$,C$,_e,{collection:0})}}function Bc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Uc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),o=U(l),r=D(),h(t,"class","icon "+n[6].icon+" svelte-1p626x7"),h(s,"class","txt"),h(e,"tabindex","0"),h(e,"class","dropdown-item closable svelte-1p626x7")},m(p,m){S(p,e,m),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[J(e,"click",Mn(f)),J(e,"keydown",Mn(d))],a=!0)},p(p,m){n=p},d(p){p&&w(e),a=!1,Ae(u)}}}function E$(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Uc(Bc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Bc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Uc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){dt(i,s),s&&w(e)}}}function D$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Hn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[E$]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("i"),i=D(),s=y("div"),s.textContent="New field",l=D(),H(o.$$.fragment),h(t,"class","ri-add-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",r=Oi(n[0])+" svelte-1p626x7")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(e,l),j(o,e,null),a=!0,u||(f=J(e,"click",n[1]),u=!0)},p(d,[p]){const m={};p&512&&(m.$$scope={dirty:p,ctx:d}),o.$set(m),(!a||p&1&&r!==(r=Oi(d[0])+" svelte-1p626x7"))&&h(e,"class",r)},i(d){a||(I(o.$$.fragment,d),a=!0)},o(d){P(o.$$.fragment,d),a=!1},d(d){d&&w(e),V(o),u=!1,f()}}}function A$(n,e,t){let{class:i=""}=e;const s=wt(),l=[{label:"Plain text",value:"text",icon:z.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:z.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:z.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:z.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:z.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:z.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:z.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:z.getFieldTypeIcon("select")},{label:"File",value:"file",icon:z.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:z.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:z.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!z.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),V(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function fT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[4](b)}let g={id:n[12]+".options.onlyDomains",disabled:!z.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new Rs({props:g}),se.push(()=>me(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]+".options.onlyDomains"),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),j(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]+".options.onlyDomains"))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]+".options.onlyDomains"),k&1&&($.disabled=!z.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),V(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function cT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[uT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[fT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),V(i),V(o)}}}function dT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[cT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function pT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(b){n.$$.not_equal(l.options.exceptDomains,b)&&(l.options.exceptDomains=b,t(0,l))}function a(b){n.$$.not_equal(l.options.onlyDomains,b)&&(l.options.onlyDomains=b,t(0,l))}function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=qe(qe({},e),Ut(b)),t(2,s=Ge(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class ib extends ve{constructor(e){super(),be(this,e,pT,dT,_e,{field:0,key:1})}}function mT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ib({props:o}),se.push(()=>me(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function hT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){pe.call(this,n,_)}function u(_){pe.call(this,n,_)}function f(_){pe.call(this,n,_)}function d(_){pe.call(this,n,_)}function p(_){pe.call(this,n,_)}function m(_){pe.call(this,n,_)}return n.$$set=_=>{e=qe(qe({},e),Ut(_)),t(2,s=Ge(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class _T extends ve{constructor(e){super(),be(this,e,hT,mT,_e,{field:0,key:1})}}function gT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(e,"field",l)),e.$on("rename",n[4]),e.$on(
<span class='flatpickr-weekday'>
`+K.join("</span><span class='flatpickr-weekday'>")+`
</span>
2023-04-13 20:38:12 +08:00
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var W=ft("div","flatpickr-weekwrapper");W.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var K=ft("div","flatpickr-weeks");return W.appendChild(K),{weekWrapper:W,weekNumbers:K}}function G(W,K){K===void 0&&(K=!0);var ne=K?W:W-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,et("onYearChange"),q()),N(),et("onMonthChange"),qi())}function ce(W,K){if(W===void 0&&(W=!0),K===void 0&&(K=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,K===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ir(t.config),oe=ne.hours,Te=ne.minutes,Ie=ne.seconds;m(oe,Te,Ie)}t.redraw(),W&&et("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),et("onClose")}function Me(){t.config!==void 0&&et("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].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 K=t.calendarContainer.parentNode;if(K.lastChild&&K.removeChild(K.lastChild),K.parentNode){for(;K.firstChild;)K.parentNode.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}}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(ne){try{delete t[ne]}catch{}})}function je(W){return t.calendarContainer.contains(W)}function He(W){if(t.isOpen&&!t.config.inline){var K=kn(W),ne=je(K),oe=K===t.input||K===t.altInput||t.element.contains(K)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Te=!oe&&!ne&&!je(W.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Le){return Le.contains(K)});Te&&Ie&&(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 we(W){if(!(!W||t.config.minDate&&W<t.config.minDate.getFullYear()||t.config.maxDate&&W>t.config.maxDate.getFullYear())){var K=W,ne=t.currentYear!==K;t.currentYear=K||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)),ne&&(t.redraw(),et("onYearChange"),q())}}function Ce(W,K){var ne;K===void 0&&(K=!0);var oe=t.parseDate(W,void 0,K);if(t.config.minDate&&oe&&wn(oe,t.config.minDate,K!==void 0?K:!t.minDateHasTime)<0||t.config.maxDate&&oe&&wn(oe,t.config.maxDate,K!==void 0?K:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retu
`),r=y("code"),r.textContent="multipart/form-data",a=U(`
requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=U(` field
is a
`),d=y("strong"),d.textContent="plain string",p=U(`:
2023-04-13 20:38:12 +08:00
`),m=y("ul"),_=y("li"),_.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=D(),b=y("li"),b.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=D(),$=y("li"),$.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=D(),C=y("li"),C.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=D(),M=y("li"),A=U(E),L=U(" is converted to the json "),F=y("code"),F.textContent='{"a":1,"b":2}',R=D(),N=y("li"),N.textContent="numeric strings are converted to json number",q=D(),Y=y("li"),Y.textContent="double quoted strings are left as they are (aka. without normalizations)",B=D(),Z=y("li"),Z.textContent="any other string (empty string too) is double quoted",ee=U(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
2023-04-13 20:38:12 +08:00
data inside an object, eg.`),ie=y("code"),ie.textContent='{"data": anything}',h(i,"class","content"),h(t,"class","alert alert-warning m-b-0 m-t-10"),h(e,"class","block")},m(G,ce){S(G,e,ce),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(m,_),v(m,g),v(m,b),v(m,k),v(m,$),v(m,T),v(m,C),v(m,O),v(m,M),v(M,A),v(M,L),v(M,F),v(m,R),v(m,N),v(m,q),v(m,Y),v(m,B),v(m,Z),v(i,ee),v(i,ie),fe=!0},i(G){fe||(G&&tt(()=>{fe&&(X||(X=Ve(e,St,{duration:150},!0)),X.run(1))}),fe=!0)},o(G){G&&(X||(X=Ve(e,St,{duration:150},!1)),X.run(0)),fe=!1},d(G){G&&w(e),G&&X&&X.end()}}}function aC(n){let e,t,i,s,l,o,r;function a(p,m){return p[2]?rC:oC}let u=a(n),f=u(n),d=n[2]&&yd();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),d&&d.c(),l=Se(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,m){S(p,e,m),v(e,t),v(e,i),f.m(e,null),S(p,s,m),d&&d.m(p,m),S(p,l,m),o||(r=J(e,"click",n[4]),o=!0)},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?m&4&&I(d,1):(d=yd(),d.c(),I(d,1),d.m(l.parentNode,l)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},d(p){p&&w(e),f.d(),p&&w(s),d&&d.d(p),p&&w(l),o=!1,r()}}}function uC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[aC]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?$t(s,[a&2&&{key:r[1]},a&8&&Wt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function fC(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=qe(qe({},e),Ut(b)),t(3,s=Ge(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,r,s,a,u,f,d,p,m,_,g]}class cC extends ve{constructor(e){super(),be(this,e,fC,uC,_e,{field:0,key:1})}}function dC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=U(t),s=D(),l=y("small"),r=U(o),h(e,"class","txt"),h(l,"class","txt-hint")},m(a,u){S(a,e,u),v(e,i),S(a,s,u),S(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function pC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class kd extends ve{constructor(e){super(),be(this,e,pC,dC,_e,{item:0})}}const mC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oas
Leave empty for no restriction.`,position:"top"})),$=!0)},p(M,E){(!k||E&67108864&&l!==(l=M[26]))&&h(e,"for",l);const A={};E&67108864&&(A.id=M[26]),E&8&&(A.items=M[3]),!a&&E&1&&(a=!0,A.keyOfSelected=M[0].options.mimeTypes,ye(()=>a=!1)),r.$set(A);const L={};E&268435457&&(L.$$scope={dirty:E,ctx:M}),b.$set(L)},i(M){k||(I(r.$$.fragment,M),I(b.$$.fragment,M),k=!0)},o(M){P(r.$$.fragment,M),P(b.$$.fragment,M),k=!1},d(M){M&&w(e),M&&w(o),V(r,M),M&&w(u),M&&w(f),V(b),$=!1,T()}}}function vC(n){let e;return{c(){e=y("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
2023-04-13 20:38:12 +08:00
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,h(e,"class","m-0")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function yC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O;function M(A){n[13](A)}let E={id:n[26],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(E.value=n[0].options.thumbs),r=new Rs({props:E}),se.push(()=>me(r,"value",M)),$=new Hn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[vC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=D(),m=y("button"),_=y("span"),_.textContent="Supported formats",g=D(),b=y("i"),k=D(),H($.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[26]),h(d,"class","txt"),h(_,"class","txt link-primary"),h(b,"class","ri-arrow-drop-down-fill"),h(m,"type","button"),h(m,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(A,L){S(A,e,L),v(e,t),v(e,i),v(e,s),S(A,o,L),j(r,A,L),S(A,u,L),S(A,f,L),v(f,d),v(f,p),v(f,m),v(m,_),v(m,g),v(m,b),v(m,k),j($,m,null),T=!0,C||(O=Ee(Ue.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),C=!0)},p(A,L){(!T||L&67108864&&l!==(l=A[26]))&&h(e,"for",l);const F={};L&67108864&&(F.id=A[26]),!a&&L&1&&(a=!0,F.value=A[0].options.thumbs,ye(()=>a=!1)),r.$set(F);const R={};L&268435456&&(R.$$scope={dirty:L,ctx:A}),$.$set(R)},i(A){T||(I(r.$$.fragment,A),I($.$$.fragment,A),T=!0)},o(A){P(r.$$.fragment,A),P($.$$.fragment,A),T=!1},d(A){A&&w(e),A&&w(o),V(r,A),A&&w(u),A&&w(f),V($),C=!1,O()}}}function kC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Max file size"),s=D(),l=y("input"),r=D(),a=y("div"),a.textContent="Must be in bytes.",h(e,"for",i=n[26]),h(l,"type","number"),h(l,"id",o=n[26]),h(l,"step","1"),h(l,"min","0"),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].options.maxSize),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[14]),u=!0)},p(d,p){p&67108864&&i!==(i=d[26])&&h(e,"for",i),p&67108864&&o!==(o=d[26])&&h(l,"id",o),p&1&&gt(l.value)!==d[0].options.maxSize&&ue(l,d[0].options.maxSize)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function wd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[wC,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){S(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),V(t)}}}function wC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=D(),l=y("input"),h(e,"for",i=n[26]),h(l,"id",o=n[26]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&h(e,"for",i),f&67108864&&o!==(o=u[26])&&h(l,"id",o),f&1&&gt(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function SC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[bC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[yC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[kC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}});let _=!n[2]&&wd(n);return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),a=D(),u=y("div"),H(f.$$.f
Authenticated user can pass a file token via the "token" query param.`,position:"top"}))],d=!0)},p(m,_){_&67108864&&t!==(t=m[26])&&h(e,"id",t),_&1&&(e.checked=m[0].options.private),_&67108864&&a!==(a=m[26])&&h(s,"for",a)},d(m){m&&w(e),m&&w(i),m&&w(s),m&&w(u),m&&w(f),d=!1,Ae(p)}}}function TC(n){let e,t,i;return t=new de({props:{class:"form-field form-field-toggle m-0",name:"schema."+n[1]+".options.private",$$slots:{default:[$C,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","col-sm-4")},m(s,l){S(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.private"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),V(t)}}}function CC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{afterNonempty:[TC],options:[SC],default:[_C,({interactive:r})=>({27:r}),({interactive:r})=>r?134217728:0]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("drop",n[20]),e.$on("dragstart",n[21]),e.$on("dragenter",n[22]),e.$on("dragleave",n[23]),{c(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&34?$t(s,[a&2&&{key:r[1]},a&32&&Wt(r[5])]):{};a&402653199&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function MC(n,e,t){var Y;const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=mC.slice(),u=((Y=l.options)==null?void 0:Y.maxSelect)<=1,f=u;function d(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function p(){if(z.isEmpty(l.options.mimeTypes))return;const B=[];for(const Z of l.options.mimeTypes)a.find(ee=>ee.mimeType===Z)||B.push({mimeType:Z});B.length&&t(3,a=a.concat(B))}function m(){l.options.private=this.checked,t(0,l),t(6,f),t(2,u)}function _(B){n.$$.not_equal(l.options.mimeTypes,B)&&(l.options.mimeTypes=B,t(0,l),t(6,f),t(2,u))}const g=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},b=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},k=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},$=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function T(B){n.$$.not_equal(l.options.thumbs,B)&&(l.options.thumbs=B,t(0,l),t(6,f),t(2,u))}function C(){l.options.maxSize=gt(this.value),t(0,l),t(6,f),t(2,u)}function O(){l.options.maxSelect=gt(this.value),t(0,l),t(6,f),t(2,u)}function M(B){u=B,t(2,u)}function E(B){l=B,t(0,l),t(6,f),t(2,u)}function A(B){pe.call(this,n,B)}function L(B){pe.call(this,n,B)}function F(B){pe.call(this,n,B)}function R(B){pe.call(this,n,B)}function N(B){pe.call(this,n,B)}function q(B){pe.call(this,n,B)}return n.$$set=B=>{e=qe(qe({},e),Ut(B)),t(5,s=Ge(e,i)),"field"in B&&t(0,l=B.field),"key"in B&&t(1,o=B.key)},n.$$.update=()=>{var B,Z;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((Z=(B=l.options)==null?void 0:B.values)==null?void 0:Z.length)||99,l)),n.$$.dirty&1&&(z.isEmpty(l.options)?d():p())},[l,o,u,a,r,s,f,m,_,g,b,k,$,T,C,O,M,E,A,L,F,R,N,q]}class OC extends ve{constructor(e){super(),be(this,e,MC,CC,_e,{field:0,key:1})}}function EC(n){let e,t,i,s,l;return{c(){e=y("hr"),t=D(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,h(i,"type","button"),h(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=J(i,"click",n[15]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function DC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33]||n[0].id,$$slots:{afterOptions:[EC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ni({props:l}),se.push(()=>me(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1|r[1]&4&&(a.disabled=!o[33]||o[0].id),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function AC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ni({props:l}),se.push(()=>me(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function IC(n){let e,t,i,s;return e=new de({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[DC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[AC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&w(t),V(i,l)}}}function Sd(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[PC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[LC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),H(t.$$.fragment),i=D(),s=y("div"),H(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){S(r,e,a),j(t,e,null),S(r,i,a),S(r,s,a),j(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(I(t.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),V(t),r&&w(i),r&&w(s),V(l)}}}function PC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min select"),s=D(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"min","1"),h(l,"placeholder","No min limit")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minSelect),r||(a=J(l,"input",n[11]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&h(e,"for",i),f[1]&2&&o!==(o=u[32])&&h(l,"id",o),f[0]&1&&gt(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function LC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max select"),s=D(),l=y("input"),h(e,"for",i=n
`),t=y("code"),t.textContent="username",i=U(` ,
`),s=y("code"),s.textContent="email",l=U(` ,
`),o=y("code"),o.textContent="emailVisibility",r=U(` ,
2023-04-13 20:38:12 +08:00
`),a=y("code"),a.textContent="verified",h(t,"class","txt-sm"),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function Cd(n,e){let t,i,s,l,o;function r(m){e[7](m,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...m){return e[10](e[19],...m)}function f(...m){return e[11](e[19],...m)}var d=e[1][e[17].type];function p(m){let _={key:m[4](m[17])};return m[17]!==void 0&&(_.field=m[17]),{props:_}}return d&&(i=Pt(d,p(e)),se.push(()=>me(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=Se(),i&&H(i.$$.fragment),l=Se(),this.first=t},m(m,_){S(m,t,_),i&&j(i,m,_),S(m,l,_),o=!0},p(m,_){e=m;const g={};if(_&1&&(g.key=e[4](e[17])),!s&&_&1&&(s=!0,g.field=e[17],ye(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){re();const b=i;P(b.$$.fragment,1,0,()=>{V(b,1)}),ae()}d?(i=Pt(d,p(e)),se.push(()=>me(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),H(i.$$.fragment),I(i.$$.fragment,1),j(i,l.parentNode,l)):i=null}else d&&i.$set(g)},i(m){o||(i&&I(i.$$.fragment,m),o=!0)},o(m){i&&P(i.$$.fragment,m),o=!1},d(m){m&&w(t),m&&w(l),i&&V(i,m)}}}function HC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m=[],_=new Map,g,b,k,$,T,C,O,M,E=n[0].$isAuth&&Td(),A=n[0].schema;const L=N=>N[17];for(let N=0;N<A.length;N+=1){let q=$d(n,A,N),Y=L(q);_.set(Y,m[N]=Cd(Y,q))}b=new I$({props:{class:"btn btn-block btn-outline"}}),b.$on("select",n[12]);function F(N){n[13](N)}let R={};return n[0]!==void 0&&(R.collection=n[0]),C=new O$({props:R}),se.push(()=>me(C,"collection",F)),{c(){e=y("div"),t=y("p"),i=U(`System fields:
`),s=y("code"),s.textContent="id",l=U(` ,
`),o=y("code"),o.textContent="created",r=U(` ,
`),a=y("code"),a.textContent="updated",u=D(),E&&E.c(),f=U(`
2023-04-13 20:38:12 +08:00
.`),d=D(),p=y("div");for(let N=0;N<m.length;N+=1)m[N].c();g=D(),H(b.$$.fragment),k=D(),$=y("hr"),T=D(),H(C.$$.fragment),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm"),h(t,"class","txt-sm"),h(e,"class","block m-b-25"),h(p,"class","accordions schema-fields")},m(N,q){S(N,e,q),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),E&&E.m(t,null),v(t,f),S(N,d,q),S(N,p,q);for(let Y=0;Y<m.length;Y+=1)m[Y]&&m[Y].m(p,null);S(N,g,q),j(b,N,q),S(N,k,q),S(N,$,q),S(N,T,q),j(C,N,q),M=!0},p(N,[q]){N[0].$isAuth?E||(E=Td(),E.c(),E.m(t,f)):E&&(E.d(1),E=null),q&119&&(A=N[0].schema,re(),m=kt(m,q,L,1,N,A,_,p,Kt,Cd,null,$d),ae());const Y={};!O&&q&1&&(O=!0,Y.collection=N[0],ye(()=>O=!1)),C.$set(Y)},i(N){if(!M){for(let q=0;q<A.length;q+=1)I(m[q]);I(b.$$.fragment,N),I(C.$$.fragment,N),M=!0}},o(N){for(let q=0;q<m.length;q+=1)P(m[q]);P(b.$$.fragment,N),P(C.$$.fragment,N),M=!1},d(N){N&&w(e),E&&E.d(),N&&w(d),N&&w(p);for(let q=0;q<m.length;q+=1)m[q].d();N&&w(g),V(b,N),N&&w(k),N&&w($),N&&w(T),V(C,N)}}}function zC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function BC(n,e,t){let i,{collection:s=new bn}=e;const l={text:X$,number:iT,bool:oT,email:ib,url:_T,editor:vT,date:NT,select:lC,json:cC,file:OC,relation:VC};function o(C){s.schema[C]&&(s.schema.splice(C,1),t(0,s))}function r(C="text"){const O=new vn({name:a(),type:C});O.onMountSelect=!0,s.schema.push(O),t(0,s)}function a(C="field"){let O="";for(;u(C+O);)++O;return C+O}function u(C){return!!s.schema.find(O=>O.name===C)}function f(C){return i.findIndex(O=>O===C)}function d(C,O){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===O||!O||t(0,s.indexes=s.indexes.map(E=>z.replaceIndexColumn(E,C,O)),s)}function p(C,O){if(!C)return;C.dataTransfer.dropEffect="move";const M=parseInt(C.dataTransfer.getData("text/plain")),E=s.schema;M<O?(E.splice(O+1,0,E[M]),E.splice(M,1)):(E.splice(O,0,E[M]),E.splice(M+1,1)),t(0,s.schema=E,s),fn({})}function m(C,O,M,E){M[E]=C,t(0,s)}const _=C=>o(C),g=C=>d(C.detail.oldName,C.detail.newName),b=(C,O)=>zC(O.detail,C),k=(C,O)=>p(O.detail,C),$=C=>r(C.detail);function T(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new bn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,d,p,m,_,g,b,k,$,T]}class UC extends ve{constructor(e){super(),be(this,e,BC,HC,_e,{collection:0})}}const WC=n=>({isAdminOnly:n&512}),Md=n=>({isAdminOnly:n[9]});function YC(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[JC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function KC(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function Od(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,h(e,"type","button"),h(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Ed(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,h(e,"type","button"),h(e,"class","unlock-overlay svelte-1akuazq"),h(e,"aria-label","Unlock and set custom rule")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:Q,i(o){i||(o&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Ht,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function JC(n){let e,t,i,s,l,o=n[9]?"- Admins only":"",r,a,u,f,d,p,m,_,g,b,k=!n[9]&&Od(n);function $(A){n[14](A)}var T=n[7];function C(A){let L={id:A[18],baseCollection:A[1],disabled:A[9],placeholder:A[9]?"":A[5]};return A[0]!==void 0&&(L.value=A[0]),{props:L}}T&&(d=Pt(T,C(n)),n[13](d),se.push(()=>me(d,"value",$)));let O=n[9]&&Ed(n);const M=n[12].default,E=Ct(M,n,n[15],Md);return{c(){e=y("div"),t=y("label"),i=y("span"),s=U(n[2]),l=D(),r=U(o),a=D(),k&&k.c(),f=D(),d&&H(d.$$.fragment),m=D(),O&&O.c(),_=D(),g=y("div"),E&&E.c(),h(i,"class","txt"),x(i,"txt-hint",n[9]),h(t,"for",u=n[18]),h(e,"class","input-wrapper svelte-1akuazq"),h(g,"class","help-block")},m(A,L){S(A,e,L),v(e,t),v(t,i),v(i,s),v(i,l),v(i,r),v(t,a),k&&k.m(t,null),v(e,f),d&&j(d,e,null),v(e,m),O&&O.m(e,null),S(A,_,L),S(A,g,L),E&&E.m(g,null),b=!0},p(A,L){(!b||L&4)&&le(s,A[2]),(!b||L&512)&&o!==(o=A[9]?"- Admins only":"")&&le(r,o),(!b||L&512)&&x(i,"txt-hint",A[9]),A[9]?k&&(k.d(1),k=null):k?k.p(A,L):(k=Od(A),k.c(),k.m(t,null)),(!b||L&262144&&u!==(u=A[18]))&&h(t,"for",u);const F={};if(L&262144&&(F.id=A[18]),L&2&&(F.baseCollection=A[1]),L&512&&(F.disabled=A[9]),L&544&&(F.placeholder=A[9]?"":A[5]),!p&&L&1&&(p=!0,F.value=A[0],ye(()=>p=!1)),L&128&&T!==(T=A[7])){if(d){re();const R=d;P(R.$$.fragment,1,0,()=>{V(R,1)}),ae()}T?(d=Pt(T,C(A)),A[13](d),se.push(()=>me(d,"value",$)),H(d.$$.fragment),I(d.$$.fragment,1),j(d,e,m)):d=null}else T&&d.$set(F);A[9]?O?(O.p(A,L),L&512&&I(O,1)):(O=Ed(A),O.c(),I(O,1),O.m(e,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae()),E&&E.p&&(!b||L&33280)&&Ot(E,M,A,A[15],b?Mt(M,A[15],L,WC):Et(A[15]),Md)},i(A){b||(d&&I(d.$$.fragment,A),I(O),I(E,A),b=!0)},o(A){d&&P(d.$$.fragment,A),P(O),P(E,A),b=!1},d(A){A&&w(e),k&&k.d(),n[13](null),d&&V(d),O&&O.d(),A&&w(_),A&&w(g),E&&E.d(A)}}}function ZC(n){let e,t,i,s;const l=[KC,YC],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Dd;function GC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,m=null,_=Dd,g=!1;b();async function b(){_||g||(t(8,g=!0),t(7,_=(await at(()=>import("./FilterAutocompleteInput-ad309718.js"),["./FilterAutocompleteInput-ad309718.js","./index-6f704b4c.js"],import.meta.url)).default),Dd=_,t(8,g=!1))}async function k(){t(0,r=m||""),await un(),p==null||p.focus()}async function $(){m=r,t(0,r=null)}function T(O){se[O?"unshift":"push"](()=>{p=O,t(6,p)})}function C(O){r=O,t(0,r)}return n.$$set=O=>{"collection"in O&&t(1,o=O.collection),"rule"in O&&t(0,r=O.rule),"label"in O&&t(2,a=O.label),"formKey"in O&&t(3,u=O.formKey),"required"in O&&t(4,f=O.required),"placeholder"in O&&t(5,d=O.placeholder),"$$scope"in O&&t(15,l=O.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,_,g,i,k,$,s,T,C,l]}class Ts extends ve{constructor(e){super(),be(this,e,GC,ZC,_e,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Ad(n,e,t){const i=n.slice();return i[10]=e[t],i}function Id(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,E,A,L=n[2],F=[];for(let R=0;R<L.length;R+=1)F[R]=Pd(Ad(n,L,R));return{c(){e=y("div"),t=y("div"),i=y("div"),s=y("p"),s.textContent="The following record fields are available:",l=D(),o=y("div");for(let R=0;R<F.length;R+=1)F[R].c();r=D(),a=y("hr"),u=D(),f=y("p"),f.innerH
<code>@request.query.*</code>
<code>@request.data.*</code>
2023-04-13 20:38:12 +08:00
<code>@request.auth.*</code>`,m=D(),_=y("hr"),g=D(),b=y("p"),b.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=D(),$=y("div"),$.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=D(),C=y("hr"),O=D(),M=y("p"),M.innerHTML=`Example rule:
<br/>
2023-04-13 20:38:12 +08:00
<code>@request.auth.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(a,"class","m-t-10 m-b-5"),h(f,"class","m-b-0"),h(p,"class","inline-flex flex-gap-5"),h(_,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h($,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(R,N){S(R,e,N),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let q=0;q<F.length;q+=1)F[q]&&F[q].m(o,null);v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(i,_),v(i,g),v(i,b),v(i,k),v(i,$),v(i,T),v(i,C),v(i,O),v(i,M),A=!0},p(R,N){if(N&4){L=R[2];let q;for(q=0;q<L.length;q+=1){const Y=Ad(R,L,q);F[q]?F[q].p(Y,N):(F[q]=Pd(Y),F[q].c(),F[q].m(o,null))}for(;q<F.length;q+=1)F[q].d(1);F.length=L.length}},i(R){A||(R&&tt(()=>{A&&(E||(E=Ve(e,St,{duration:150},!0)),E.run(1))}),A=!0)},o(R){R&&(E||(E=Ve(e,St,{duration:150},!1)),E.run(0)),A=!1},d(R){R&&w(e),dt(F,R),R&&E&&E.end()}}}function Pd(n){let e,t=n[10]+"",i;return{c(){e=y("code"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function Ld(n){let e,t,i,s,l,o,r,a,u;function f(b){n[6](b)}let d={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Ts({props:d}),se.push(()=>me(e,"rule",f));function p(b){n[7](b)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Ts({props:m}),se.push(()=>me(s,"rule",p));function _(b){n[8](b)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Ts({props:g}),se.push(()=>me(r,"rule",_)),{c(){H(e.$$.fragment),i=D(),H(s.$$.fragment),o=D(),H(r.$$.fragment)},m(b,k){j(e,b,k),S(b,i,k),j(s,b,k),S(b,o,k),j(r,b,k),u=!0},p(b,k){const $={};k&1&&($.collection=b[0]),!t&&k&1&&(t=!0,$.rule=b[0].createRule,ye(()=>t=!1)),e.$set($);const T={};k&1&&(T.collection=b[0]),!l&&k&1&&(l=!0,T.rule=b[0].updateRule,ye(()=>l=!1)),s.$set(T);const C={};k&1&&(C.collection=b[0]),!a&&k&1&&(a=!0,C.rule=b[0].deleteRule,ye(()=>a=!1)),r.$set(C)},i(b){u||(I(e.$$.fragment,b),I(s.$$.fragment,b),I(r.$$.fragment,b),u=!0)},o(b){P(e.$$.fragment,b),P(s.$$.fragment,b),P(r.$$.fragment,b),u=!1},d(b){V(e,b),b&&w(i),V(s,b),b&&w(o),V(r,b)}}}function Nd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[XC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ts({props:l}),se.push(()=>me(e,"rule",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function XC(n){let e,t,i;return{c(){e=y("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
2023-04-13 20:38:12 +08:00
state or email, etc.`,t=D(),i=y("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:Q,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function QC(n){var N,q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,m,_,g,b,k,$,T,C,O=n[1]&&Id(n);function M(Y){n[4](Y)}let E={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(E.rule=n[0].listRule),f=new Ts({props:E}),se.push(()=>me(f,"rule",M));function A(Y){n[5](Y)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Ts({props:L}),se.push(()=>me(m,"rule",A));let F=!((N=n[0])!=null&&N.isView)&&Ld(n),R=((q=n[0])==null?void 0:q.isAuth)&&Nd(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
2023-04-13 20:38:12 +08:00
</a>.`,s=D(),l=y("button"),r=U(o),a=D(),O&&O.c(),u=D(),H(f.$$.fragment),p=D(),H(m.$$.fragment),g=D(),F&&F.c(),b=D(),R&&R.c(),k=Se(),h(l,"type","button"),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex txt-sm txt-hint m-b-5"),h(e,"class","block m-b-sm handle")},m(Y,B){S(Y,e,B),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),O&&O.m(e,null),S(Y,u,B),j(f,Y,B),S(Y,p,B),j(m,Y,B),S(Y,g,B),F&&F.m(Y,B),S(Y,b,B),R&&R.m(Y,B),S(Y,k,B),$=!0,T||(C=J(l,"click",n[3]),T=!0)},p(Y,[B]){var ie,X;(!$||B&2)&&o!==(o=Y[1]?"Hide available fields":"Show available fields")&&le(r,o),Y[1]?O?(O.p(Y,B),B&2&&I(O,1)):(O=Id(Y),O.c(),I(O,1),O.m(e,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae());const Z={};B&1&&(Z.collection=Y[0]),!d&&B&1&&(d=!0,Z.rule=Y[0].listRule,ye(()=>d=!1)),f.$set(Z);const ee={};B&1&&(ee.collection=Y[0]),!_&&B&1&&(_=!0,ee.rule=Y[0].viewRule,ye(()=>_=!1)),m.$set(ee),(ie=Y[0])!=null&&ie.isView?F&&(re(),P(F,1,1,()=>{F=null}),ae()):F?(F.p(Y,B),B&1&&I(F,1)):(F=Ld(Y),F.c(),I(F,1),F.m(b.parentNode,b)),(X=Y[0])!=null&&X.isAuth?R?(R.p(Y,B),B&1&&I(R,1)):(R=Nd(Y),R.c(),I(R,1),R.m(k.parentNode,k)):R&&(re(),P(R,1,1,()=>{R=null}),ae())},i(Y){$||(I(O),I(f.$$.fragment,Y),I(m.$$.fragment,Y),I(F),I(R),$=!0)},o(Y){P(O),P(f.$$.fragment,Y),P(m.$$.fragment,Y),P(F),P(R),$=!1},d(Y){Y&&w(e),O&&O.d(),Y&&w(u),V(f,Y),Y&&w(p),V(m,Y),Y&&w(g),F&&F.d(Y),Y&&w(b),R&&R.d(Y),Y&&w(k),T=!1,C()}}}function xC(n,e,t){let i,{collection:s=new bn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function d(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function p(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=z.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class e4 extends ve{constructor(e){super(),be(this,e,xC,QC,_e,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[9]=e[t],i}function t4(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>me(e,"value",l)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ye(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>me(e,"value",l)),e.$on("change",a[6]),H(e.$$.fragment),I(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&V(e,a)}}}function n4(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function Rd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=qd(Fd(n,i,l));return{c(){e=y("div"),t=y("div");for(let l=0;l<s.length;l+=1)s[l].c();h(t,"class","content"),h(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),v(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=Fd(l,i,r);s[r]?s[r].p(a,o):(s[r]=qd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),dt(s,l)}}}function qd(n){let e,t=n[9]+"",i;return{c(){e=y("p"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function i4(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[n4,t4],m=[];function _(b,k){return b[2]?0:1}l=_(n),o=m[l]=p[l](n);let g=n[3].length&&Rd(n);return{c(){e=y("label"),t=y("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=y("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not support
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li>
<li>Expressions must be aliased with a valid formatted field name (eg.
2023-04-13 20:38:12 +08:00
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=D(),g&&g.c(),f=Se(),h(t,"class","txt"),h(e,"for",i=n[8]),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),m[l].m(b,k),S(b,r,k),S(b,a,k),S(b,u,k),g&&g.m(b,k),S(b,f,k),d=!0},p(b,k){(!d||k&256&&i!==(i=b[8]))&&h(e,"for",i);let $=l;l=_(b),l===$?m[l].p(b,k):(re(),P(m[$],1,1,()=>{m[$]=null}),ae(),o=m[l],o?o.p(b,k):(o=m[l]=p[l](b),o.c()),I(o,1),o.m(r.parentNode,r)),b[3].length?g?g.p(b,k):(g=Rd(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(b){d||(I(o),d=!0)},o(b){P(o),d=!1},d(b){b&&w(e),b&&w(s),m[l].d(b),b&&w(r),b&&w(a),b&&w(u),g&&g.d(b),b&&w(f)}}}function s4(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[i4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function l4(n,e,t){let i;Ke(n,_i,d=>t(4,i=d));let{collection:s=new bn}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=z.getNestedVal(d,"schema",null);if(z.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=z.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.removeByValue(m,"updated");for(let g in p)for(let b in p[g]){const k=p[g][b].message,$=m[g]||g;r.push(z.sentenize($+": "+k))}}Xt(async()=>{t(2,o=!0);try{t(1,l=(await at(()=>import("./CodeEditor-e54123d6.js"),["./CodeEditor-e54123d6.js","./index-6f704b4c.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&Ei("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class o4 extends ve{constructor(e){super(),be(this,e,l4,s4,_e,{collection:0})}}const r4=n=>({active:n&1}),jd=n=>({active:n[0]});function Vd(n){let e,t,i;const s=n[15].default,l=Ct(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ot(l,s,o,o[14],i?Mt(s,o[14],r,null):Et(o[14]),null)},i(o){i||(I(l,o),o&&tt(()=>{i&&(t||(t=Ve(e,St,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,St,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function a4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Ct(a,n,n[14],jd);let f=n[0]&&Vd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=D(),f&&f.c(),h(t,"type","button"),h(t,"class","accordion-header"),h(t,"draggable",n[2]),x(t,"interactive",n[3]),h(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){S(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",pt(n[17])),J(t,"drop",pt(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",pt(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&Ot(u,a,d,d[14],l?Mt(a,d[14],p,r4):Et(d[14]),jd),(!l||p&4)&&h(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&I(f,1)):(f=Vd(d),f.c(),I(f,1),f.m(e,null)):f&&(re(),P(f,1,1,()=>{f=null}),ae()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&h(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(I(u,d),I(f),l=!0)},o(d){P(u,d),P(f),l=!1},d(d){d&&w(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,Ae(r)}}}function u4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,m=!1;function _(){return!!f}function g(){$(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?b():g()}function $(){if(p&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const
<span class="txt">Username/Password</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?m&8&&I(d,1):(d=Hd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function h4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function zd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(z.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[_4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(z.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[g4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(z.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(z.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(I(i.$$.fragment,u),I(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=Ve(e,St,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=Ve(e,St,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),V(i),V(o),u&&r&&r.end()}}}function _4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[7](b)}let g={id:n[12],disabled:!z.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Rs({props:g}),se.push(()=>me(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),j(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!z.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),V(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function g4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[8](b)}let g={id:n[12],disabled:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Rs({props:g}),se.push(()=>me(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),j(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!z.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),V(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function b4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[h4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&zd(n);return{c(){H(e.$$.fragment),t=D(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&I(l,1)):(l=zd(o),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function v4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function y4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Bd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Ht,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function k4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowEmailAuth?y4:v4}let u=a(n),f=u(n),d=n[2]&&Bd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?m&4&&I(d,1):(d=Bd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function w4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Ud(n){let e,t,i;return{c(){e=y("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',h(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=Ve(e,St,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,St,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function S4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[w4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Ud();return{c(){H(e.$$.fragment),t=D(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&I(l,1):(l=Ud(),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function $4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function T4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Ht,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function C4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowOAuth2Auth?T4:$4}let u=a(n),f=u(n),d=n[1]&&Wd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?m&2&&I(d,1):(d=Wd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function M4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Minimum password length"),s=D(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0,h(l,"min","6"),h(l,"max","72")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),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&&gt(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function O4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),l.textContent="Always require email",o=D(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(l,"class","txt"),h(r,"class","ri-information-line txt-sm link-hint"),h(s,"for",a=n[12])},m(d,p){S(d,e,p),e.checked=n[0].options.requireEmail,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(Ue.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(d,p){p&4096&&t!==(t=d[12])&&h(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,Ae(f)}}}function E4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return s=new po({props:{single:!0,$$slots:{header:[m4],default:[c4]},$$scope:{ctx:n}}}),o=new po({props:{single:!0,$$slots:{header:[k4],default:[b4]},$$scope:{ctx:n}}}),a=new po({props:{single:!0,$$slots:{header:[C4],default:[S4]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[M4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),b=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[O4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=D(),i=y("div"),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),f=y("hr"),d=D(),p=y("h4"),p.textContent="General",m=D(),H(_.$$.fragment),g=D(),H(b.$$.fragment),h(e,"class","section-title"),h(i,"class","accordions"),h(p,"class","section-title")},m($,T){S($,e,T),S($,t,T),S($,i,T),j(s,i,null),v(i,l),j(o,i,null),v(i,r),j(a,i,null),S($,u,T),S($,f,T),S($,d,T),S($,p,T),S($,m,T),j(_,$,T),S($,g,T),j(b,$,T),k=!0},p($,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:$}),s.$set(C);const O={};T&8197&&(O.$$scope={dirty:T,ctx:$}),o.$set(O);const M={};T&8195&&(M.$$scope={dirty:T,ctx:$}),a.$set(M);const E={};T&12289&&(E.$$scope={dirty:T,ctx:$}),_.$set(E);const A={};T&12289&&(A.$$scope={dirty:T,ctx:$}),b.$set(A)},i($){k||(I(s.$$.fragment,$),I(o.$$.fragment,$),I(a.$$.fragment,$),I(_.$$.fragment,$),I(b.$$.fragment,$),k=!0)},o($){P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(_.$$.fragment,$),P(b.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(t),$&&w(i),V(s),V(o),V(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(m),V(_,$),$&&w(g),V(b,$)}}}function D4(n,e,t){let i,s,l,o;Ke(n,_i,g=>t(4,o=g));let{collection:r=new bn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function d(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=gt(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,b,k,$;n.$$.dirty&1&&r.$isAuth&&z.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!z.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!z.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!z.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!z.isEmpty(($=o==null?void 0:o.options)==null?void 0:$.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,m,_]}class A4 extends ve{constructor(e){super(),be(this,e,D4,E4,_e,{collection:0})}}function Yd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Kd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Jd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Zd(n){let e;return{c(){e=y("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gd(n){var r;let e,t,i,s,l=n[3]&&Xd(n),o=!((r=n[2])!=null&&r.$isView)&&Qd(n);return{c(){e=y("h6"),e.textContent="Changes:",t=D(),i=y("ul"),l&&l.c(),s=D(),o&&o.c(),h(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),v(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Xd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Qd
`),s=y("strong"),o=U(l),r=D(),a=y("i"),u=D(),f=y("strong"),p=U(d),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"),h(e,"class","svelte-xqpcsf")},m(g,b){S(g,e,b),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(g,b){var k,$;b&2&&l!==(l=((k=g[1])==null?void 0:k.name)+"")&&le(o,l),b&4&&d!==(d=(($=g[2])==null?void 0:$.name)+"")&&le(p,d)},d(g){g&&w(e)}}}function Qd(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=xd(Jd(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=ep(Kd(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=tp(Yd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=D();for(let f=0;f<r.length;f+=1)r[f].c();t=D();for(let f=0;f<u.length;f+=1)u[f].c();i=Se()},m(f,d){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(f,d);S(f,e,d);for(let p=0;p<r.length;p+=1)r[p]&&r[p].m(f,d);S(f,t,d);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(f,d);S(f,i,d)},p(f,d){if(d&32){s=f[5];let p;for(p=0;p<s.length;p+=1){const m=Jd(f,s,p);l[p]?l[p].p(m,d):(l[p]=xd(m),l[p].c(),l[p].m(e.parentNode,e))}for(;p<l.length;p+=1)l[p].d(1);l.length=s.length}if(d&128){o=f[7];let p;for(p=0;p<o.length;p+=1){const m=Kd(f,o,p);r[p]?r[p].p(m,d):(r[p]=ep(m),r[p].c(),r[p].m(t.parentNode,t))}for(;p<r.length;p+=1)r[p].d(1);r.length=o.length}if(d&64){a=f[6];let p;for(p=0;p<a.length;p+=1){const m=Yd(f,a,p);u[p]?u[p].p(m,d):(u[p]=tp(m),u[p].c(),u[p].m(i.parentNode,i))}for(;p<u.length;p+=1)u[p].d(1);u.length=a.length}},d(f){dt(l,f),f&&w(e),dt(r,f),f&&w(t),dt(u,f),f&&w(i)}}}function xd(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=y("li"),t=U(`Multiple to single value conversion of field
`),i=y("strong"),l=U(s),o=D(),r=y("em"),r.textContent="(will keep only the last array item)",h(r,"class","txt-sm"),h(e,"class","svelte-xqpcsf")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o),v(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function ep(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,d=n[17].name+"",p;return{c(){e=y("li"),t=y("div"),i=U(`Renamed field
`),s=y("strong"),o=U(l),r=D(),a=y("i"),u=D(),f=y("strong"),p=U(d),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"),h(e,"class","svelte-xqpcsf")},m(m,_){S(m,e,_),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(m,_){_&128&&l!==(l=m[17].originalName+"")&&le(o,l),_&128&&d!==(d=m[17].name+"")&&le(p,d)},d(m){m&&w(e)}}}function tp(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=y("li"),t=U("Removed field "),i=y("span"),l=U(s),o=D(),h(i,"class","txt-bold"),h(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(i,l),v(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function I4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&Zd(),f=n[8]&&Gd(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=D(),u&&u.c(),r=D(),f&&f.c(),a=Se(),h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),u&&u.m(s,null),S(d,r,p),f&&f.m(d,p),S(d,a,p)},p(d,p){d[6].length?u||(u=Zd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=Gd(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&w(e),u&&u.d(),d&&w(r),f&&f.d(d),d&&w(a)}}}function P4(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function L4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function N4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[L4],header:[P4],default:[I4]},$$scope:{ctx:n}};return e=new cn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){H(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[13](null),V(e,s)}}}function F4(n,e,t){let i,s,l,o,r;const a=wt();let u,f,d;async function p(C,O){t(1,f=C),t(2,d=O),await un(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const g=()=>m(),b=()=>_();function k(C){se[C?"unshift":"push"](()=>{u=C,t(4,u)})}function $(C){pe.call(this,n,C)}function T(C){pe.call(this,n,C)}return n.$$.update=()=>{var C,O,M;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(E=>E.id&&!E.toDelete&&E.originalName!=E.name))||[]),n.$$.dirty&4&&t(6,l=((O=d==null?void 0:d.schema)==null?void 0:O.filter(E=>E.id&&E.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(E=>{var L,F,R;const A=(L=f==null?void 0:f.schema)==null?void 0:L.find(N=>N.id==E.id);return A?((F=A.options)==null?void 0:F.maxSelect)!=1&&((R=E.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.$isView)||i)},[m,f,d,i,u,o,l,s,r,_,p,g,b,k,$,T]}class R4 extends ve{constructor(e){super(),be(this,e,F4,N4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function np(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function q4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new UC({props:l}),se.push(()=>me(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function j4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new o4({props:l}),se.push(()=>me(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ip(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new e4({props:o}),se.push(()=>me(t,"collection",l)),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){S(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),V(t)}}}function sp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new A4({props:o}),se.push(()=>me(t,"collection",l)),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===As)},m(r,a){S(r,e,a),j(t,e,null),s=!0},
<span class="txt">Duplicate</span>`,t=D(),i=y("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
2023-04-13 20:38:12 +08:00
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[24]),J(i,"click",Mn(pt(n[25])))],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function op(n){let e,t,i,s;return i=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[z4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=D(),H(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),V(i,l)}}}function rp(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=D(),l=y("span"),r=U(o),a=U(" collection"),u=D(),h(t,"class",i=Oi(z.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),h(l,"class","txt"),h(e,"type","button"),h(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,_){S(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=J(e,"click",p),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=Oi(z.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&h(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&le(r,o),_[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,d()}}}function z4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=rp(np(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=np(s,t,o);i[o]?i[o].p(r,l):(i[o]=rp(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){dt(i,s),s&&w(e)}}}function ap(n){let e;return{c(){e=y("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function B4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k=(n[6][n[2].type]||"N/A")+"",$,T,C,O,M,E,A,L,F,R=n[2].$isNew&&op(n),N=n[2].system&&ap();return{c(){e=y("label"),t=U("Name"),s=D(),l=y("input"),f=D(),d=y("div"),p=y("button"),m=y("span"),_=D(),g=y("span"),b=U("Type: "),$=U(k),T=D(),R&&R.c(),M=D(),N&&N.c(),E=Se(),h(e,"for",i=n[46]),h(l,"type","text"),h(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],h(l,"spellcheck","false"),l.autofocus=r=n[2].$isNew,h(l,"placeholder",a=n[2].$isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,h(g,"class","txt"),h(p,"type","button"),h(p,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),p.disabled=O=!n[2].$isNew,h(d,"class","form-field-addon")},m(q,Y){S(q,e,Y),v(e,t),S(q,s,Y),S(q,l,Y),S(q,f,Y),S(q,d,Y),v(d,p),v(p,m),v(p,_),v(p,g),v(g,b),v(g,$),v(p,T),R&&R.m(p,null),S(q,M,Y),N&&N.m(q,Y),S(q,E,Y),A=!0,n[2].$isNew&&l.focus(),L||(F=J(l,"input",n[26]),L=!0)},p(q,Y){(!A||Y[1]&32768&&i!==(i=q[46]))&&h(e,"for",i),(!A||Y[1]&32768&&o!==(o=q[46]))&&h(l,"id",o),(!A||Y[0]&8192)&&(l.disabled=q[13]),(!A||Y[0]&4&&r!==(r=q[2].$isNew))&&(l.autofocus=r),(!A||Y[0]&4&&a!==(a=q[2].$isAuth?'eg. "users"':'eg. "posts"'))&&h(l,"placeholder",a),(!A||Y[0]&4&&u!==(u=q[2].name)&&l.value!==u)&&(l.value=u),(!A||Y[0]&68)&&k!==(k=(q[6][q[2].type]||"N/A")+"")&&le($,k),q[2].$isNew?R?(R.p(q,Y),Y[0]&4&&I(R,1)):(R=op(q),R.c(),I(R,1),R.m(p,null)):R&&(re(),P(R,1,1,()=>{R=null}),ae()),(!A||Y[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(q[2].$isNew?"btn-outline":"btn-transparent")))&&h(p,"class",C),(!A||Y[0]&4&&O!==(O=!q[2].$isNew))&&(p.disabled=O),q[2].system?N||(N=ap(),N.c(),N.m(E.parentNode,E)):N&&(N.d(1),N=null)},i(q){A||(I(R),A=!0)},o(q){P(R),A=!1},d(q){q&&w(e),q&&w(s),q&&w(l),q&&w(f),q&&w(d),R&&R.d(),q&&w(M),N&&N.d(q),q&&w(E),L=!1,F()}}}function up(n){let e,t,i,s,l,o;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ee(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&zt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&tt(()=>{s&&(i||(i=Ve(e,Ht,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i|
<span class="txt">New collection</span>`,h(t,"type","button"),h(t,"class","btn btn-block btn-outline"),h(e,"class","sidebar-footer")},m(l,o){S(l,e,o),v(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:Q,d(l){l&&w(e),i=!1,s()}}}function Z4(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],m=new Map,_,g,b,k,$,T,C=n[3];const O=L=>L[15].id;for(let L=0;L<C.length;L+=1){let F=hp(n,C,L),R=O(F);m.set(R,p[L]=bp(R,F))}let M=null;C.length||(M=_p(n));let E=!n[7]&&vp(n),A={};return b=new ru({props:A}),n[13](b),b.$on("save",n[14]),{c(){e=y("aside"),t=y("header"),i=y("div"),s=y("div"),l=y("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=y("input"),a=D(),u=y("hr"),f=D(),d=y("div");for(let L=0;L<p.length;L+=1)p[L].c();M&&M.c(),_=D(),E&&E.c(),g=D(),H(b.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-transparent 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(d,"class","sidebar-content"),x(d,"fade",n[6]),x(d,"sidebar-content-compact",n[3].length>20),h(e,"class","page-sidebar collection-sidebar")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(i,o),v(i,r),ue(r,n[0]),v(e,a),v(e,u),v(e,f),v(e,d);for(let R=0;R<p.length;R+=1)p[R]&&p[R].m(d,null);M&&M.m(d,null),v(e,_),E&&E.m(e,null),S(L,g,F),j(b,L,F),k=!0,$||(T=[J(l,"click",n[10]),J(r,"input",n[11])],$=!0)},p(L,[F]){(!k||F&16)&&x(l,"hidden",!L[4]),F&1&&r.value!==L[0]&&ue(r,L[0]),(!k||F&16)&&x(i,"active",L[4]),F&42&&(C=L[3],p=kt(p,F,O,1,L,C,m,d,is,bp,null,hp),!C.length&&M?M.p(L,F):C.length?M&&(M.d(1),M=null):(M=_p(L),M.c(),M.m(d,null))),(!k||F&64)&&x(d,"fade",L[6]),(!k||F&8)&&x(d,"sidebar-content-compact",L[3].length>20),L[7]?E&&(E.d(1),E=null):E?E.p(L,F):(E=vp(L),E.c(),E.m(e,null));const R={};b.$set(R)},i(L){k||(I(b.$$.fragment,L),k=!0)},o(L){P(b.$$.fragment,L),k=!1},d(L){L&&w(e);for(let F=0;F<p.length;F+=1)p[F].d();M&&M.d(),E&&E.d(),L&&w(g),n[13](null),V(b,L),$=!1,Ae(T)}}}function G4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function X4(n,e,t){let i,s,l,o,r,a,u;Ke(n,hi,$=>t(5,o=$)),Ke(n,ii,$=>t(9,r=$)),Ke(n,No,$=>t(6,a=$)),Ke(n,Ms,$=>t(7,u=$));let f,d="";function p($){tn(hi,o=$,o)}const m=()=>t(0,d="");function _(){d=this.value,t(0,d)}const g=()=>f==null?void 0:f.show();function b($){se[$?"unshift":"push"](()=>{f=$,t(2,f)})}const k=$=>{var T;(T=$.detail)!=null&&T.isNew&&$.detail.collection&&p($.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&G4(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter($=>$.id==d||$.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,m,_,g,b,k]}class Q4 extends ve{constructor(e){super(),be(this,e,X4,Z4,_e,{})}}function yp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function kp(n){n[18]=n[19].default}function wp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Sp(n){let e;return{c(){e=y("hr"),h(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $p(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&Sp();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),d&&d.c(),s=D(),l=y("button"),r=U(o),a=D(),h(l,"type","button"),h(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,_){S(m,t,_),d&&d.m(m,_),S(m,s,_),S(m,l,_),v(l,r),v(l,a),u||(f=J(l,"click",p),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=Sp(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&8&&o!==(o=e[15].label+"")&&le(r,o),_&40&&x(l,"active",e[5]===e[14])},d(m){m&&w(t),d&&d.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function Tp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:t5,then:e5,catch:x4,value:19,blocks:[,,,]};return pu(t=n[15].component,s),{c(){e=Se(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.an
`),E&&E.c(),p=D(),_.c(),g=Se(),h(e,"class","flex m-b-base flex-gap-10"),h(l,"class","list picker-list m-b-base svelte-1u8jhky"),h(f,"class","section-title")},m(N,q){S(N,e,q),j(t,e,null),v(e,i),T&&T.m(e,null),S(N,s,q),S(N,l,q);for(let Y=0;Y<o.length;Y+=1)o[Y]&&o[Y].m(l,null);M&&M.m(l,null),S(N,u,q),S(N,f,q),v(f,d),E&&E.m(f,null),S(N,p,q),L[m].m(N,q),S(N,g,q),b=!0,k||($=Ee(a=SM.call(null,l,n[36])),k=!0)},p(N,q){var Z;const Y={};q[0]&4&&(Y.value=N[2]),q[0]&1024&&(Y.autocompleteCollection=N[10]),t.$set(Y),(Z=N[10])!=null&&Z.$isView?T&&(T.d(1),T=null):T?T.p(N,q):(T=Wp(N),T.c(),T.m(e,null)),q[0]&145324&&(C=N[3],re(),o=kt(o,q,O,1,N,C,r,l,Kt,Zp,null,Up),ae(),!C.length&&M?M.p(N,q):C.length?M&&(M.d(1),M=null):(M=Yp(N),M.c(),M.m(l,null))),a&&zt(a.update)&&q[0]&2064&&a.update.call(null,N[36]),N[5]>1?E?E.p(N,q):(E=Gp(N),E.c(),E.m(f,null)):E&&(E.d(1),E=null);let B=m;m=F(N),m===B?L[m].p(N,q):(re(),P(L[B],1,1,()=>{L[B]=null}),ae(),_=L[m],_?_.p(N,q):(_=L[m]=A[m](N),_.c()),I(_,1),_.m(g.parentNode,g))},i(N){if(!b){I(t.$$.fragment,N);for(let q=0;q<C.length;q+=1)I(o[q]);I(_),b=!0}},o(N){P(t.$$.fragment,N);for(let q=0;q<o.length;q+=1)P(o[q]);P(_),b=!1},d(N){N&&w(e),V(t),T&&T.d(),N&&w(s),N&&w(l);for(let q=0;q<o.length;q+=1)o[q].d();M&&M.d(),N&&w(u),N&&w(f),E&&E.d(),N&&w(p),L[m].d(N),N&&w(g),k=!1,$()}}}function qM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=y("h4"),t=U("Select "),i=y("strong"),l=U(s),o=U(" records")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function jM(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Save selection</span>',h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function VM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[jM],header:[qM],default:[RM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=qe(o,l[a]);e=new cn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new rb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),s=!0},p(a,u){const f=u[0]&524288?$t(l,[l[0],l[1],Wt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&1024&&(d.collection=a[10]),i.$set(d)},i(a){s||(I(e.$$.fragment,a),I(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),V(e,a),a&&w(t),n[42](null),V(i,a)}}}const Lr=100;function HM(n,e,t){let i,s,l,o,r,a,u,f;const d=["value","field","show","hide"];let p=Ge(e,d),m;Ke(n,ii,Ne=>t(26,m=Ne));const _=wt(),g="picker_"+z.randomString(5);let{value:b}=e,{field:k}=e,$,T,C="",O=[],M=[],E=1,A=0,L=!1,F=!1;function R(){return t(2,C=""),t(3,O=[]),t(6,M=[]),q(),Y(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function q(){const Ne=z.toArray(b);if(!s||!Ne.length)return;t(24,F=!0);let $e=[];const Xe=Ne.slice(),ke=[];for(;Xe.length>0;){const Pe=[];for(const nt of Xe.splice(0,Lr))Pe.push(`id="${nt}"`);ke.push(he.collection(s).getFullList(Lr,{filter:Pe.join("||"),$autoCancel:!1}))}try{await Promise.all(ke).then(Pe=>{$e=$e.concat(...Pe)}),t(6,M=[]);for(const Pe of Ne){const nt=z.findByKey($e,"id",Pe);nt&&M.push(nt)}C.trim()||t(3,O=z.filterDuplicatesByKey(M.concat(O)))}catch(Pe){he.errorResponseHandler(Pe)}t(24,F=!1)}async function Y(Ne=!1){if(s){t(4,L=!0),Ne&&(C.trim()?t(3,O=[]):t(3,O=z.toArray(M).slice()));try{const $e=Ne?1:E+1,Xe=await he.collection(s).getList($e,Lr,{filter:C,sort:o!=null&&o.$isView?"":"-created",$cancelKey:g+"loadList"});t(3,O=z.filterDuplicatesByKey(O.concat(Xe.items))),E=Xe.page,t(23,A=Xe.totalItems)}catch($e){he.errorResponseHandler($e)}t(4,L=!1)}}function B(Ne){i==1?t(6,M=[Ne]):u&&(z.pushOrReplaceByKey(M,N
`,h(e,"class","list-item")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function im(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new er({props:{record:n[15],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[8](n[15])}return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),o=y("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),h(t,"class","content"),h(o,"type","button"),h(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(l,"class","actions"),h(e,"class","list-item")},m(m,_){S(m,e,_),v(e,t),j(i,t,null),v(e,s),v(e,l),v(l,o),v(e,r),a=!0,u||(f=[Ee(Ue.call(null,o,"Remove")),J(o,"click",d)],u=!0)},p(m,_){var b;n=m;const g={};_&16&&(g.record=n[15]),_&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(m){a||(I(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),V(i),u=!1,Ae(f)}}}function BM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$=n[4],T=[];for(let M=0;M<$.length;M+=1)T[M]=im(Qp(n,$,M));const C=M=>P(T[M],1,1,()=>{T[M]=null});let O=null;return $.length||(O=em(n)),{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=U(o),u=D(),f=y("div"),d=y("div");for(let M=0;M<T.length;M+=1)T[M].c();O&&O.c(),p=D(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-magic-line"></i>
2023-04-13 20:38:12 +08:00
<span class="txt">Open picker</span>`,h(t,"class",i=Oi(z.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),h(l,"class","txt"),h(e,"for",a=n[14]),h(d,"class","relations-list svelte-1ynw0pc"),h(_,"type","button"),h(_,"class","btn btn-transparent btn-sm btn-block"),h(m,"class","list-item list-item-btn"),h(f,"class","list")},m(M,E){S(M,e,E),v(e,t),v(e,s),v(e,l),v(l,r),S(M,u,E),S(M,f,E),v(f,d);for(let A=0;A<T.length;A+=1)T[A]&&T[A].m(d,null);O&&O.m(d,null),v(f,p),v(f,m),v(m,_),g=!0,b||(k=J(_,"click",n[9]),b=!0)},p(M,E){if((!g||E&4&&i!==(i=Oi(z.getFieldTypeIcon(M[2].type))+" svelte-1ynw0pc"))&&h(t,"class",i),(!g||E&4)&&o!==(o=M[2].name+"")&&le(r,o),(!g||E&16384&&a!==(a=M[14]))&&h(e,"for",a),E&181){$=M[4];let A;for(A=0;A<$.length;A+=1){const L=Qp(M,$,A);T[A]?(T[A].p(L,E),I(T[A],1)):(T[A]=im(L),T[A].c(),I(T[A],1),T[A].m(d,null))}for(re(),A=$.length;A<T.length;A+=1)C(A);ae(),!$.length&&O?O.p(M,E):$.length?O&&(O.d(1),O=null):(O=em(M),O.c(),O.m(d,null))}},i(M){if(!g){for(let E=0;E<$.length;E+=1)I(T[E]);g=!0}},o(M){T=T.filter(Boolean);for(let E=0;E<T.length;E+=1)P(T[E]);g=!1},d(M){M&&w(e),M&&w(u),M&&w(f),dt(T,M),O&&O.d(),b=!1,k()}}}function UM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[BM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new de({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new zM({props:o}),n[11](i),i.$on("save",n[12]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(r,a){j(e,r,a),S(r,t,a),j(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(I(e.$$.fragment,r),I(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),V(e,r),r&&w(t),n[11](null),V(i,r)}}}const sm=100;function WM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new vn}=e,r,a=[],u=!1;f();async function f(){var C,O;const k=z.toArray(s);if(!((C=o==null?void 0:o.options)!=null&&C.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const $=k.slice(),T=[];for(;$.length>0;){const M=[];for(const E of $.splice(0,sm))M.push(`id="${E}"`);T.push(he.collection((O=o==null?void 0:o.options)==null?void 0:O.collectionId).getFullList(sm,{filter:M.join("||"),$autoCancel:!1}))}try{let M=[];await Promise.all(T).then(E=>{M=M.concat(...E)});for(const E of k){const A=z.findByKey(M,"id",E);A&&a.push(A)}t(4,a)}catch(M){he.errorResponseHandler(M)}t(5,u=!1)}function d(k){var $;z.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=(($=a[0])==null?void 0:$.id)||"")}const p=k=>d(k),m=()=>l==null?void 0:l.show();function _(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function g(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const b=k=>{var $;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):(($=a[0])==null?void 0:$.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,d,p,m,_,g,b]}class YM extends ve{constructor(e){super(),be(this,e,WM,UM,_e,{value:0,picker:1,field:2})}}const KM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],JM=(n,
...
2023-04-13 20:38:12 +08:00
-----END PRIVATE KEY-----`),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[5]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&h(e,"for",i),p&8388608&&o!==(o=d[23])&&h(l,"id",o),p&32&&ue(l,d[5])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function TO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$;return s=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[yO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[kO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[wO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[SO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[$O,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),H(s.$$.fragment),l=D(),o=y("div"),H(r.$$.fragment),a=D(),u=y("div"),H(f.$$.fragment),d=D(),p=y("div"),H(m.$$.fragment),_=D(),H(g.$$.fragment),h(i,"class","col-lg-6"),h(o,"class","col-lg-6"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(t,"class","grid"),h(e,"id",n[9]),h(e,"autocomplete","off")},m(T,C){S(T,e,C),v(e,t),v(t,i),j(s,i,null),v(t,l),v(t,o),j(r,o,null),v(t,a),v(t,u),j(f,u,null),v(t,d),v(t,p),j(m,p,null),v(t,_),j(g,t,null),b=!0,k||($=J(e,"submit",pt(n[17])),k=!0)},p(T,C){const O={};C&25165828&&(O.$$scope={dirty:C,ctx:T}),s.$set(O);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:T}),r.$set(M);const E={};C&25165840&&(E.$$scope={dirty:C,ctx:T}),f.$set(E);const A={};C&25165888&&(A.$$scope={dirty:C,ctx:T}),m.$set(A);const L={};C&25165856&&(L.$$scope={dirty:C,ctx:T}),g.$set(L)},i(T){b||(I(s.$$.fragment,T),I(r.$$.fragment,T),I(f.$$.fragment,T),I(m.$$.fragment,T),I(g.$$.fragment,T),b=!0)},o(T){P(s.$$.fragment,T),P(r.$$.fragment,T),P(f.$$.fragment,T),P(m.$$.fragment,T),P(g.$$.fragment,T),b=!1},d(T){T&&w(e),V(s),V(r),V(f),V(m),V(g),k=!1,$()}}}function CO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function MO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=D(),s=y("button"),l=y("i"),o=D(),r=y("span"),r.textContent="Generate and set secret",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[7],h(l,"class","ri-key-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[9]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function OO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[MO],header:[CO],default:[TO]},$$scope:{ctx:n}};return e=new cn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),V(e,s)}}}const mo=15777e3;function EO(n,e,t){let i;const s=wt(),l="apple_secret_"+z.randomString(5);let o,r,a,u,f,d,p=!1;function m(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,d=F.duration||mo),fn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function g(){t(7,p=!0);try{const F=await he.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Yt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){he.errorResponseHandler(
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&zt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
2023-04-13 20:38:12 +08:00
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&w(e),s=!1,l()}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g=!n[6]&&um(n);return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="id",l=D(),o=y("span"),a=D(),g&&g.c(),u=D(),f=y("input"),h(t,"class",z.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[56]),h(f,"type","text"),h(f,"id",d=n[56]),h(f,"placeholder","Leave empty to auto generate..."),h(f,"minlength","15"),f.readOnly=p=!n[6]},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),S(b,a,k),g&&g.m(b,k),S(b,u,k),S(b,f,k),ue(f,n[3].id),m||(_=J(f,"input",n[30]),m=!0)},p(b,k){k[1]&33554432&&r!==(r=b[56])&&h(e,"for",r),b[6]?g&&(g.d(1),g=null):g?g.p(b,k):(g=um(b),g.c(),g.m(u.parentNode,u)),k[1]&33554432&&d!==(d=b[56])&&h(f,"id",d),k[0]&64&&p!==(p=!b[6])&&(f.readOnly=p),k[0]&8&&f.value!==b[3].id&&ue(f,b[3].id)},d(b){b&&w(e),b&&w(a),g&&g.d(b),b&&w(u),b&&w(f),m=!1,_()}}}function fm(n){var u,f;let e,t,i,s,l;function o(d){n[31](d)}let r={collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new h5({props:r}),se.push(()=>me(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&cm();return{c(){H(e.$$.fragment),i=D(),a&&a.c(),s=Se()},m(d,p){j(e,d,p),S(d,i,p),a&&a.m(d,p),S(d,s,p),l=!0},p(d,p){var _,g;const m={};p[0]&1&&(m.collection=d[0]),!t&&p[0]&8&&(t=!0,m.record=d[3],ye(()=>t=!1)),e.$set(m),(g=(_=d[0])==null?void 0:_.schema)!=null&&g.length?a||(a=cm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(I(e.$$.fragment,d),l=!0)},o(d){P(e.$$.fragment,d),l=!1},d(d){V(e,d),d&&w(i),a&&a.d(d),d&&w(s)}}}function cm(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function HO(n){let e,t,i;function s(o){n[44](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new YM({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zO(n){let e,t,i,s,l;function o(f){n[41](f,n[53])}function r(f){n[42](f,n[53])}function a(f){n[43](f,n[53])}let u={field:n[53],record:n[3]};return n[3][n[53].name]!==void 0&&(u.value=n[3][n[53].name]),n[4][n[53].name]!==void 0&&(u.uploadedFiles=n[4][n[53].name]),n[5][n[53].name]!==void 0&&(u.deletedFileIndexes=n[5][n[53].name]),e=new wM({props:u}),se.push(()=>me(e,"value",o)),se.push(()=>me(e,"uploadedFiles",r)),se.push(()=>me(e,"deletedFileIndexes",a)),{c(){H(e.$$.fragment)},m(f,d){j(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[53]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[53].name],ye(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[53].name],ye(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[53].name],ye(()=>s=!1)),e.$set(p)},i(f){l||(I(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function BO(n){let e,t,i;function s(o){n[40](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new G5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function UO(n){let e,t,i;function s(o){n[39](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new Y5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function WO(n){let e,t,i;function s(o){n[38](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new z5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.va
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[24]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function _m(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function xO(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&hm(n),u=n[0].$isAuth&&n[2].email&&_m(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=y("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=y("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
2023-04-13 20:38:12 +08:00
<span class="txt">Delete</span>`,h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),S(f,e,d),u&&u.m(f,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),o||(r=[J(i,"click",n[26]),J(l,"click",Mn(pt(n[27])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=hm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=_m(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Ae(r)}}}function gm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=D(),s=y("button"),s.textContent="Authorized providers",h(t,"type","button"),h(t,"class","tab-item"),x(t,"active",n[11]===es),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[11]===wl),h(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[J(t,"click",n[28]),J(s,"click",n[29])],l=!0)},p(r,a){a[0]&2048&&x(t,"active",r[11]===es),a[0]&2048&&x(s,"active",r[11]===wl)},d(r){r&&w(e),l=!1,Ae(o)}}}function eE(n){var g;let e,t=n[6]?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,d,p,m=!n[6]&&mm(n),_=n[0].$isAuth&&!n[6]&&gm(n);return{c(){e=y("h4"),i=U(t),s=D(),l=y("strong"),r=U(o),a=U(" record"),u=D(),m&&m.c(),f=D(),_&&_.c(),d=Se()},m(b,k){S(b,e,k),v(e,i),v(e,s),v(e,l),v(l,r),v(e,a),S(b,u,k),m&&m.m(b,k),S(b,f,k),_&&_.m(b,k),S(b,d,k),p=!0},p(b,k){var $;(!p||k[0]&64)&&t!==(t=b[6]?"New":"Edit")&&le(i,t),(!p||k[0]&1)&&o!==(o=(($=b[0])==null?void 0:$.name)+"")&&le(r,o),b[6]?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(b,k),k[0]&64&&I(m,1)):(m=mm(b),m.c(),I(m,1),m.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?_?_.p(b,k):(_=gm(b),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},i(b){p||(I(m),p=!0)},o(b){P(m),p=!1},d(b){b&&w(e),b&&w(u),m&&m.d(b),b&&w(f),_&&_.d(b),b&&w(d)}}}function tE(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[9],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[14]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=J(e,"click",n[23]),u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&le(r,o),p[0]&4608&&a!==(a=!d[12]||d[9])&&(s.disabled=a),p[0]&512&&x(s,"btn-loading",d[9])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function nE(n){var s;let e,t,i={class:`
record-panel
`+(n[13]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[6]?"colored-header":"")+`
2023-04-13 20:38:12 +08:00
`,beforeHide:n[45],$$slots:{footer:[tE],header:[eE],default:[QO]},$$scope:{ctx:n}};return e=new cn({props:i}),n[46](e),e.$on("hide",n[47]),e.$on("show",n[48]),{c(){H(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&8257&&(r.class=`
record-panel
`+(l[13]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[6]?"colored-header":"")+`
2023-04-13 20:38:12 +08:00
`),o[0]&1152&&(r.beforeHide=l[45]),o[0]&6781|o[1]&67108864&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[46](null),V(e,l)}}}const es="form",wl="providers";function bm(n){return JSON.stringify(n)}function iE(n,e,t){let i,s,l,o;const r=wt(),a="record_"+z.randomString(5);let{collection:u}=e,f,d=null,p=new di,m=!1,_=!1,g={},b={},k="",$=es,T=!0;function C(ke){return M(ke),t(10,_=!0),t(11,$=es),f==null?void 0:f.show()}function O(){return f==null?void 0:f.hide()}async function M(ke){fn({}),t(2,d=ke||new di),ke!=null&&ke.$clone?t(3,p=ke.$clone()):t(3,p=new di),t(4,g={}),t(5,b={}),await un(),t(21,k=bm(p))}function E(){if(m||!o||!(u!=null&&u.id))return;t(9,m=!0);const ke=L();let Pe;T?Pe=he.collection(u.id).create(ke):Pe=he.collection(u.id).update(p.id,ke),Pe.then(nt=>{Yt(T?"Successfully created record.":"Successfully updated record."),t(10,_=!1),O(),r("save",nt)}).catch(nt=>{he.errorResponseHandler(nt)}).finally(()=>{t(9,m=!1)})}function A(){d!=null&&d.id&&_n("Do you really want to delete the selected record?",()=>he.collection(d.collectionId).delete(d.id).then(()=>{O(),Yt("Successfully deleted record."),r("delete",d)}).catch(ke=>{he.errorResponseHandler(ke)}))}function L(){const ke=(p==null?void 0:p.$export())||{},Pe=new FormData,nt={id:ke.id};for(const vt of(u==null?void 0:u.schema)||[])nt[vt.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const vt in ke)nt[vt]&&(typeof ke[vt]>"u"&&(ke[vt]=null),z.addValueToFormData(Pe,vt,ke[vt]));for(const vt in g){const Dn=z.toArray(g[vt]);for(const rt of Dn)Pe.append(vt,rt)}for(const vt in b){const Dn=z.toArray(b[vt]);for(const rt of Dn)Pe.append(vt+"."+rt,"")}return Pe}function F(){!(u!=null&&u.id)||!(d!=null&&d.email)||_n(`Do you really want to sent verification email to ${d.email}?`,()=>he.collection(u.id).requestVerification(d.email).then(()=>{Yt(`Successfully sent verification email to ${d.email}.`)}).catch(ke=>{he.errorResponseHandler(ke)}))}function R(){!(u!=null&&u.id)||!(d!=null&&d.email)||_n(`Do you really want to sent password reset email to ${d.email}?`,()=>he.collection(u.id).requestPasswordReset(d.email).then(()=>{Yt(`Successfully sent password reset email to ${d.email}.`)}).catch(ke=>{he.errorResponseHandler(ke)}))}function N(){l?_n("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ke=d==null?void 0:d.$clone();if(ke){ke.id="",ke.created="",ke.updated="";const Pe=(u==null?void 0:u.schema)||[];for(const nt of Pe)nt.type==="file"&&delete ke[nt.name]}C(ke),await un(),t(21,k="")}const Y=()=>O(),B=()=>F(),Z=()=>R(),ee=()=>N(),ie=()=>A(),X=()=>t(11,$=es),fe=()=>t(11,$=wl);function G(){p.id=this.value,t(3,p)}function ce(ke){p=ke,t(3,p)}function ge(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Me(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function je(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function He(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function we(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Ce(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Je(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function ht(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Ze(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function We(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function te(ke,Pe){n.$$.not_equal(g[Pe.name],ke)&&(g[Pe.name]=ke,t(4,g))}function Re(ke,Pe){n.$$.not_equal(b[Pe.name],ke)&&(b[Pe.name]=ke,t(5,b))}function Qe(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}const Jt=()=>l&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),O()}),!1):(fn({}),!0);function Ne(ke){se[ke?"unshift":"push"](()=>{f=ke,t(8,f)})}function $e(ke){pe.call(this,n,ke)}function Xe(ke){pe.call(this,n,ke)}return n.$$set=ke=>{"collection"in ke&&t(0,u=ke.collection)},
`},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function UE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function WE(n){let e,t,i;return{c(){e=y("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){S(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Km(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=D(),r=y("label"),h(i,"type","checkbox"),h(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],h(r,"for",a="checkbox_"+n[55].id),h(t,"class","form-field"),h(e,"class","bulk-select-col min-width")},m(p,m){S(p,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[J(i,"change",d),J(t,"click",Mn(n[26]))],u=!0)},p(p,m){n=p,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&h(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&h(r,"for",a)},d(p){p&&w(e),u=!1,Ae(f)}}}function Jm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new tr({props:{value:n[55].id}});let d=n[2].$isAuth&&Zm(n);return{c(){e=y("td"),t=y("div"),i=y("div"),H(s.$$.fragment),l=D(),o=y("div"),a=U(r),u=D(),d&&d.c(),h(o,"class","txt"),h(i,"class","label"),h(t,"class","flex flex-gap-5"),h(e,"class","col-type-text col-field-id")},m(p,m){S(p,e,m),v(e,t),v(t,i),j(s,i,null),v(i,l),v(i,o),v(o,a),v(t,u),d&&d.m(t,null),f=!0},p(p,m){const _={};m[0]&16&&(_.value=p[55].id),s.$set(_),(!f||m[0]&16)&&r!==(r=p[55].id+"")&&le(a,r),p[2].$isAuth?d?d.p(p,m):(d=Zm(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(I(s.$$.fragment,p),f=!0)},o(p){P(s.$$.fragment,p),f=!1},d(p){p&&w(e),V(s),d&&d.d()}}}function Zm(n){let e;function t(l,o){return l[55].verified?KE:YE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function YE(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ee(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function KE(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ee(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Gm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Xm(n),o=i&&Qm(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=Se()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Xm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Qm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Xm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].username)),t?ZE:JE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function JE(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].username)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&h(e,"title",s)},d(l){l&&w(e)}}}function ZE(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Qm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].email)),t?XE:GE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function GE(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].email)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"
<span class="txt">New record</span>`,h(e,"type","button"),h(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function uD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,E,A,L,F,R=!n[10]&&ah(n);d=new Pa({}),d.$on("refresh",n[16]);let N=!n[2].$isView&&uh(n);k=new Ko({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function q(Z){n[21](Z)}function Y(Z){n[22](Z)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),O=new lD({props:B}),n[20](O),se.push(()=>me(O,"filter",q)),se.push(()=>me(O,"sort",Y)),O.$on("select",n[23]),O.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=D(),l=y("div"),r=U(o),a=D(),u=y("div"),R&&R.c(),f=D(),H(d.$$.fragment),p=D(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=D(),N&&N.c(),b=D(),H(k.$$.fragment),$=D(),T=y("div"),C=D(),H(O.$$.fragment),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(u,"class","inline-flex gap-5"),h(_,"type","button"),h(_,"class","btn btn-outline"),h(m,"class","btns-group"),h(e,"class","page-header"),h(T,"class","clearfix m-b-base")},m(Z,ee){S(Z,e,ee),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),R&&R.m(u,null),v(u,f),j(d,u,null),v(e,p),v(e,m),v(m,_),v(m,g),N&&N.m(m,null),S(Z,b,ee),j(k,Z,ee),S(Z,$,ee),S(Z,T,ee),S(Z,C,ee),j(O,Z,ee),A=!0,L||(F=J(_,"click",n[17]),L=!0)},p(Z,ee){(!A||ee[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[10]?R&&(R.d(1),R=null):R?R.p(Z,ee):(R=ah(Z),R.c(),R.m(u,f)),Z[2].$isView?N&&(N.d(1),N=null):N?N.p(Z,ee):(N=uh(Z),N.c(),N.m(m,null));const ie={};ee[0]&1&&(ie.value=Z[0]),ee[0]&4&&(ie.autocompleteCollection=Z[2]),k.$set(ie);const X={};ee[0]&4&&(X.collection=Z[2]),!M&&ee[0]&1&&(M=!0,X.filter=Z[0],ye(()=>M=!1)),!E&&ee[0]&2&&(E=!0,X.sort=Z[1],ye(()=>E=!1)),O.$set(X)},i(Z){A||(I(d.$$.fragment,Z),I(k.$$.fragment,Z),I(O.$$.fragment,Z),A=!0)},o(Z){P(d.$$.fragment,Z),P(k.$$.fragment,Z),P(O.$$.fragment,Z),A=!1},d(Z){Z&&w(e),R&&R.d(),V(d),N&&N.d(),Z&&w(b),V(k,Z),Z&&w($),Z&&w(T),Z&&w(C),n[20](null),V(O,Z),L=!1,F()}}}function fD(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=D(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,h(e,"class","m-b-10"),h(i,"type","button"),h(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=J(i,"click",n[14]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function cD(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",h(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function dD(n){let e,t,i;function s(r,a){return r[10]?cD:fD}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),h(t,"class","icon"),h(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),v(e,t),v(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function pD(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function mD(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[aD,rD,oD],m=[];function _(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=_(n),t=m[e]=p[e](n);let g={};s=new ru({props:g}),n[25](s);let b={};o=new o5({props:b}),n[26](o);let k={collection:n[2]};a=new rb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let $={collection:n[2]};return f=new PE({props:$}),n[30](f),{c(){t.c(),i=D(),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),j(s,T,C),S(T,l,C),j(o,T,C),S(T,r,C),j(a,T,C),S(T,u,C),j(f,T,C),d=!0},p(T,C){let O=e;e=_(T),e===O?m[e].p(T,C):(re(),P(m[O],1,1,()=>{m[O]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=p[e](T),t.c()),I(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const E={};o.$set(E);const A={};C[0]&4&&(A.collection=T[2]),a.$set(A);const L={};C[0]&4&&(L.collection=T[2]),f.$set(L)},i(T){d||(I(t),I(s.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(f.$$.fragment,T),d=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),d=!1},d(T){m[e].d(T),T&&w(i),n[25](null),V(s,T),T&&w(l),n[26](null),V(o,T),T&&w(r),n[27](null),V(a,T),T&&w(u),n[30](null),V(f,T)}}}function hD(n,e,t){let i,s,l,o,r,a,u;Ke(n,hi,G=>t(2,s=G)),Ke(n,Lt,G=>t(31,l=G)),Ke(n,No,G=>t(3,o=G)),Ke(n,ya,G=>t(13,r=G)),Ke(n,ii,G=>t(9,a=G)),Ke(n,Ms,G=>t(10,u=G));const f=new URLSearchParams(r);let d,p,m,_,g,b=f.get("filter")||"",k=f.get("sort")||"",$=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,$=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.$isView&&!z.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}p$($);const C=()=>d==null?void 0:d.show(),O=()=>d==null?void 0:d.show(s),M=()=>g==null?void 0:g.load(),E=()=>p==null?void 0:p.show(s),A=()=>m==null?void 0:m.show(),L=G=>t(0,b=G.detail);function F(G){se[G?"unshift":"push"](()=>{g=G,t(8,g)})}function R(G){b=G,t(0,b)}function N(G){k=G,t(1,k)}const q=G=>{s.$isView?_.show(G==null?void 0:G.detail):m==null||m.show(G==null?void 0:G.detail)},Y=()=>m==null?void 0:m.show();function B(G){se[G?"unshift":"push"](()=>{d=G,t(4,d)})}function Z(G){se[G?"unshift":"push"](()=>{p=G,t(5,p)})}function ee(G){se[G?"unshift":"push"](()=>{m=G,t(6,m)})}const ie=()=>g==null?void 0:g.reloadLoadedPages(),X=()=>g==null?void 0:g.reloadLoadedPages();function fe(G){se[G?"unshift":"push"](()=>{_=G,t(7,_)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=$&&f$(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&$!=s.id&&T(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const G=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();Ii("/collections?"+G)}n.$$.dirty[0]&4&&tn(Lt,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,m,_,g,a,u,$,i,r,C,O,M,E,A,L,F,R,N,q,Y,B,Z,ee,ie,X,fe]}class _D extends ve{constructor(e){super(),be(this,e,hD,mD,_e,{},null,[-1,-1])}}function gD(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,E,A,L;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=D(),l=y("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=y("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=y("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),d=y("div"),d.innerHTML='<span class="txt">Sync</span>',p=D(),m=y("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,_=D(),g=y("a"),g.innerHTML=`<i class="ri-install-line"></i>
2023-04-13 20:38:12 +08:00
<span class="txt">Import collections</span>`,b=D(),k=y("div"),k.textContent="Authentication",$=D(),T=y("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
2023-04-11 03:33:13 +08:00
<span class="txt">Auth providers</span>`,C=D(),O=y("a"),O.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,M=D(),E=y("a"),E.innerHTML=`<i class="ri-shield-user-line"></i>
2023-04-13 20:38:12 +08:00
<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(d,"class","sidebar-title"),h(m,"href","/settings/export-collections"),h(m,"class","sidebar-list-item"),h(g,"href","/settings/import-collections"),h(g,"class","sidebar-list-item"),h(k,"class","sidebar-title"),h(T,"href","/settings/auth-providers"),h(T,"class","sidebar-list-item"),h(O,"href","/settings/tokens"),h(O,"class","sidebar-list-item"),h(E,"href","/settings/admins"),h(E,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(F,R){S(F,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),v(t,f),v(t,d),v(t,p),v(t,m),v(t,_),v(t,g),v(t,b),v(t,k),v(t,$),v(t,T),v(t,C),v(t,O),v(t,M),v(t,E),A||(L=[Ee(Un.call(null,l,{path:"/settings"})),Ee(ln.call(null,l)),Ee(Un.call(null,r,{path:"/settings/mail/?.*"})),Ee(ln.call(null,r)),Ee(Un.call(null,u,{path:"/settings/storage/?.*"})),Ee(ln.call(null,u)),Ee(Un.call(null,m,{path:"/settings/export-collections/?.*"})),Ee(ln.call(null,m)),Ee(Un.call(null,g,{path:"/settings/import-collections/?.*"})),Ee(ln.call(null,g)),Ee(Un.call(null,T,{path:"/settings/auth-providers/?.*"})),Ee(ln.call(null,T)),Ee(Un.call(null,O,{path:"/settings/tokens/?.*"})),Ee(ln.call(null,O)),Ee(Un.call(null,E,{path:"/settings/admins/?.*"})),Ee(ln.call(null,E))],A=!0)},p:Q,i:Q,o:Q,d(F){F&&w(e),A=!1,Ae(L)}}}class Fi extends ve{constructor(e){super(),be(this,e,null,gD,_e,{})}}function fh(n,e,t){const i=n.slice();return i[30]=e[t],i}function ch(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[bD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function bD(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="id",o=D(),r=y("div"),a=y("i"),f=D(),d=y("input"),h(t,"class",z.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[29]),h(a,"class","ri-calendar-event-line txt-disabled"),h(r,"class","form-field-addon"),h(d,"type","text"),h(d,"id",p=n[29]),d.value=m=n[1].id,d.readOnly=!0},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),S(b,r,k),v(r,a),S(b,f,k),S(b,d,k),_||(g=Ee(u=Ue.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(b,k){k[0]&536870912&&l!==(l=b[29])&&h(e,"for",l),u&&zt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${b[1].created}
2023-04-13 20:38:12 +08:00
Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&h(d,"id",p),k[0]&2&&m!==(m=b[1].id)&&d.value!==m&&(d.value=m)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(d),_=!1,g()}}}function dh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=D(),Cn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[30]),h(e,"type","button"),h(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),v(e,t),v(e,s),o||(r=J(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function vD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Email",o=D(),r=y("input"),h(t,"class",z.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&8&&r.value!==d[3]&&ue(r,d[3])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function ph(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[yD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function yD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[29]),h(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function mh(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[kD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[wD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),H(s.$$.fragment),l=D(),o=y("div"),H(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,d){S(f,e,d),v(e,t),v(t,i),j(s,i,null),v(t,l),v(t,o),j(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&536871424|d[1]&4&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=Ve(t,St,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(t,St,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),V(s),V(r),f&&a&&a.end()}}}function kD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password",o=D(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&256&&r.value!==d[8]&&ue(r,d[8])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function wD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password confirm",o=D(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function CD(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,m=!n[1].$isNew&&hh(n);return{c(){m&&m.c(),e=D(),t=y("button"),i=y("span"),i.textContent="Cancel",s=D(),l=y("button"),o=y("span"),a=U(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-transparent"),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){m&&m.m(_,g),S(_,e,g),S(_,t,g),v(t,i),S(_,s,g),S(_,l,g),v(l,o),v(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(_,g){_[1].$isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(_,g),g[0]&2&&I(m,1)):(m=hh(_),m.c(),I(m,1),m.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=_[6]),(!f||g[0]&2)&&r!==(r=_[1].$isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!_[10]||_[6]))&&(l.disabled=u),(!f||g[0]&64)&&x(l,"btn-loading",_[6])},i(_){f||(I(m),f=!0)},o(_){P(m),f=!1},d(_){m&&m.d(_),_&&w(e),_&&w(t),_&&w(s),_&&w(l),d=!1,p()}}}function MD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[CD],header:[$D],default:[SD]},$$scope:{ctx:n}};return e=new cn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){H(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),V(e,s)}}}function OD(n,e,t){let i;const s=wt(),l="admin_"+z.randomString(5);let o,r=new ts,a=!1,u=!1,f=0,d="",p="",m="",_=!1;function g(Z){return k(Z),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(Z){t(1,r=Z!=null&&Z.$clone?Z.$clone():new ts),$()}function $(){t(4,_=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,m=""),fn({})}function T(){if(a||!i)return;t(6,a=!0);const Z={email:d,avatar:f};(r.$isNew||_)&&(Z.password=p,Z.passwordConfirm=m);let ee;r.$isNew?ee=he.admins.create(Z):ee=he.admins.update(r.id,Z),ee.then(async ie=>{var X;t(7,u=!1),b(),Yt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((X=he.authStore.model)==null?void 0:X.id)===ie.id&&he.authStore.save(he.authStore.token,ie)}).catch(ie=>{he.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&_n("Do you really want to delete the selected admin?",()=>he.admins.delete(r.id).then(()=>{t(7,u=!1),b(),Yt("Successfully deleted admin."),s("delete",r)}).catch(Z=>{he.errorResponseHandler(Z)}))}const O=()=>C(),M=()=>b(),E=Z=>t(2,f=Z);function A(){d=this.value,t(3,d)}function L(){_=this.checked,t(4,_)}function F(){p=this.value,t(8,p)}function R(){m=this.value,t(9,m)}const N=()=>i&&u?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function q(Z){se[Z?"unshift":"push"](()=>{o=Z,t(5,o)})}function Y(Z){pe.call(this,n,Z)}function B(Z){pe.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||_||d!==r.email||f!==r.avatar)},[b,r,f,d,_,o,a,u,p,m,i,l,T,C,g,O,M,E,A,L,F,R,N,q,Y,B]}class ED extends ve{constructor(e){super(),be(this,e,OD,MD,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function _h(n,e,t){const i=n.slice();return i[24]=e[t],i}function DD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="id",h(t,"class",z.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function AD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="email",h(t,"class",z.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function ID(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="create
`},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function bh(n){let e,t,i;return{c(){e=y("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){S(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function vh(n){let e;return{c(){e=y("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function yh(n,e){let t,i,s,l,o,r,a,u,f,d,p,m=e[24].id+"",_,g,b,k,$,T=e[24].email+"",C,O,M,E,A,L,F,R,N,q,Y,B,Z,ee;f=new tr({props:{value:e[24].id}});let ie=e[24].id===e[7].id&&vh();A=new mi({props:{date:e[24].created}}),R=new mi({props:{date:e[24].updated}});function X(){return e[15](e[24])}function fe(...G){return e[16](e[24],...G)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=D(),a=y("td"),u=y("div"),H(f.$$.fragment),d=D(),p=y("span"),_=U(m),g=D(),ie&&ie.c(),b=D(),k=y("td"),$=y("span"),C=U(T),M=D(),E=y("td"),H(A.$$.fragment),L=D(),F=y("td"),H(R.$$.fragment),N=D(),q=y("td"),q.innerHTML='<i class="ri-arrow-right-line"></i>',Y=D(),Cn(l.src,o="./images/avatars/avatar"+(e[24].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(p,"class","txt"),h(u,"class","label"),h(a,"class","col-type-text col-field-id"),h($,"class","txt txt-ellipsis"),h($,"title",O=e[24].email),h(k,"class","col-type-email col-field-email"),h(E,"class","col-type-date col-field-created"),h(F,"class","col-type-date col-field-updated"),h(q,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(G,ce){S(G,t,ce),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),j(f,u,null),v(u,d),v(u,p),v(p,_),v(a,g),ie&&ie.m(a,null),v(t,b),v(t,k),v(k,$),v($,C),v(t,M),v(t,E),j(A,E,null),v(t,L),v(t,F),j(R,F,null),v(t,N),v(t,q),v(t,Y),B=!0,Z||(ee=[J(t,"click",X),J(t,"keydown",fe)],Z=!0)},p(G,ce){e=G,(!B||ce&16&&!Cn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&h(l,"src",o);const ge={};ce&16&&(ge.value=e[24].id),f.$set(ge),(!B||ce&16)&&m!==(m=e[24].id+"")&&le(_,m),e[24].id===e[7].id?ie||(ie=vh(),ie.c(),ie.m(a,null)):ie&&(ie.d(1),ie=null),(!B||ce&16)&&T!==(T=e[24].email+"")&&le(C,T),(!B||ce&16&&O!==(O=e[24].email))&&h($,"title",O);const Me={};ce&16&&(Me.date=e[24].created),A.$set(Me);const je={};ce&16&&(je.date=e[24].updated),R.$set(je)},i(G){B||(I(f.$$.fragment,G),I(A.$$.fragment,G),I(R.$$.fragment,G),B=!0)},o(G){P(f.$$.fragment,G),P(A.$$.fragment,G),P(R.$$.fragment,G),B=!1},d(G){G&&w(t),V(f),ie&&ie.d(),V(A),V(R),Z=!1,Ae(ee)}}}function FD(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O=[],M=new Map,E;function A(X){n[11](X)}let L={class:"col-type-text",name:"id",$$slots:{default:[DD]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new xt({props:L}),se.push(()=>me(o,"sort",A));function F(X){n[12](X)}let R={class:"col-type-email col-field-email",name:"email",$$slots:{default:[AD]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),u=new xt({props:R}),se.push(()=>me(u,"sort",F));function N(X){n[13](X)}let q={class:"col-type-date col-field-created",name:"created",$$slots:{default:[ID]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),p=new xt({props:q}),se.push(()=>me(p,"sort",N));function Y(X){n[14](X)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[PD]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),g=new xt({props:B}),se.push(()=>me(g,"sort",Y));let Z=n[4];const ee=X=>X[24].id;for(let X=0;X<Z.length;X+=1){let fe=_h(n,Z,X),G=ee(fe);M.set(G,O[X]=yh(G,fe))}let ie=null;return Z.length||(ie=gh(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),s=y("th"),l=D(),H(o.$$.fragment),a=D(),H(u.$$.fragment),d=D(),H(p.$$.fragment),_=D(),H(g.$$.fragment),k=D(),$=y("th"),T=D(),C=y("tbody");for(let X=0;X<O.length;X+=1)O[X].c();ie&&ie.c(),h(s,"class","min-width"),h($,"class","col-type-action min-width"),h(e,"class","table"),x(e,"table-loading",n[5])},m(X,fe){S(X,e,fe),v(e,t),v(t,i),v(i,s),v(i,l),j(o,i,null),v(i,a),j(u,i,null),v(i,d),j(p,i,null),v(i,_),j(g,i,null),v(i,k),v(i,$),v(e,T),v(e
<span class="txt">New admin</span>`,m=D(),H(_.$$.fragment),g=D(),b=y("div"),k=D(),H($.$$.fragment),T=D(),A&&A.c(),C=Se(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(f,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(e,"class","page-header"),h(b,"class","clearfix m-b-base")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(e,r),j(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),S(L,m,F),j(_,L,F),S(L,g,F),S(L,b,F),S(L,k,F),j($,L,F),S(L,T,F),A&&A.m(L,F),S(L,C,F),O=!0,M||(E=J(p,"click",n[9]),M=!0)},p(L,F){(!O||F&64)&&le(o,L[6]);const R={};F&2&&(R.value=L[1]),_.$set(R);const N={};F&134217918&&(N.$$scope={dirty:F,ctx:L}),$.$set(N),L[4].length?A?A.p(L,F):(A=kh(L),A.c(),A.m(C.parentNode,C)):A&&(A.d(1),A=null)},i(L){O||(I(a.$$.fragment,L),I(_.$$.fragment,L),I($.$$.fragment,L),O=!0)},o(L){P(a.$$.fragment,L),P(_.$$.fragment,L),P($.$$.fragment,L),O=!1},d(L){L&&w(e),V(a),L&&w(m),V(_,L),L&&w(g),L&&w(b),L&&w(k),V($,L),L&&w(T),A&&A.d(L),L&&w(C),M=!1,E()}}}function qD(n){let e,t,i,s,l,o;e=new Fi({}),i=new En({props:{$$slots:{default:[RD]},$$scope:{ctx:n}}});let r={};return l=new ED({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&w(t),V(i,a),a&&w(s),n[18](null),V(l,a)}}}function jD(n,e,t){let i,s,l;Ke(n,ya,R=>t(21,i=R)),Ke(n,Lt,R=>t(6,s=R)),Ke(n,Ia,R=>t(7,l=R)),tn(Lt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){return t(5,u=!0),t(4,a=[]),he.admins.getFullList(100,{sort:d||"-created",filter:f}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),m(),he.errorResponseHandler(R,!1))})}function m(){t(4,a=[])}const _=()=>p(),g=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function k(R){d=R,t(2,d)}function $(R){d=R,t(2,d)}function T(R){d=R,t(2,d)}function C(R){d=R,t(2,d)}const O=R=>r==null?void 0:r.show(R),M=(R,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(R))},E=()=>t(1,f="");function A(R){se[R?"unshift":"push"](()=>{r=R,t(3,r)})}const L=()=>p(),F=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:d}).toString();Ii("/settings/admins?"+R),p()}},[p,f,d,r,a,u,s,l,_,g,b,k,$,T,C,O,M,E,A,L,F]}class VD extends ve{constructor(e){super(),be(this,e,jD,qD,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function HD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=D(),l=y("input"),h(e,"for",i=n[8]),h(l,"type","email"),h(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&h(e,"for",i),f&256&&o!==(o=u[8])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function zD(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Password"),s=D(),l=y("input"),r=D(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",h(e,"for",i=n[8]),h(l,"type","password"),h(l,"id",o=n[8]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[1]),S(p,r,m),S(p,a,m),v(a,u),f||(d=[J(l,"input",n[5]),Ee(ln.call(null,u))],f=!0)},p(p,m){m&256&&i!==(i=p[8])&&h(e,"for",i),m&256&&o!==(o=p[8])&&h(l,"id",o),m&2&&l.value!==p[1]&&ue(l,p[1])},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),p&&w(a),f=!1,Ae(d)}}}function BD(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new de({props:{class:"form-field required",name:"identity",$$slots:{default:[HD,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:
<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(p,m){S(p,e,m),v(e,t),v(e,i),j(s,e,null),v(e,l),j(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(e,"submit",pt(n[3])),f=!0)},p(p,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:p}),s.$set(_);const g={};m&770&&(g.$$scope={dirty:m,ctx:p}),o.$set(g),(!u||m&4)&&x(a,"btn-disabled",p[2]),(!u||m&4)&&x(a,"btn-loading",p[2])},i(p){u||(I(s.$$.fragment,p),I(o.$$.fragment,p),u=!0)},o(p){P(s.$$.fragment,p),P(o.$$.fragment,p),u=!1},d(p){p&&w(e),V(s),V(o),f=!1,d()}}}function UD(n){let e,t;return e=new e1({props:{$$slots:{default:[BD]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function WD(n,e,t){let i;Ke(n,ya,d=>t(6,i=d));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),he.admins.authWithPassword(l,o).then(()=>{Da(),Ii("/")}).catch(()=>{ml("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class YD extends ve{constructor(e){super(),be(this,e,WD,UD,_e,{})}}function KD(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[ZD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[GD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[XD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[QD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&wh(n);return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment),d=D(),p=y("div"),m=y("div"),_=D(),M&&M.c(),g=D(),b=y("button"),k=y("span"),k.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(m,"class","flex-fill"),h(k,"class","txt"),h(b,"type","submit"),h(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],x(b,"btn-loading",n[2]),h(p,"class","col-lg-12 flex"),h(e,"class","grid")},m(E,A){S(E,e,A),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),j(a,e,null),v(e,u),j(f,e,null),v(e,d),v(e,p),v(p,m),v(p,_),M&&M.m(p,null),v(p,g),v(p,b),v(b,k),T=!0,C||(O=J(b,"click",n[13]),C=!0)},p(E,A){const L={};A&1572865&&(L.$$scope={dirty:A,ctx:E}),i.$set(L);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:E}),o.$set(F);const R={};A&1572865&&(R.$$scope={dirty:A,ctx:E}),a.$set(R);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:E}),f.$set(N),E[3]?M?M.p(E,A):(M=wh(E),M.c(),M.m(p,g)):M&&(M.d(1),M=null),(!T||A&12&&$!==($=!E[3]||E[2]))&&(b.disabled=$),(!T||A&4)&&x(b,"btn-loading",E[2])},i(E){T||(I(i.$$.fragment,E),I(o.$$.fragment,E),I(a.$$.fragment,E),I(f.$$.fragment,E),T=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(a.$$.fragment,E),P(f.$$.fragment,E),T=!1},d(E){E&&w(e),V(i),V(o),V(a),V(f),M&&M.d(),C=!1,O()}}}function JD(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function ZD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application name"),s=D(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function GD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application url"),s=D(),l=y("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=y("div"),s=y("form"),o.c(),h(e,"class","page-header"),h(s,"class","panel"),h(s,"autocomplete","off"),h(i,"class","wrapper")},m(m,_){S(m,e,_),S(m,t,_),S(m,i,_),v(i,s),d[l].m(s,null),r=!0,a||(u=J(s,"submit",pt(n[4])),a=!0)},p(m,_){let g=l;l=p(m),l===g?d[l].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),o=d[l],o?o.p(m,_):(o=d[l]=f[l](m),o.c()),I(o,1),o.m(s,null))},i(m){r||(I(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),d[l].d(),a=!1,u()}}}function eA(n){let e,t,i,s;return e=new Fi({}),i=new En({props:{$$slots:{default:[xD]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&w(t),V(i,l)}}}function tA(n,e,t){let i,s,l,o;Ke(n,Ms,M=>t(14,s=M)),Ke(n,wo,M=>t(15,l=M)),Ke(n,Lt,M=>t(16,o=M)),tn(Lt,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const M=await he.settings.getAll()||{};_(M)}catch(M){he.errorResponseHandler(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await he.settings.update(z.filterRedactedProps(a));_(M),Yt("Successfully saved application settings.")}catch(M){he.errorResponseHandler(M)}t(2,f=!1)}}function _(M={}){var E,A;tn(wo,l=(E=M==null?void 0:M.meta)==null?void 0:E.appName,l),tn(Ms,s=!!((A=M==null?void 0:M.meta)!=null&&A.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=gt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,m,g,r,d,b,k,$,T,C,O]}class nA extends ve{constructor(e){super(),be(this,e,tA,eA,_e,{})}}function iA(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=qe(l,s[o]);return{c(){e=y("input"),ti(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ue(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){ti(e,l=$t(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ue(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function sA(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=qe(a,r[u]);return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=y("input"),h(t,"type","button"),h(t,"class","btn btn-transparent btn-circle"),h(e,"class","form-field-addon"),ti(s,a)},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ee(Ue.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ti(s,a=$t(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Ae(o)}}}function lA(n){let e;function t(l,o){return l[3]?sA:iA}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function oA(n,e,t){const i=["value","mask"];let s=Ge(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await un(),r==null||r.focus()}const f=()=>u();function d(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=qe(qe({},e),Ut(m)),t(5,s=Ge(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,d,p]}class fu extends ve{constructor(e){super(),be(this,e,oA,lA,_e,{value:0,mask:1})}}function rA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=U("Subject"),s=D(),l=y("input"),r=D(),a=y("div"),u=U(`Available placeholder paramete
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
2023-04-13 20:38:12 +08:00
`,m=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),S(b,l,k),ue(l,n[0].subject),S(b,r,k),S(b,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),_||(g=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],_=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&h(e,"for",i),k[1]&1&&o!==(o=b[31])&&h(l,"id",o),k[0]&1&&l.value!==b[0].subject&&ue(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),_=!1,Ae(g)}}}function aA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return{c(){e=y("label"),t=U("Action URL"),s=D(),l=y("input"),r=D(),a=y("div"),u=U(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=U(`,
`),_=y("button"),_.textContent=`{TOKEN}
2023-04-13 20:38:12 +08:00
`,g=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(_,"title","Required parameter"),h(a,"class","help-block")},m($,T){S($,e,T),v(e,t),S($,s,T),S($,l,T),ue(l,n[0].actionUrl),S($,r,T),S($,a,T),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),b||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(_,"click",n[19])],b=!0)},p($,T){T[1]&1&&i!==(i=$[31])&&h(e,"for",i),T[1]&1&&o!==(o=$[31])&&h(l,"id",o),T[0]&1&&l.value!==$[0].actionUrl&&ue(l,$[0].actionUrl)},d($){$&&w(e),$&&w(s),$&&w(l),$&&w(r),$&&w(a),b=!1,Ae(k)}}}function uA(n){let e,t,i,s;return{c(){e=y("textarea"),h(e,"id",t=n[31]),h(e,"class","txt-mono"),h(e,"spellcheck","false"),h(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),ue(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&h(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:Q,o:Q,d(l){l&&w(e),i=!1,s()}}}function fA(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>me(e,"value",l))),{c(){e&&H(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ye(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>me(e,"value",l)),H(e.$$.fragment),I(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&V(e,a)}}}function cA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C;const O=[fA,uA],M=[];function E(A,L){return A[4]&&!A[5]?0:1}return l=E(n),o=M[l]=O[l](n),{c(){e=y("label"),t=U("Body (HTML)"),s=D(),o.c(),r=D(),a=y("div"),u=U(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=U(`,
`),_=y("button"),_.textContent=`{TOKEN}
`,g=U(`,
`),b=y("button"),b.textContent=`{ACTION_URL}
2023-04-13 20:38:12 +08:00
`,k=U("."),h(e,"for",i=n[31]),h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(b,"type","button"),h(b,"class","label label-sm link-primary txt-mono"),h(b,"title","Required parameter"),h(a,"class","help-block")},m(A,L){S(A,e,L),v(e,t),S(A,s,L),M[l].m(A,L),S(A,r,L),S(A,a,L),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),v(a,b),v(a,k),$=!0,T||(C=[J(f,"click",n[22]),J(p,"click",n[23]),J(_,"click",n[24]),J(b,"click",n[25])],T=!0)},p(A,L){(!$||L[1]&1&&i!==(i=A[31]))&&h(e,"for",i);let F=l;l=E(A),l===F?M[l].p(A,L):(re(),P(M[F],1,1,()=>{M[F]=null}),ae(),o=M[l],o?o.p(A,L):(o=M[l]=O[l](A),o.c()),I(o,1),o.m(r.parentNode,r))},i(A){$||(I(o),$=!0)},o(A){P(o),$=!1},d(A){A&&w(e),A&&w(s),M[l].d(A),A&&w(r),A&&w(a),T=!1,Ae(C)}}}function dA(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[rA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[aA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[cA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(r,a){j(e,r,a),S(r,t,a),j(i,r,a),S(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){V(e,r),r&&w(t),V(i,r),r&&w(s),V(l,r)}}}function Sh(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function pA(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Sh();return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),l=U(n[2]),o=D(),r=y("div"),a=D(),f&&f.c(),u=Se(),h(t,"class","ri-draft-line"),h(s,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),S(d,o,p),S(d,r,p),S(d,a,p),f&&f.m(d,p),S(d,u,p)},p(d,p){p[0]&4&&le(l,d[2]),d[6]?f?p[0]&64&&I(f,1):(f=Sh(),f.c(),I(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(d){d&&w(e),d&&w(o),d&&w(r),d&&w(a),f&&f.d(d),d&&w(u)}}}function mA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[pA],default:[dA]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=qe(s,i[l]);return e=new po({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){H(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?$t(i,[Wt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),V(e,l)}}}let $h;function hA(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Ge(e,s),o;Ke(n,_i,X=>t(12,o=X));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=$h,p=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){d||p||(t(5,p=!0),t(4,d=(await at(()=>import("./CodeEditor-e54123d6.js"),["./CodeEditor-e54123d6.js","./index-6f704b4c.js"],import.meta.url)).default),$h=d,t(5,p=!1))}function k(X){z.copyToClipboard(X),Qg(`Copied ${X} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function O(){u.action
<span class="txt">Send test email</span>`,h(e,"type","button"),h(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function FA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),l.textContent="Save changes",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],h(l,"class","txt"),h(s,"type","submit"),h(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=[J(e,"click",n[24]),J(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Ae(a)}}}function RA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[TA,$A],$=[];function T(C,O){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=U(n[5]),r=D(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",d=D(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,O){S(C,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,O),S(C,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",pt(n[27])),g=!0)},p(C,O){(!_||O[0]&32)&&le(o,C[5]);let M=p;p=T(C),p===M?$[p].p(C,O):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,O):(m=$[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function qA(n){let e,t,i,s,l,o;e=new Fi({}),i=new En({props:{$$slots:{default:[RA]},$$scope:{ctx:n}}});let r={};return l=new SA({props:r}),n[28](l),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&w(t),V(i,a),a&&w(s),n[28](null),V(l,a)}}}function jA(n,e,t){let i,s,l;Ke(n,Lt,ie=>t(5,l=ie));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];tn(Lt,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;m();async function m(){t(2,d=!0);try{const ie=await he.settings.getAll()||{};g(ie)}catch(ie){he.errorResponseHandler(ie)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const ie=await he.settings.update(z.filterRedactedProps(f));g(ie),fn({}),Yt("Successfully saved mail settings.")}catch(ie){he.errorResponseHandler(ie)}t(3,p=!1)}}function g(ie={}){t(0,f={meta:(ie==null?void 0:ie.meta)||{},smtp:(ie==null?void 0:ie.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function T(ie){n.$$.not_equal(f.meta.verificationTemplate,ie)&&(f.meta.verificationTemplate=ie,t(0,f))}function C(ie){n.$$.not_equal(f.meta.resetPasswordTemplate,ie)&&(f.meta.resetPasswordTemplate=ie,t(0,f))}function O(ie){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ie)&&(f.meta.confirmEmailChangeTemplate=ie,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=gt(this.value),t(0,f)}function L(ie){n.$$.not_equal(f.smtp.tls,ie)&&(f.smtp.tls=ie,t(0,f))}function F(ie){n.$$.not_equal(f.smtp.authMethod,ie)&&(f.smtp.authMethod=ie,t(0,f))}function R(){f.smtp.username=this.value,t(0,f)}function N(ie){n.$$.not_equal(f.smtp.password,ie)&&(f.smtp.password=ie,t(0,f))}const q=()=>b(),Y=()=>_(),B=()=>a==null?v
the
`),r=y("strong"),u=U(a),f=U(`
to the
`),d=y("strong"),m=U(p),_=U(`.
`),g=y("br"),b=U(`
There are numerous command line tools that can help you, such as:
`),k=y("a"),k.textContent=`rclone
2023-04-13 20:38:12 +08:00
`,$=U(`,
`),T=y("a"),T.textContent=`s5cmd
2023-04-13 20:38:12 +08:00
`,C=U(", etc."),O=D(),M=y("div"),h(i,"class","icon"),h(k,"href","https://github.com/rclone/rclone"),h(k,"target","_blank"),h(k,"rel","noopener noreferrer"),h(k,"class","txt-bold"),h(T,"href","https://github.com/peak/s5cmd"),h(T,"target","_blank"),h(T,"rel","noopener noreferrer"),h(T,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(M,"class","clearfix m-t-base")},m(F,R){S(F,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,d),v(d,m),v(l,_),v(l,g),v(l,b),v(l,k),v(l,$),v(l,T),v(l,C),v(e,O),v(e,M),A=!0},p(F,R){var N;(!A||R&1)&&a!==(a=(N=F[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!A||R&2)&&p!==(p=F[1].s3.enabled?"S3 storage":"local file system")&&le(m,p)},i(F){A||(F&&tt(()=>{A&&(E||(E=Ve(e,St,{duration:150},!0)),E.run(1))}),A=!0)},o(F){F&&(E||(E=Ve(e,St,{duration:150},!1)),E.run(0)),A=!1},d(F){F&&w(e),F&&E&&E.end()}}}function Dh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M;return i=new de({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[UA,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[WA,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"s3.region",$$slots:{default:[YA,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[KA,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[JA,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[ZA,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),r=D(),a=y("div"),H(u.$$.fragment),f=D(),d=y("div"),H(p.$$.fragment),m=D(),_=y("div"),H(g.$$.fragment),b=D(),k=y("div"),H($.$$.fragment),T=D(),C=y("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(d,"class","col-lg-6"),h(_,"class","col-lg-6"),h(k,"class","col-lg-12"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(E,A){S(E,e,A),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),v(e,a),j(u,a,null),v(e,f),v(e,d),j(p,d,null),v(e,m),v(e,_),j(g,_,null),v(e,b),v(e,k),j($,k,null),v(e,T),v(e,C),M=!0},p(E,A){const L={};A&100663298&&(L.$$scope={dirty:A,ctx:E}),i.$set(L);const F={};A&100663298&&(F.$$scope={dirty:A,ctx:E}),o.$set(F);const R={};A&100663298&&(R.$$scope={dirty:A,ctx:E}),u.$set(R);const N={};A&100663298&&(N.$$scope={dirty:A,ctx:E}),p.$set(N);const q={};A&100663298&&(q.$$scope={dirty:A,ctx:E}),g.$set(q);const Y={};A&100663298&&(Y.$$scope={dirty:A,ctx:E}),$.$set(Y)},i(E){M||(I(i.$$.fragment,E),I(o.$$.fragment,E),I(u.$$.fragment,E),I(p.$$.fragment,E),I(g.$$.fragment,E),I($.$$.fragment,E),E&&tt(()=>{M&&(O||(O=Ve(e,St,{duration:150},!0)),O.run(1))}),M=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(p.$$.fragment,E),P(g.$$.fragment,E),P($.$$.fragment,E),E&&(O||(O=Ve(e,St,{duration:150},!1)),O.run(0)),M=!1},d(E){E&&w(e),V(i),V(o),V(u),V(p),V(g),V($),E&&O&&O.end()}}}function UA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Endpoint"),s=D(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function WA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Bucket"),s=D(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[2
<span class="txt">S3 connected successfully</span>`,h(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function XA(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,h(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ee(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&zt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function QA(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Ih(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function xA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[zA,HA],$=[];function T(C,O){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=U(n[7]),r=D(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,d=D(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,O){S(C,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,O),S(C,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",pt(n[20])),g=!0)},p(C,O){(!_||O&128)&&le(o,C[7]);let M=p;p=T(C),p===M?$[p].p(C,O):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,O):(m=$[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function e6(n){let e,t,i,s;return e=new Fi({}),i=new En({props:{$$slots:{default:[xA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&w(t),V(i,l)}}}const oo="s3_test_request";function t6(n,e,t){let i,s,l;Ke(n,Lt,N=>t(7,l=N)),tn(Lt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null,p=null;m();async function m(){t(2,a=!0);try{const N=await he.settings.getAll()||{};g(N)}catch(N){he.errorResponseHandler(N)}t(2,a=!1)}async function _(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(oo);const N=await he.settings.update(z.filterRedactedProps(r));fn({}),await g(N),Da(),d?uy("Successfully saved but failed to establish S3 connection."):Yt("Successfully saved files storage settings.")}catch(N){he.errorResponseHandler(N)}t(3,u=!1)}}async function g(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,d=null),!!r.s3.enabled){he.cancelRequest(oo),clearTimeout(p),p=setTimeout(()=>{he.cancelRequest(oo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await he.settings.testS3({$cancelKey:oo})}catch(N){t(5,d=N)}t(4,f=!1),clearTimeout(p)}}Xt(()=>()=>{clearTimeout(p)});function $(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function O(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function E(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function A(){r.s3.forcePathStyle=this.checked,t(1,r)}const L=()=>b(),F=()=>_(),R=()=>_();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,d,s,l,_,b,i,$,T,C,O,M,E,A,L,F,R]}class n6 extends ve{constructor(e){super(),be(this,e,t6,e6,_e,{})}}function i6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[20]),h(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[1].enabled,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&h(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function s6(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Client ID"),s=D(),l=y("input"),h(e,"for",i=n[20]),h(l,"type","text"),h(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[1].clientId),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d&1048576&&i!==(i=f[20])&&h(e,"for",i),d&1048576&&o!==(o=f[20])&&h(l,"id",o),d&2&&r!==(r=f[1].enabled)&&(l.required=r),d&2&&l.value!==f[1].clientId&&ue(l,f[1].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function l6(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new fu({props:u}),se.push(()=>me(l,"value",a)),{c(){e=y("label"),t=U("Client secret"),s=D(),H(l.$$.fragment),h(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),j(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&h(e,"for"
another PocketBase environment.</p>`,t=D(),i=y("div"),s=y("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),H(o.$$.fragment),r=D(),a=y("div"),u=y("div"),f=D(),d=y("button"),d.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,h(e,"class","content txt-xl m-b-base"),h(s,"type","button"),h(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),h(i,"tabindex","0"),h(i,"class","export-preview svelte-jm5c4z"),h(u,"class","flex-fill"),h(d,"type","button"),h(d,"class","btn btn-expanded"),h(a,"class","flex m-t-base")},m(g,b){S(g,e,b),S(g,t,b),S(g,i,b),v(i,s),v(i,l),j(o,i,null),n[8](i),S(g,r,b),S(g,a,b),v(a,u),v(a,f),v(a,d),p=!0,m||(_=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],m=!0)},p(g,b){const k={};b&4&&(k.content=g[2]),o.$set(k)},i(g){p||(I(o.$$.fragment,g),p=!0)},o(g){P(o.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(t),g&&w(i),V(o),n[8](null),g&&w(r),g&&w(a),m=!1,Ae(_)}}}function D6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function A6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[D6,E6],_=[];function g(b,k){return b[1]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=U(n[3]),r=D(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k&8)&&le(o,b[3]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),I(d,1),d.m(u,null))},i(b){p||(I(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function I6(n){let e,t,i,s;return e=new Fi({}),i=new En({props:{$$slots:{default:[A6]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&w(t),V(i,l)}}}function P6(n,e,t){let i,s;Ke(n,Lt,b=>t(3,s=b)),tn(Lt,s="Export collections",s);const l="export_"+z.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await he.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){he.errorResponseHandler(b)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function d(){z.copyToClipboard(i),Qg("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function m(b){se[b?"unshift":"push"](()=>{o=b,t(0,o)})}const _=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const k=window.getSelection(),$=document.createRange();$.selectNodeContents(o),k.removeAllRanges(),k.addRange($)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,m,_,g]}class L6 extends ve{constructor(e){super(),be(this,e,P6,I6,_e,{})}}function Yh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Kh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Gh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Qh(n,e,t){const i=n.slice();return i[30]=e[t],i}function N6(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&xh(),a=n[0].name!==n[1].name&&e_(n);return{c(){e=y("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=y("strong"),o=U(l),h(s,"class","txt"),h(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[9]?r||(r=xh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=e_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function F6(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=D(),i=y("strong"),l=U(s),h(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=
<th width="10%" class="svelte-lmkr38">Old</th>
2023-04-13 20:38:12 +08:00
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=y("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=D(),g&&g.c(),a=D();for(let C=0;C<k.length;C+=1)k[C].c();u=D();for(let C=0;C<T.length;C+=1)T[C].c();h(e,"class","section-title"),h(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,O){S(C,e,O),p.m(e,null),S(C,t,O),S(C,i,O),v(i,s),v(i,l),v(i,o);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(o,null);v(o,r),g&&g.m(o,null),v(o,a);for(let M=0;M<k.length;M+=1)k[M]&&k[M].m(o,null);v(o,u);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(o,null)},p(C,O){if(d===(d=f(C))&&p?p.p(C,O):(p.d(1),p=d(C),p&&(p.c(),p.m(e,null))),O[0]&7203){m=C[11];let M;for(M=0;M<m.length;M+=1){const E=Qh(C,m,M);_[M]?_[M].p(E,O):(_[M]=t_(E),_[M].c(),_[M].m(o,r))}for(;M<_.length;M+=1)_[M].d(1);_.length=m.length}if(C[2]||C[5]?g?g.p(C,O):(g=n_(C),g.c(),g.m(o,a)):g&&(g.d(1),g=null),O[0]&4248){b=C[7];let M;for(M=0;M<b.length;M+=1){const E=Jh(C,b,M);k[M]?k[M].p(E,O):(k[M]=r_(E),k[M].c(),k[M].m(o,u))}for(;M<k.length;M+=1)k[M].d(1);k.length=b.length}if(O[0]&4352){$=C[8];let M;for(M=0;M<$.length;M+=1){const E=Yh(C,$,M);T[M]?T[M].p(E,O):(T[M]=u_(E),T[M].c(),T[M].m(o,null))}for(;M<T.length;M+=1)T[M].d(1);T.length=$.length}},i:Q,o:Q,d(C){C&&w(e),p.d(),C&&w(t),C&&w(i),dt(_,C),g&&g.d(),dt(k,C),dt(T,C)}}}function Nn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function mn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function j6(n,e,t){let i,s,l,{collectionA:o=new bn}=e,{collectionB:r=new bn}=e,{deleteMissing:a=!1}=e,u=[],f=[],d=[],p=[],m=[];const _=Object.keys(new bn().$export()).filter(k=>!["schema","created","updated"].includes(k));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find($=>k.id==$.id))))}function b(k){return typeof k>"u"?"":z.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,d=u.filter(k=>!f.find($=>k.id==$.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find($=>$.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find($=>$.id==k.id))),n.$$.dirty[0]&7&&t(9,l=z.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,b]}class V6 extends ve{constructor(e){super(),be(this,e,j6,q6,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function f_(n,e,t){const i=n.slice();return i[17]=e[t],i}function c_(n){let e,t;return e=new V6({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function H6(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=c_(f_(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=f_(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=c_(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){dt(s,o),o&&w(e)}}}function z6(n){let e;return{c(){e=y("h4"),e.textContent="Side-by-side diff",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function B6(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=U("Close"),i=D(),s=y("button"),l=y("span"),l.textContent="Confirm and import",h(e,"type","button"),h(e,"class","btn btn-t
- ${C.join(`
2023-04-13 20:38:12 +08:00
- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),Yt("Successfully imported collections configuration."),i("submit")}catch(C){he.errorResponseHandler(C)}t(4,u=!1),d()}}const g=()=>m(),b=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function $(C){pe.call(this,n,C)}function T(C){pe.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,m,f,l,o,g,b,k,$,T]}class Y6 extends ve{constructor(e){super(),be(this,e,W6,U6,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function d_(n,e,t){const i=n.slice();return i[32]=e[t],i}function p_(n,e,t){const i=n.slice();return i[35]=e[t],i}function m_(n,e,t){const i=n.slice();return i[32]=e[t],i}function K6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,E;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[Z6,({uniqueId:q})=>({40:q}),({uniqueId:q})=>[0,q?512:0]]},$$scope:{ctx:n}}});let A=!1,L=n[6]&&n[1].length&&!n[7]&&__(),F=n[6]&&n[1].length&&n[7]&&g_(n),R=n[13].length&&O_(n),N=!!n[0]&&E_(n);return{c(){e=y("input"),t=D(),i=y("div"),s=y("p"),l=U(`Paste below the collections configuration you want to import or
`),o=y("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),H(a.$$.fragment),u=D(),f=D(),L&&L.c(),d=D(),F&&F.c(),p=D(),R&&R.c(),m=D(),_=y("div"),N&&N.c(),g=D(),b=y("div"),k=D(),$=y("button"),T=y("span"),T.textContent="Review",h(e,"type","file"),h(e,"class","hidden"),h(e,"accept",".json"),h(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),h(i,"class","content txt-xl m-b-base"),h(b,"class","flex-fill"),h(T,"class","txt"),h($,"type","button"),h($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=C=!n[14],h(_,"class","flex m-t-base")},m(q,Y){S(q,e,Y),n[19](e),S(q,t,Y),S(q,i,Y),v(i,s),v(s,l),v(s,o),S(q,r,Y),j(a,q,Y),S(q,u,Y),S(q,f,Y),L&&L.m(q,Y),S(q,d,Y),F&&F.m(q,Y),S(q,p,Y),R&&R.m(q,Y),S(q,m,Y),S(q,_,Y),N&&N.m(_,null),v(_,g),v(_,b),v(_,k),v(_,$),v($,T),O=!0,M||(E=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(q,Y){(!O||Y[0]&4096)&&x(o,"btn-loading",q[12]);const B={};Y[0]&64&&(B.class="form-field "+(q[6]?"":"field-error")),Y[0]&65|Y[1]&1536&&(B.$$scope={dirty:Y,ctx:q}),a.$set(B),q[6]&&q[1].length&&!q[7]?L||(L=__(),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),q[6]&&q[1].length&&q[7]?F?F.p(q,Y):(F=g_(q),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),q[13].length?R?R.p(q,Y):(R=O_(q),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),q[0]?N?N.p(q,Y):(N=E_(q),N.c(),N.m(_,g)):N&&(N.d(1),N=null),(!O||Y[0]&16384&&C!==(C=!q[14]))&&($.disabled=C)},i(q){O||(I(a.$$.fragment,q),I(A),O=!0)},o(q){P(a.$$.fragment,q),P(A),O=!1},d(q){q&&w(e),n[19](null),q&&w(t),q&&w(i),q&&w(r),V(a,q),q&&w(u),q&&w(f),L&&L.d(q),q&&w(d),F&&F.d(q),q&&w(p),R&&R.d(q),q&&w(m),q&&w(_),N&&N.d(),M=!1,Ae(E)}}}function J6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function h_(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",h(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Z6(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&h_();return{c(){e=y("label"),t=U("Collections"),s=D(),l=y("textarea"),r=D(),d&&d.c(),a=Se(),h(e,"for",i=n[40]),h(e,"class","p-b-10"),h(l,"id",o=n[40]),h(l,"class","code"),h(l,"spellcheck","false"),h(l,"rows","15"),l.required=!0},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0]),S(p,r,m),d&&d.m(p,m),S(p,a,m),u||(f=J(l,"input",n[22]),u=!0)},p(p,m){m[1]&512&&i!==(i=p[40])&&h(e,"for",i),m[1]&512&&o!==(o=p[40])&&h(l,"id",o),m[0]&1&&ue(l,p[0]),p[0]&&!p[6]?d||(d=h_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),d&&d.d(p),p&&w(a),u=!1,f()}}}function __(n){let e;return{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,h(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function g_(n){let e,t,i,s,l,o=n[9].length&&b_(n),r=n[4].length&&k_(n),a=n[8].length&&T_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=D(),i=y("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),h(e,"class","section-title"),h(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=b_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=k_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=T_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function b_(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=m_(n,s,o),a=l(r);t.set(a,e[o]=y_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=kt(e,r,l,1,o,s,t,i.parentNode,is,y_,i,m_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function v_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function y_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&v_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Deleted",s=D(),l=y("strong"),r=U(o),a=D(),f&&f.c(),u=D(),h(i,"class","label label-danger list-label svelte-1jx20fl"),h(t,"class","list-item"),this.first=t},m(d,p){S(d,t,p),v(t,i),v(t,s),v(t,l),v(l,r),v(t,a),f&&f.m(t,null),v(t,u)},p(d,p){e=d,p[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,p):(f=v_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function k_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=p_(n,s,o),a=l(r);t.set(a,e[o]=$_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=kt(e,r,l,1,o,s,t,i.parentNode,is,$_,i,p_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function w_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=y("strong"),i=U(t),s=D(),l=y("i"),h(e,"class","txt-strikethrough txt-hint"),h(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),v(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function S_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function $_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,d,p=e[35].old.name!==e[35].new.name&&w_(e),m=e[35].new.id&&S_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Changed",s=D(),l=y("div"),p&&p.c(),o=D(),r=y("strong"),u=U(a),f=D(),m&&m.c(),d=D(),h(i,"class","label label-warning list-label svelte-1jx20fl"),h(l,"class","inline-flex flex-gap-5"),h(t,"class","list-item"),this.first=t},m(_,g){S(_,t,g),v(t,i),v(t,s),v(t,l),p&&p.m(l,null),v(l,o),v(l,r),v(r,u),v(l,f),m&&m.m(l,null),v(t,d)},p(_,g){e=_,e[35].old.name!==e[35].new.name?p?p.p(e,g):(p=w_(e),p.c(),p.m(l,o)):p&&(p.d(1),p=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,g):(m=S_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(_){_&&w(t),p&&p.d(),m&&m.d()}}}function T_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=d_(n,s,o),a=l(r);t.set(a,e[o]=M_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=kt(e,r,l,1,o,s,t,i.parentNode,is,M_,i,d_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function C_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r
imported with different IDs. You can replace them in the import if you want
2023-04-13 20:38:12 +08:00
to.</string>`,l=D(),o=y("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',h(t,"class","icon"),h(s,"class","content"),h(o,"type","button"),h(o,"class","btn btn-warning btn-sm btn-outline"),h(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:Q,d(u){u&&w(e),r=!1,a()}}}function E_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',h(e,"type","button"),h(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function G6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[J6,K6],_=[];function g(b,k){return b[5]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=U(n[15]),r=D(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k[0]&32768)&&le(o,b[15]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),I(d,1),d.m(u,null))},i(b){p||(I(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function X6(n){let e,t,i,s,l,o;e=new Fi({}),i=new En({props:{$$slots:{default:[G6]},$$scope:{ctx:n}}});let r={};return l=new Y6({props:r}),n[27](l),l.$on("submit",n[28]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&w(t),V(i,a),a&&w(s),n[27](null),V(l,a)}}}function Q6(n,e,t){let i,s,l,o,r,a,u;Ke(n,Lt,X=>t(15,u=X)),tn(Lt,u="Import collections",u);let f,d,p="",m=!1,_=[],g=[],b=!0,k=[],$=!1;T();async function T(){t(5,$=!0);try{t(2,g=await he.collections.getFullList(200));for(let X of g)delete X.created,delete X.updated}catch(X){he.errorResponseHandler(X)}t(5,$=!1)}function C(){if(t(4,k=[]),!!i)for(let X of _){const fe=z.findByKey(g,"id",X.id);!(fe!=null&&fe.id)||!z.hasCollectionChanges(fe,X,b)||k.push({new:X,old:fe})}}function O(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=z.filterDuplicatesByKey(_)):t(1,_=[]);for(let X of _)delete X.created,delete X.updated,X.schema=z.filterDuplicatesByKey(X.schema)}function M(){var X,fe;for(let G of _){const ce=z.findByKey(g,"name",G.name)||z.findByKey(g,"id",G.id);if(!ce)continue;const ge=G.id,Me=ce.id;G.id=Me;const je=Array.isArray(ce.schema)?ce.schema:[],He=Array.isArray(G.schema)?G.schema:[];for(const we of He){const Ce=z.findByKey(je,"name",we.name);Ce&&Ce.id&&(we.id=Ce.id)}for(let we of _)if(Array.isArray(we.schema))for(let Ce of we.schema)(X=Ce.options)!=null&&X.collectionId&&((fe=Ce.options)==null?void 0:fe.collectionId)===ge&&(Ce.options.collectionId=Me)}t(0,p=JSON.stringify(_,null,4))}function E(X){t(12,m=!0);const fe=new FileReader;fe.onload=async G=>{t(12,m=!1),t(10,f.value="",f),t(0,p=G.target.result),await un(),_.length||(ml("Invalid collections configuration."),A())},fe.onerror=G=>{console.warn(G),ml("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(X)}function A(){t(0,p=""),t(10,f.value="",f),fn({})}function L(X){se[X?"unshift":"push"](()=>{f=X,t(10,f)})}const F=()=>{f.files.length&&E(f.files[0])},R=()=>{f.click()};function N(){p=this.value,t(0,p)}function q(){b=this.checked,t(3,b)}const Y=()=>M(),B=()=>A(),Z=()=>d==null?void 0:d.show(g,_,b);function ee(X){se[X?"unshift":"push"](()=>{d=X,t(11,d)})}const ie=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&O(),n.$$.dirty[0]&3&&t(6,i=!!p&&_.length&&_.length===_.filter(X=>!!X.id&&!!X.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(X=>i&&b&&!z.findByKey(_,"id"
<span class="txt">Manage admins</span>`,t=D(),i=y("hr"),s=D(),l=y("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
2023-04-13 20:38:12 +08:00
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ee(ln.call(null,e)),J(l,"click",n[7])],o=!0)},p:Q,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Ae(r)}}}function P_(n){let e,t,i;return t=new uu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:z.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),j(t,e,null),i=!0},p:Q,i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),V(t)}}}function hI(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=z.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&I_(n);o=new Wb({props:{routes:eI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new aI({}),f=new pI({});let g=n[1]&&!n[2]&&P_(n);return{c(){t=D(),i=y("div"),_&&_.c(),s=D(),l=y("div"),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment),d=D(),g&&g.c(),p=Se(),h(l,"class","app-body"),h(i,"class","app-layout")},m(k,$){S(k,t,$),S(k,i,$),_&&_.m(i,null),v(i,s),v(i,l),j(o,l,null),v(l,r),j(a,l,null),S(k,u,$),j(f,k,$),S(k,d,$),g&&g.m(k,$),S(k,p,$),m=!0},p(k,[$]){var T;(!m||$&24)&&e!==(e=z.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(T=k[0])!=null&&T.id&&k[1]?_?(_.p(k,$),$&3&&I(_,1)):(_=I_(k),_.c(),I(_,1),_.m(i,s)):_&&(re(),P(_,1,1,()=>{_=null}),ae()),k[1]&&!k[2]?g?(g.p(k,$),$&6&&I(g,1)):(g=P_(k),g.c(),I(g,1),g.m(p.parentNode,p)):g&&(re(),P(g,1,1,()=>{g=null}),ae())},i(k){m||(I(_),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(g),m=!0)},o(k){P(_),P(o.$$.fragment,k),P(a.$$.fragment,k),P(f.$$.fragment,k),P(g),m=!1},d(k){k&&w(t),k&&w(i),_&&_.d(),V(o),V(a),k&&w(u),V(f,k),k&&w(d),g&&g.d(k),k&&w(p)}}}function _I(n,e,t){let i,s,l,o;Ke(n,Ms,g=>t(10,i=g)),Ke(n,wo,g=>t(3,s=g)),Ke(n,Ia,g=>t(0,l=g)),Ke(n,Lt,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var b,k,$,T;((b=g==null?void 0:g.detail)==null?void 0:b.location)!==r&&(t(1,a=!!(($=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&$.showAppSidebar)),r=(T=g==null?void 0:g.detail)==null?void 0:T.location,tn(Lt,o="",o),fn({}),nb())}function d(){Ii("/")}async function p(){var g,b;if(l!=null&&l.id)try{const k=await he.settings.getAll({$cancelKey:"initialAppSettings"});tn(wo,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),tn(Ms,i=!!((b=k==null?void 0:k.meta)!=null&&b.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){he.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,m,_]}class gI extends ve{constructor(e){super(),be(this,e,_I,hI,_e,{})}}new gI({target:document.getElementById("app")});export{Ae as A,Yt as B,z as C,Ii as D,Se as E,e1 as F,X_ as G,Xt as H,Ke as I,ii as J,wt as K,se as L,x1 as M,kt as N,is as O,Kt as P,dt as Q,bn as R,ve as S,qr as T,Vo as _,P as a,D as b,H as c,V as d,y as e,h as f,S as g,v as h,be as i,Ee as j,re as k,ln as l,j as m,ae as n,w as o,he as p,de as q,x as r,_e as s,I as t,J as u,pt as v,U as w,le as x,Q as y,ue as z};