var a0=Object.defineProperty;var f0=(n,e,t)=>e in n?a0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Je=(n,e,t)=>(f0(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const gs=n=>n;function Pe(n,e){for(const t in e)n[t]=e[t];return n}function u0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Cg(n){return n()}function Ga(){return Object.create(null)}function ve(n){n.forEach(Cg)}function Tt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ds;function en(n,e){return n===e?!0:(Ds||(Ds=document.createElement("a")),Ds.href=e,n===Ds.href)}function c0(n){return Object.keys(n).length===0}function oa(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Og(n){let e;return oa(n,t=>e=t)(),e}function Ue(n,e,t){n.$$.on_destroy.push(oa(e,t))}function vt(n,e,t,i){if(n){const l=Mg(n,e,t,i);return n[0](l)}}function Mg(n,e,t,i){return n[1]&&i?Pe(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r Configure common settings for sending emails. By default PocketBase uses the local file system to store uploaded files. If you have limited disk space, you could optionally connect to an S3 compatible storage. Adjust common token options.this.valueOf(),r=o?this:e,a=o?e:this,f=Ey(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?Pt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||je.fromObject({},{zone:this.zone}),i=e.padding?this PocketBase
Create your first admin account in order to continue
",i=O(),B(l.$$.fragment),s=O(),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),u=b("button"),u.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block btn-next"),x(u,"btn-disabled",n[3]),x(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),z(a,e,null),k(e,f),k(e,u),c=!0,d||(m=K(e,"submit",Be(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(u,"btn-disabled",h[3]),(!c||_&8)&&x(u,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),V(l),V(o),V(a),d=!1,m()}}}function wv(n,e,t){const i=st();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await fe.admins.create({email:l,password:s,passwordConfirm:o}),await fe.admins.authWithPassword(l,s),i("submit")}catch(d){fe.error(d)}t(3,r=!1)}}function f(){l=this.value,t(0,l)}function u(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,f,u,c]}class Sv extends ge{constructor(e){super(),_e(this,e,wv,vv,me,{})}}function Yf(n){let e,t;return e=new G1({props:{$$slots:{default:[$v]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $v(n){let e,t;return e=new Sv({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Tv(n){let e,t,i=n[0]&&Yf(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Yf(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(se(),A(i,1,1,()=>{i=null}),oe())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Cv(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){fe.logout(!1),t(0,i=!0);return}fe.authStore.isValid?tl("/collections"):fe.logout()}return[i,async()=>{t(0,i=!1),await Xt(),window.location.search=""}]}class Ov extends ge{constructor(e){super(),_e(this,e,Cv,Tv,me,{})}}const Dt=Cn(""),Oo=Cn(""),Xi=Cn(!1);function Mv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),ae(e,n[7]),i||(l=K(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&ae(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Dv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,f){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=Ot(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&8&&(u.extraAutocompleteKeys=a[3]),f&4&&(u.baseCollection=a[2]),f&3&&(u.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,u.value=a[7],ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Kf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Ne(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Jf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ye(()=>{i&&(t||(t=Ne(e,Pn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ne(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Ev(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Dv,Mv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Kf(),g=(n[0].length||n[7].length)&&Jf(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=O(),o.c(),r=O(),_&&_.c(),a=O(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),f=!0,u||(c=[K(e,"click",cn(n[11])),K(e,"submit",Be(n[10]))],u=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(se(),A(m[T],1,1,()=>{m[T]=null}),oe(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Kf(),_.c(),E(_,1),_.m(e,a)):_&&(se(),A(_,1,1,()=>{_=null}),oe()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=Jf(y),g.c(),E(g,1),g.m(e,null)):g&&(se(),A(g,1,1,()=>{g=null}),oe())},i(y){f||(E(o),E(_),E(g),f=!0)},o(y){A(o),A(_),A(g),f=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,ve(c)}}}function Iv(n,e,t){const i=st(),l="search_"+H.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=H.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,f,u=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){f||u||(t(5,u=!0),t(4,f=(await nt(()=>import("./FilterAutocompleteInput-afen32iE.js"),__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}jt(()=>{_()});function g(C){Te.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){ee[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,f,u,c,d,l,m,h,g,y,S,T,$]}class $s extends ge{constructor(e){super(),_e(this,e,Iv,Ev,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Av(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[we(l=Le.call(null,e,n[0])),K(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Tt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,ve(o)}}}function Lv(n,e,t){const i=st();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return jt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Zo extends ge{constructor(e){super(),_e(this,e,Lv,Av,me,{tooltip:0,class:1})}}function Nv(n){let e,t,i,l,s;const o=n[6].default,r=vt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),r&&r.m(e,null),i=!0,l||(s=[K(e,"click",n[7]),K(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&St(r,o,a,a[5],i?wt(o,a[5],f,null):$t(a[5]),null),(!i||f&4)&&p(e,"title",a[2]),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||f&10)&&x(e,"col-sort-disabled",a[3]),(!i||f&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,ve(s)}}}function Pv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function f(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const u=()=>f(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),f())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,f,l,i,u,c]}class $n extends ge{constructor(e){super(),_e(this,e,Pv,Nv,me,{class:1,name:2,sort:0,disable:3})}}const Fv=n=>({}),Zf=n=>({}),Rv=n=>({}),Gf=n=>({});function qv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=vt(f,n,n[10],Gf),c=n[11].default,d=vt(c,n,n[10],null),m=n[11].after,h=vt(m,n,n[10],Zf);return{c(){e=b("div"),u&&u.c(),t=O(),i=b("div"),d&&d.c(),s=O(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),u&&u.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&St(u,f,_,_[10],o?wt(f,_[10],g,Rv):$t(_[10]),Gf),d&&d.p&&(!o||g&1024)&&St(d,c,_,_[10],o?wt(c,_[10],g,null):$t(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&St(h,m,_,_[10],o?wt(m,_[10],g,Fv):$t(_[10]),Zf)},i(_){o||(E(u,_),E(d,_),E(h,_),o=!0)},o(_){A(u,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,ve(a)}}}function jv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:f=!0}=e,u=null,c="",d=null,m,h,_,g,y;function S(){u&&t(2,u.scrollTop=0,u)}function T(){u&&t(2,u.scrollLeft=0,u)}function $(){u&&(t(3,c=""),_=u.clientWidth+2,g=u.clientHeight+2,m=u.scrollWidth-_,h=u.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),u.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),u.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):f&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),u.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),u.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):f&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}jt(()=>(C(),y=new MutationObserver(C),y.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function M(D){ee[D?"unshift":"push"](()=>{u=D,t(2,u)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,f=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,u,c,r,a,f,S,T,$,l,i,M]}class Go extends ge{constructor(e){super(),_e(this,e,jv,qv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Hv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=Y(i),s=Y(" ("),o=Y(n[0]),r=Y(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){w(f,e,u),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(f,[u]){u&2&&i!==(i=(f[1]||"UNKN")+"")&&re(l,i),u&1&&re(o,f[0]),u&1&&a!==(a="label log-level-label level-"+f[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(f){f&&v(e)}}}function zv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=W1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class Q1 extends ge{constructor(e){super(),_e(this,e,zv,Hv,me,{level:0})}}function Vv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=we(Le.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&re(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Bv(n,e,t){let{date:i}=e;const l={get text(){return H.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class x1 extends ge{constructor(e){super(),_e(this,e,Bv,Vv,me,{date:0})}}function Xf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=t2(i[31]);return i[33]=s,i}function Qf(n,e,t){const i=n.slice();return i[36]=e[t],i}function Uv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=O(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,f){w(a,e,f),k(e,t),k(e,l),k(e,s),o||(r=K(t,"change",n[18]),o=!0)},p(a,f){f[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),f[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Wv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Yv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Jv(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xf(n){let e;function t(s,o){return s[7]?Gv:Zv}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function Zv(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&eu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=O(),o&&o.c(),s=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[0])!=null&&u.length?o?o.p(a,f):(o=eu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Gv(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function eu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function tu(n){let e,t=de(n[33]),i=[];for(let l=0;l n,x:n=>n.x,y:n=>n.y};function E2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function I2(n){const e=E2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Eo(n,e){return(cu[e]||(cu[e]=I2(e)))(n)}function Da(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Io=n=>typeof n<"u",Di=n=>typeof n=="function",du=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function A2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const sn=Math.PI,Un=2*sn,L2=Un+sn,Ao=Number.POSITIVE_INFINITY,N2=sn/180,Vn=sn/2,Ri=sn/4,pu=sn*2/3,Zr=Math.log10,Cl=Math.sign;function Ql(n,e,t){return Math.abs(n-e)=0&&eS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Tu(e,{x:_,y:h,w:f,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Tu(e,{x:g,y:h+1,w:f-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,f,a),e.strokeRect(_,h,f,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,f-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:f,boxPadding:u}=i,c=ti(i.bodyFont);let d=c.lineHeight,m=0;const h=_r(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,M,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xs(this,g,i),t.fillStyle=i.bodyColor,ht(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,$=0,M=l.length;$+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||kc(s.minUnit,t,i,this._getLabelCapacity(t)),r=yt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=us(a)||a===!0,u={};let c=t,d,m;if(f&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,f?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return Ft(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,f=this._majorUnit,u=a&&r[a],c=f&&r[f],d=i[t],m=f&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:u))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Yi(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Yi(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const f=o-s;return f?r+(a-r)*(e-s)/f:r}class wc extends ps{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Qs(t,this.min),this._tableRange=Qs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,f,u;for(o=0,r=e.length;o0
to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),ae(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),f||(u=K(s,"input",n[11]),f=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&<(s.value)!==c[1].logs.maxDays&&ae(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),f=!1,u()}}}function BS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new jb({}),{c(){e=b("label"),t=Y("Min log level"),l=O(),s=b("input"),o=O(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=O(),B(u.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),ae(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,f),z(u,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&<(s.value)!==h[1].logs.minLevel&&ae(s,h[1].logs.minLevel)},i(h){c||(E(u.$$.fragment,h),c=!0)},o(h){A(u.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),V(u),d=!1,m()}}}function US(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=Y("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[1].logs.logIp,w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function WS(n){let e,t,i,l;const s=[zS,HS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,f){o[e].m(a,f),w(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),A(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function YS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function KS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(f,u){w(f,e,u),k(e,t),w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(f,u){u&8&&(e.disabled=f[3]),u&40&&o!==(o=!f[5]||f[3])&&(l.disabled=o),u&8&&x(l,"btn-loading",f[3])},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function JS(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[KS],header:[YS],default:[WS]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function ZS(n,e,t){let i,l;const s=st(),o="logs_settings_"+H.randomString(3);let r,a=!1,f=!1,u={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const L=await fe.settings.getAll()||{};y(L)}catch(L){fe.error(L)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const L=await fe.settings.update(H.filterRedactedProps(c));y(L),t(3,a=!1),m(),At("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),fe.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=lt(this.value),t(1,c)}function T(){c.logs.minLevel=lt(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function M(L){ee[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Te.call(this,n,L)}function I(L){Te.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(u)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,f,l,o,g,d,u,i,S,T,$,C,M,D,I]}class GS extends ge{constructor(e){super(),_e(this,e,ZS,JS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function XS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=Y("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){w(f,e,u),e.checked=n[2],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&4&&(e.checked=f[2]),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Nc(n){let e,t;return e=new dS({props:{filter:n[1],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Pc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new i2({props:s}),ee.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function QS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$=n[4],C,M=n[4],D,I,L,R;f=new Zo({}),f.$on("refresh",n[10]),h=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[XS,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new $s({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new jb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=Nc(n),N=Pc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=Y(n[6]),o=O(),r=b("button"),r.innerHTML='',a=O(),B(f.$$.fragment),u=O(),c=b("div"),d=O(),m=b("div"),B(h.$$.fragment),_=O(),B(g.$$.fragment),y=O(),B(S.$$.fragment),T=O(),F.c(),C=O(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,j){w(P,e,j),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),z(f,t,null),k(t,u),k(t,c),k(t,d),k(t,m),z(h,m,null),k(e,_),z(g,e,null),k(e,y),z(S,e,null),k(e,T),F.m(e,null),w(P,C,j),N.m(P,j),w(P,D,j),I=!0,L||(R=[we(Le.call(null,r,{text:"Logs settings",position:"right"})),K(r,"click",n[9])],L=!0)},p(P,j){(!I||j&64)&&re(s,P[6]);const q={};j&12582916&&(q.$$scope={dirty:j,ctx:P}),h.$set(q);const W={};j&2&&(W.value=P[1]),g.$set(W),j&16&&me($,$=P[4])?(se(),A(F,1,1,Q),oe(),F=Nc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,j),j&16&&me(M,M=P[4])?(se(),A(N,1,1,Q),oe(),N=Pc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,j)},i(P){I||(E(f.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(f.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),V(f),V(h),V(g),V(S),F.d(P),N.d(P),L=!1,ve(R)}}}function xS(n){let e,t,i,l,s,o;e=new kn({props:{$$slots:{default:[QS]},$$scope:{ctx:n}}});let r={};i=new PS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new GS({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment),l=O(),B(s.$$.fragment)},m(f,u){z(e,f,u),w(f,t,u),z(i,f,u),w(f,l,u),z(s,f,u),o=!0},p(f,[u]){const c={};u&8388735&&(c.$$scope={dirty:u,ctx:f}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(f){o||(E(e.$$.fragment,f),E(i.$$.fragment,f),E(s.$$.fragment,f),o=!0)},o(f){A(e.$$.fragment,f),A(i.$$.fragment,f),A(s.$$.fragment,f),o=!1},d(f){f&&(v(t),v(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const xs="logId",Fc="adminRequests",Rc="adminLogRequests";function e$(n,e,t){var L;let i,l,s;Ue(n,jo,R=>t(19,l=R)),Ue(n,Dt,R=>t(6,s=R)),xt(Dt,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Fc)||((L=window.localStorage)==null?void 0:L.getItem(Rc)))<<0,d=c;function m(){t(4,f++,f)}function h(R={}){let F={};F.filter=u||null,F[Fc]=c<<0||null,H.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,u=R.detail);function T(R){u=R,t(1,u)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){ee[R?"unshift":"push"](()=>{r=R,t(0,r)})}const M=R=>{var N;let F={};F[xs]=((N=R.detail)==null?void 0:N.id)||null,H.replaceHashQueryParams(F)},D=()=>{let R={};R[xs]=null,H.replaceHashQueryParams(R)};function I(R){ee[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(xs)&&r&&r.show(o.get(xs)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(Rc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,y,S,T,$,C,M,D,I]}class t$ extends ge{constructor(e){super(),_e(this,e,e$,xS,me,{})}}function n$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-1g2t3dj"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[K(e,"mousedown",n[5]),K(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,ve(i)}}}function i$(n,e,t){const i=st();let{tolerance:l=0}=e,s,o=0,r=0,a=0,f=0,u=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,f=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){u&&(g.preventDefault(),t(1,u=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-f;!u&&Math.abs(T-s.offsetLeft)true
",_=O(),g=b("li"),g.innerHTML=""false" is converted to the json false
",y=O(),S=b("li"),S.innerHTML=""null" is converted to the json null
",T=O(),$=b("li"),$.innerHTML=""[1,2,3]" is converted to the json [1,2,3]
",C=O(),M=b("li"),I=Y(D),L=Y(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',F=O(),N=b("li"),N.textContent="numeric strings are converted to json number",P=O(),j=b("li"),j.textContent="double quoted strings are left as they are (aka. without normalizations)",q=O(),W=b("li"),W.textContent="any other string (empty string too) is double quoted",G=Y(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),U=b("code"),U.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ne,he){w(ne,e,he),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,f),k(i,u),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,M),k(M,I),k(M,L),k(M,R),k(m,F),k(m,N),k(m,P),k(m,j),k(m,q),k(m,W),k(i,G),k(i,U),le=!0},i(ne){le||(ne&&Ye(()=>{le&&(Z||(Z=Ne(e,et,{duration:150},!0)),Z.run(1))}),le=!0)},o(ne){ne&&(Z||(Z=Ne(e,et,{duration:150},!1)),Z.run(0)),le=!1},d(ne){ne&&v(e),ne&&Z&&Z.end()}}}function oC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new pe({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[iC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?sC:lC}let m=d(n),h=m(n),_=n[2]&&$d();return{c(){B(e.$$.fragment),t=O(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=O(),h.c(),r=O(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){z(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),f=!0,u||(c=K(i,"click",n[5]),u=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=$d(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(se(),A(_,1,1,()=>{_=null}),oe())},i(g){f||(E(e.$$.fragment,g),E(_),f=!0)},o(g){A(e.$$.fragment,g),A(_),f=!1},d(g){g&&(v(t),v(i),v(r),v(a)),V(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function rC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[oC]},$$scope:{ctx:n}};for(let r=0;r@request.headers.*
@request.query.*
@request.data.*
@request.auth.*
",m=O(),h=b("hr"),_=O(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=O(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*
",T=O(),$=b("hr"),C=O(),M=b("p"),M.innerHTML=`Example rule:
@request.auth.id != "" && created > "2022-01-01 00:00:00"
`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(u,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;Pcreate
and update
API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function t6(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=n[1]&&jd(n);function M(j){n[4](j)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),u=new $l({props:D}),ee.push(()=>be(u,"rule",M));function I(j){n[5](j)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new $l({props:L}),ee.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&zd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Bd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
PocketBase filter syntax and operators
.`,l=O(),s=b("button"),r=Y(o),a=O(),C&&C.c(),f=O(),B(u.$$.fragment),d=O(),B(m.$$.fragment),_=O(),R&&R.c(),g=O(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(j,q){w(j,e,q),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(j,f,q),z(u,j,q),w(j,d,q),z(m,j,q),w(j,_,q),R&&R.m(j,q),w(j,g,q),F&&F.m(j,q),w(j,y,q),S=!0,T||($=K(s,"click",n[3]),T=!0)},p(j,[q]){var U,Z;(!S||q&2)&&o!==(o=j[1]?"Hide available fields":"Show available fields")&&re(r,o),j[1]?C?(C.p(j,q),q&2&&E(C,1)):(C=jd(j),C.c(),E(C,1),C.m(e,null)):C&&(se(),A(C,1,1,()=>{C=null}),oe());const W={};q&1&&(W.collection=j[0]),!c&&q&1&&(c=!0,W.rule=j[0].listRule,ke(()=>c=!1)),u.$set(W);const G={};q&1&&(G.collection=j[0]),!h&&q&1&&(h=!0,G.rule=j[0].viewRule,ke(()=>h=!1)),m.$set(G),((U=j[0])==null?void 0:U.type)!=="view"?R?(R.p(j,q),q&1&&E(R,1)):(R=zd(j),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(se(),A(R,1,1,()=>{R=null}),oe()),((Z=j[0])==null?void 0:Z.type)==="auth"?F?(F.p(j,q),q&1&&E(F,1)):(F=Bd(j),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(se(),A(F,1,1,()=>{F=null}),oe())},i(j){S||(E(C),E(u.$$.fragment,j),E(m.$$.fragment,j),E(R),E(F),S=!0)},o(j){A(C),A(u.$$.fragment,j),A(m.$$.fragment,j),A(R),A(F),S=!1},d(j){j&&(v(e),v(f),v(d),v(_),v(g),v(y)),C&&C.d(),V(u,j),V(m,j),R&&R.d(j),F&&F.d(j),T=!1,$()}}}function n6(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class i6 extends ge{constructor(e){super(),_e(this,e,n6,t6,me,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function l6(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){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=Ot(o,r(n)),ee.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,f){e&&z(e,a,f),w(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){se();const u=e;A(u.$$.fragment,1,0,()=>{V(u,1)}),oe()}o?(e=Ot(o,r(a)),ee.push(()=>be(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),E(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ke(()=>t=!1)),e.$set(u)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function s6(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Wd(n){let e,t,i=de(n[3]),l=[];for(let s=0;s*
) are not supported.id
column.
If your query doesn't have a suitable one, you can use the universal
(ROW_NUMBER() OVER()) as id
.MAX(balance) as maxBalance
).'},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function O8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function M8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function vh(n){let e,t,i,l,s,o,r,a,f,u;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),f||(u=[K(i,"change",c),K(t,"click",cn(n[30]))],f=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),f=!1,ve(u)}}}function wh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new sl({props:{value:n[63].id}});let c=n[9]&&Sh(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=O(),o=b("div"),a=Y(r),f=O(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),z(l,i,null),k(i,s),k(i,o),k(o,a),k(t,f),c&&c.m(t,null),u=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!u||m[0]&8)&&r!==(r=d[63].id+"")&&re(a,r),d[9]?c?c.p(d,m):(c=Sh(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function Sh(n){let e;function t(s,o){return s[63].verified?E8:D8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function D8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function E8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=we(Le.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function $h(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Th(n),o=i&&Ch(n);return{c(){s&&s.c(),t=O(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Th(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Ch(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Th(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!H.isEmpty(o[63].username)),t?A8:I8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function I8(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&re(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function A8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ch(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!H.isEmpty(o[63].email)),t?N8:L8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function L8(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&re(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function N8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Oh(n,e){let t,i,l,s;return i=new Zb({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function Mh(n){let e,t,i;return t=new el({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Dh(n){let e,t,i;return t=new el({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Eh(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,f,u=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&vh(e),T=l&&wh(e),$=e[9]&&$h(e),C=de(e[19]);const M=F=>F[66].name;for(let F=0;F Loading collections...
',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function tE(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[J8,K8,Y8],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Ua({props:_}),n[31](l);let g={};o=new h5({props:g}),n[32](o);let y={collection:n[2]};a=new Ka({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return u=new _8({props:S}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=O(),B(l.$$.fragment),s=O(),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),B(u.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),z(l,T,$),w(T,s,$),z(o,T,$),w(T,r,$),z(a,T,$),w(T,f,$),z(u,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(se(),A(m[C],1,1,()=>{m[C]=null}),oe(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const M={};l.$set(M);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),u.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(u.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(u.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(f)),m[e].d(T),n[31](null),V(l,T),n[32](null),V(o,T),n[33](null),V(a,T),n[37](null),V(u,T)}}}function nE(n,e,t){let i,l,s,o,r,a,f;Ue(n,Kn,Me=>t(2,l=Me)),Ue(n,Dt,Me=>t(39,s=Me)),Ue(n,To,Me=>t(3,o=Me)),Ue(n,jo,Me=>t(16,r=Me)),Ue(n,Fn,Me=>t(11,a=Me)),Ue(n,Xi,Me=>t(12,f=Me));const u=new URLSearchParams(r);let c,d,m,h,_,g,y=u.get("filter")||"",S=u.get("sort")||"-created",T=u.get("collectionId")||(l==null?void 0:l.id),$=0;Z1(T);async function C(Me){await Xt(),(l==null?void 0:l.type)==="view"?h.show(Me):m==null||m.show(Me)}function M(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D()}async function D(){if(!S)return;const Me=H.getAllCollectionIdentifiers(l),Ee=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Ee.filter(ze=>Me.includes(ze)).length!=Ee.length&&(Me.includes("created")?t(1,S="-created"):t(1,S=""))}function I(Me={}){const Ee=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},Me);H.replaceHashQueryParams(Ee)}const L=()=>c==null?void 0:c.show();function R(Me){ee[Me?"unshift":"push"](()=>{g=Me,t(9,g)})}function F(Me){$=Me,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},j=()=>d==null?void 0:d.show(l),q=()=>m==null?void 0:m.show(),W=Me=>t(0,y=Me.detail);function G(Me){ee[Me?"unshift":"push"](()=>{_=Me,t(8,_)})}function U(Me){y=Me,t(0,y)}function Z(Me){S=Me,t(1,S)}const le=Me=>{I({recordId:Me.detail.id});let Ee=Me.detail._partial?Me.detail.id:Me.detail;l.type==="view"?h==null||h.show(Ee):m==null||m.show(Ee)},ne=()=>{g==null||g.reload()},he=()=>m==null?void 0:m.show();function Ae(Me){ee[Me?"unshift":"push"](()=>{c=Me,t(4,c)})}function He(Me){ee[Me?"unshift":"push"](()=>{d=Me,t(5,d)})}function Ge(Me){ee[Me?"unshift":"push"](()=>{m=Me,t(6,m)})}const xe=()=>{I({recordId:null})},Et=Me=>{y?g==null||g.reload():Me.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},dt=Me=>{(!y||_!=null&&_.hasRecord(Me.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function mt(Me){ee[Me?"unshift":"push"](()=>{h=Me,t(7,h)})}const Gt=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&nv(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&M(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&C(u.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(Dt,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,f,I,T,i,r,L,R,F,N,P,j,q,W,G,U,Z,le,ne,he,Ae,He,Ge,xe,Et,dt,mt,Gt]}class iE extends ge{constructor(e){super(),_e(this,e,nE,tE,me,{},null,[-1,-1])}}function qh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=O(),i=b("a"),i.innerHTML=' Export collections',l=O(),s=b("a"),s.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,l,f),w(a,s,f),o||(r=[we(An.call(null,i,{path:"/settings/export-collections/?.*"})),we(nn.call(null,i)),we(An.call(null,s,{path:"/settings/import-collections/?.*"})),we(nn.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,ve(r)}}}function lE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C,M=!n[0]&&qh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=O(),l=b("a"),l.innerHTML=' Application',s=O(),o=b("a"),o.innerHTML=' Mail settings',r=O(),a=b("a"),a.innerHTML=' Files storage',f=O(),u=b("a"),u.innerHTML=' Backups',c=O(),M&&M.c(),d=O(),m=b("div"),m.textContent="Authentication",h=O(),_=b("a"),_.innerHTML=' Auth providers',g=O(),y=b("a"),y.innerHTML=' Token options',S=O(),T=b("a"),T.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(u,"href","/settings/backups"),p(u,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,f),k(e,u),k(e,c),M&&M.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[we(An.call(null,l,{path:"/settings"})),we(nn.call(null,l)),we(An.call(null,o,{path:"/settings/mail/?.*"})),we(nn.call(null,o)),we(An.call(null,a,{path:"/settings/storage/?.*"})),we(nn.call(null,a)),we(An.call(null,u,{path:"/settings/backups/?.*"})),we(nn.call(null,u)),we(An.call(null,_,{path:"/settings/auth-providers/?.*"})),we(nn.call(null,_)),we(An.call(null,y,{path:"/settings/tokens/?.*"})),we(nn.call(null,y)),we(An.call(null,T,{path:"/settings/admins/?.*"})),we(nn.call(null,T))],$=!0)},p(D,I){D[0]?M&&(M.d(1),M=null):M||(M=qh(),M.c(),M.m(e,d))},d(D){D&&v(e),M&&M.d(),$=!1,ve(C)}}}function sE(n){let e,t;return e=new Hb({props:{class:"settings-sidebar",$$slots:{default:[lE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function oE(n,e,t){let i;return Ue(n,Xi,l=>t(0,i=l)),[i]}class _i extends ge{constructor(e){super(),_e(this,e,oE,sE,me,{})}}function jh(n,e,t){const i=n.slice();return i[31]=e[t],i}function Hh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[rE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new Kb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="id",o=O(),r=b("div"),B(a.$$.fragment),f=O(),u=b("input"),p(t,"class",H.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(u,"type","text"),p(u,"id",c=n[30]),u.value=d=n[1].id,u.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),z(a,r,null),w(h,f,_),w(h,u,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(u,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&u.value!==d)&&(u.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(f),v(u)),V(a)}}}function zh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=O(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(f,u){w(f,e,u),k(e,t),k(e,l),o||(r=K(e,"click",a),o=!0)},p(f,u){n=f,u[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(f){f&&v(e),o=!1,r()}}}function aE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Email",o=O(),r=b("input"),p(t,"class",H.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),ae(r,n[3]),f||(u=K(r,"input",n[19]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&ae(r,c[3])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function Vh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[fE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function fE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=O(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){w(f,e,u),e.checked=n[4],w(f,i,u),w(f,l,u),k(l,s),r||(a=K(e,"change",n[20]),r=!0)},p(f,u){u[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),u[0]&16&&(e.checked=f[4]),u[0]&1073741824&&o!==(o=f[30])&&p(l,"for",o)},d(f){f&&(v(e),v(i),v(l)),r=!1,a()}}}function Bh(n){let e,t,i,l,s,o,r,a,f;return l=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[uE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[cE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=O(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(u,c){w(u,e,c),k(e,t),k(t,i),z(l,i,null),k(t,s),k(t,o),z(r,o,null),f=!0},p(u,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:u}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:u}),r.$set(m)},i(u){f||(E(l.$$.fragment,u),E(r.$$.fragment,u),u&&Ye(()=>{f&&(a||(a=Ne(t,et,{duration:150},!0)),a.run(1))}),f=!0)},o(u){A(l.$$.fragment,u),A(r.$$.fragment,u),u&&(a||(a=Ne(t,et,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&v(e),V(l),V(r),u&&a&&a.end()}}}function uE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Jb({}),{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password",o=O(),r=b("input"),f=O(),u=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(u,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),ae(r,n[9]),w(_,f,g),w(_,u,g),z(c,u,null),d=!0,m||(h=K(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&ae(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(f),v(u)),V(c),m=!1,h()}}}function cE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=O(),l=b("span"),l.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),ae(r,n[10]),f||(u=K(r,"input",n[22]),f=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&ae(r,c[10])},d(c){c&&(v(e),v(o),v(r)),f=!1,u()}}}function dE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&Hh(n),_=de([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=zh(jh(n,_,T));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[aE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Vh(n),S=(n[5]||n[4])&&Bh(n);return{c(){e=b("form"),h&&h.c(),t=O(),i=b("div"),l=b("p"),l.textContent="Avatar",s=O(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=O(),B(a.$$.fragment),f=O(),y&&y.c(),u=O(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),z(a,e,null),k(e,f),y&&y.m(e,null),k(e,u),S&&S.m(e,null),c=!0,d||(m=K(e,"submit",Be(n[13])),d=!0)},p(T,$){if(T[5]?h&&(se(),A(h,1,1,()=>{h=null}),oe()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=Hh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=de([0,1,2,3,4,5,6,7,8,9]);let M;for(M=0;M<10;M+=1){const D=jh(T,_,M);g[M]?g[M].p(D,$):(g[M]=zh(D),g[M].c(),g[M].m(o,null))}for(;M<10;M+=1)g[M].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(se(),A(y,1,1,()=>{y=null}),oe()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=Vh(T),y.c(),E(y,1),y.m(e,u)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=Bh(T),S.c(),E(S,1),S.m(e,null)):S&&(se(),A(S,1,1,()=>{S=null}),oe())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),rt(g,T),V(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function pE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=Y(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&re(i,t)},d(l){l&&v(e)}}}function Uh(n){let e,t,i,l,s,o,r,a,f;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[mE]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=O(),l=b("i"),s=O(),B(o.$$.fragment),r=O(),a=b("div"),p(l,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){w(u,e,c),k(e,t),k(e,i),k(e,l),k(e,s),z(o,e,null),w(u,r,c),w(u,a,c),f=!0},p(u,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:u}),o.$set(d)},i(u){f||(E(o.$$.fragment,u),f=!0)},o(u){A(o.$$.fragment,u),f=!1},d(u){u&&(v(e),v(r),v(a)),V(o)}}}function mE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function hE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,f,u,c,d,m=!n[5]&&Uh(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",l=O(),s=b("button"),o=b("span"),a=Y(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=f=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),u=!0,c||(d=K(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(se(),A(m,1,1,()=>{m=null}),oe()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Uh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!u||_[0]&128)&&(t.disabled=h[7]),(!u||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&re(a,r),(!u||_[0]&2176&&f!==(f=!h[11]||h[7]))&&(s.disabled=f),(!u||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){u||(E(m),u=!0)},o(h){A(m),u=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function _E(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[hE],header:[pE],default:[dE]},$$scope:{ctx:n}};return e=new Zt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function gE(n,e,t){let i,l;const s=st(),o="admin_"+H.randomString(5);let r,a={},f=!1,u=!1,c=0,d="",m="",h="",_=!1;function g(G){return S(G),t(8,u=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(G){t(1,a=structuredClone(G||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Jt({})}function $(){if(f||!l)return;t(7,f=!0);const G={email:d,avatar:c};(i||_)&&(G.password=m,G.passwordConfirm=h);let U;i?U=fe.admins.create(G):U=fe.admins.update(a.id,G),U.then(async Z=>{var le;t(8,u=!1),y(),At(i?"Successfully created admin.":"Successfully updated admin."),((le=fe.authStore.model)==null?void 0:le.id)===Z.id&&fe.authStore.save(fe.authStore.token,Z),s("save",Z)}).catch(Z=>{fe.error(Z)}).finally(()=>{t(7,f=!1)})}function C(){a!=null&&a.id&&fn("Do you really want to delete the selected admin?",()=>fe.admins.delete(a.id).then(()=>{t(8,u=!1),y(),At("Successfully deleted admin."),s("delete",a)}).catch(G=>{fe.error(G)}))}const M=()=>C(),D=()=>y(),I=G=>t(2,c=G);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&u?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),y()}),!1):!0;function j(G){ee[G?"unshift":"push"](()=>{r=G,t(6,r)})}function q(G){Te.call(this,n,G)}function W(G){Te.call(this,n,G)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,f,u,m,h,l,o,$,C,g,M,D,I,L,R,F,N,P,j,q,W]}class bE extends ge{constructor(e){super(),_e(this,e,gE,_E,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Wh(n,e,t){const i=n.slice();return i[24]=e[t],i}function kE(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function vE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function wE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Yh(n){let e;function t(s,o){return s[5]?$E:SE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function SE(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Kh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=O(),o&&o.c(),s=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,f){var u;(u=a[1])!=null&&u.length?o?o.p(a,f):(o=Kh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function $E(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Kh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Jh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Zh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,M,D,I,L,R,F,N,P,j,q,W,G;u=new sl({props:{value:e[24].id}});let U=e[24].id===e[7].id&&Jh();I=new el({props:{date:e[24].created}}),F=new el({props:{date:e[24].updated}});function Z(){return e[15](e[24])}function le(...ne){return e[16](e[24],...ne)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=O(),a=b("td"),f=b("div"),B(u.$$.fragment),c=O(),d=b("span"),h=Y(m),_=O(),U&&U.c(),g=O(),y=b("td"),S=b("span"),$=Y(T),M=O(),D=b("td"),B(I.$$.fragment),L=O(),R=b("td"),B(F.$$.fragment),N=O(),P=b("td"),P.innerHTML='',j=O(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(f,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ne,he){w(ne,t,he),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,f),z(u,f,null),k(f,c),k(f,d),k(d,h),k(a,_),U&&U.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,M),k(t,D),z(I,D,null),k(t,L),k(t,R),z(F,R,null),k(t,N),k(t,P),k(t,j),q=!0,W||(G=[K(t,"click",Z),K(t,"keydown",le)],W=!0)},p(ne,he){e=ne,(!q||he&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Ae={};he&16&&(Ae.value=e[24].id),u.$set(Ae),(!q||he&16)&&m!==(m=e[24].id+"")&&re(h,m),e[24].id===e[7].id?U||(U=Jh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!q||he&16)&&T!==(T=e[24].email+"")&&re($,T),(!q||he&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};he&16&&(He.date=e[24].created),I.$set(He);const Ge={};he&16&&(Ge.date=e[24].updated),F.$set(Ge)},i(ne){q||(E(u.$$.fragment,ne),E(I.$$.fragment,ne),E(F.$$.fragment,ne),q=!0)},o(ne){A(u.$$.fragment,ne),A(I.$$.fragment,ne),A(F.$$.fragment,ne),q=!1},d(ne){ne&&v(t),V(u),U&&U.d(),V(I),V(F),W=!1,ve(G)}}}function TE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T,$,C=[],M=new Map,D;function I(Z){n[11](Z)}let L={class:"col-type-text",name:"id",$$slots:{default:[kE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new $n({props:L}),ee.push(()=>be(o,"sort",I));function R(Z){n[12](Z)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[yE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),f=new $n({props:F}),ee.push(()=>be(f,"sort",R));function N(Z){n[13](Z)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[vE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new $n({props:P}),ee.push(()=>be(d,"sort",N));function j(Z){n[14](Z)}let q={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[wE]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),_=new $n({props:q}),ee.push(()=>be(_,"sort",j));let W=de(n[4]);const G=Z=>Z[24].id;for(let Z=0;Z Admin sign in
",i=O(),B(l.$$.fragment),s=O(),B(o.$$.fragment),r=O(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),z(l,e,null),k(e,s),z(o,e,null),k(e,r),k(e,a),f=!0,u||(c=K(e,"submit",Be(n[3])),u=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!f||m&4)&&x(a,"btn-disabled",d[2]),(!f||m&4)&&x(a,"btn-loading",d[2])},i(d){f||(E(l.$$.fragment,d),E(o.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),V(o),u=!1,c()}}}function NE(n){let e,t;return e=new G1({props:{$$slots:{default:[LE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function PE(n,e,t){let i;Ue(n,jo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),fe.admins.authWithPassword(s,o).then(()=>{wa(),tl("/")}).catch(()=>{ii("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function f(){s=this.value,t(0,s)}function u(){o=this.value,t(1,o)}return[s,o,r,a,f,u]}class FE extends ge{constructor(e){super(),_e(this,e,PE,NE,me,{})}}function RE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,y,S,T;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[jE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[HE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[zE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&Gh(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=O(),s=b("div"),B(o.$$.fragment),r=O(),B(a.$$.fragment),f=O(),u=b("div"),c=b("div"),d=O(),$&&$.c(),m=O(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,M){w(C,e,M),k(e,t),z(i,t,null),k(e,l),k(e,s),z(o,s,null),k(e,r),z(a,e,null),k(e,f),k(e,u),k(u,c),k(u,d),$&&$.m(u,null),k(u,m),k(u,h),k(h,_),y=!0,S||(T=K(h,"click",n[12]),S=!0)},p(C,M){const D={};M&786433&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const I={};M&786433&&(I.$$scope={dirty:M,ctx:C}),o.$set(I);const L={};M&786433&&(L.$$scope={dirty:M,ctx:C}),a.$set(L),C[3]?$?$.p(C,M):($=Gh(C),$.c(),$.m(u,m)):$&&($.d(1),$=null),(!y||M&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||M&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),V(i),V(o),V(a),$&&$.d(),S=!1,T()}}}function qE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function jE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application name"),l=O(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),ae(s,n[0].meta.appName),r||(a=K(s,"input",n[8]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appName&&ae(s,f[0].meta.appName)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function HE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application URL"),l=O(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(f,u){w(f,e,u),k(e,t),w(f,l,u),w(f,s,u),ae(s,n[0].meta.appUrl),r||(a=K(s,"input",n[9]),r=!0)},p(f,u){u&262144&&i!==(i=f[18])&&p(e,"for",i),u&262144&&o!==(o=f[18])&&p(s,"id",o),u&1&&s.value!==f[0].meta.appUrl&&ae(s,f[0].meta.appUrl)},d(f){f&&(v(e),v(l),v(s)),r=!1,a()}}}function zE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=O(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),f||(u=[K(e,"change",n[10]),we(Le.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],f=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),f=!1,ve(u)}}}function Gh(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function VE(n){let e,t,i,l,s,o,r,a,f;const u=[qE,RE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=u[s](n),{c(){e=b("header"),e.innerHTML='',t=O(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(f=K(l,"submit",Be(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(se(),A(c[_],1,1,()=>{c[_]=null}),oe(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,f()}}}function BE(n){let e,t,i,l;return e=new _i({}),i=new kn({props:{$$slots:{default:[VE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function UE(n,e,t){let i,l,s,o;Ue(n,Xi,C=>t(13,l=C)),Ue(n,Oo,C=>t(14,s=C)),Ue(n,Dt,C=>t(15,o=C)),xt(Dt,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const C=await fe.settings.getAll()||{};h(C)}catch(C){fe.error(C)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const C=await fe.settings.update(H.filterRedactedProps(a));h(C),At("Successfully saved application settings.")}catch(C){fe.error(C)}t(2,u=!1)}}function h(C={}){var M,D;xt(Oo,s=(M=C==null?void 0:C.meta)==null?void 0:M.appName,s),xt(Xi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,f,u,i,m,_,r,c,g,y,S,T,$]}class WE extends ge{constructor(e){super(),_e(this,e,UE,BE,me,{})}}function YE(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o
Please note that during the backup other concurrent write requests may fail since the database will be temporary "locked" (this usually happens only during the ZIP generation).
If you are using S3 storage for the collections file upload, you'll have to backup them separately since they are not locally stored and will not be included in the final backup!
Please proceed with caution.
Backup restore is still experimental and currently works only on UNIX based systems.
The restore operation will attempt to replace your existing pb_data
with the one from
the backup and will restart the application process.
Nothing will happen if the backup file is invalid or incompatible.