function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = ["./FilterAutocompleteInput-BL_1O7xH.js","./index-Bfjvydfy.js","./CodeEditor-BtuWTjGi.js","./ListApiDocs-B-i1hEDc.js","./SdkTabs-CiH1RGKT.js","./SdkTabs-lBWmLVyw.css","./FieldsQueryParam-DsvA8YNj.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-B9pN11bE.js","./CreateApiDocs-CKBPu9Ao.js","./UpdateApiDocs-GgZHnjuQ.js","./DeleteApiDocs-Yjz46nKK.js","./RealtimeApiDocs-DQNrGsgA.js","./AuthWithPasswordDocs-63oohYb8.js","./AuthWithOAuth2Docs-Dr3UAJ49.js","./AuthRefreshDocs-lRupHLM7.js","./RequestVerificationDocs-a427EXp3.js","./ConfirmVerificationDocs-CXIVFdlz.js","./RequestPasswordResetDocs-BFuQlHiy.js","./ConfirmPasswordResetDocs-DHCFURJP.js","./RequestEmailChangeDocs-azeYK7Cp.js","./ConfirmEmailChangeDocs-C0Pv3vri.js","./AuthMethodsDocs-Bp6VJAcK.js","./ListExternalAuthsDocs-_AaCVeaC.js","./UnlinkExternalAuthDocs-BvYBxUo5.js"]
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
var u0=Object.defineProperty;var c0=(n,e,t)=>e in n?u0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ge=(n,e,t)=>(c0(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 x(){}const bs=n=>n;function Ae(n,e){for(const t in e)n[t]=e[t];return n}function d0(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 Te(n){n.forEach(Cg)}function Ot(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Es;function tn(n,e){return n===e?!0:(Es||(Es=document.createElement("a")),Es.href=e,n===Es.href)}function p0(n){return Object.keys(n).length===0}function ra(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Og(n){let e;return ra(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ra(e,t))}function St(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?Ae(t.ctx.slice(),n[1](i(e))):t.ctx}function $t(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=Ay(r,a,s,l);return o?f.negate():f}diffNow(e="milliseconds",t={}){return this.diff(He.now(),e,t)}until(e){return this.isValid?Rt.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||He.fromObject({},{zone:this.zone}),i=e.padding?this PocketBase
Create your first admin account in order to continue
",i=D(),B(l.$$.fragment),s=D(),B(o.$$.fragment),r=D(),B(a.$$.fragment),f=D(),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"),ee(u,"btn-disabled",n[3]),ee(u,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){S(h,e,_),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),z(a,e,null),y(e,f),y(e,u),c=!0,d||(m=Z(e,"submit",Ue(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const v={};_&1538&&(v.$$scope={dirty:_,ctx:h}),o.$set(v);const $={};_&1540&&($.$$scope={dirty:_,ctx:h}),a.$set($),(!c||_&8)&&ee(u,"btn-disabled",h[3]),(!c||_&8)&&ee(u,"btn-loading",h[3])},i(h){c||(I(l.$$.fragment,h),I(o.$$.fragment,h),I(a.$$.fragment,h),c=!0)},o(h){L(l.$$.fragment,h),L(o.$$.fragment,h),L(a.$$.fragment,h),c=!1},d(h){h&&w(e),V(l),V(o),V(a),d=!1,m()}}}function $v(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 Tv extends be{constructor(e){super(),ge(this,e,$v,Sv,he,{})}}function Yf(n){let e,t;return e=new G1({props:{$$slots:{default:[Cv]},$$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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Cv(n){let e,t;return e=new Tv({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:x,i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ov(n){let e,t,i=n[0]&&Yf(n);return{c(){i&&i.c(),e=ve()},m(l,s){i&&i.m(l,s),S(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&I(i,1)):(i=Yf(l),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(se(),L(i,1,1,()=>{i=null}),oe())},i(l){t||(I(i),t=!0)},o(l){L(i),t=!1},d(l){l&&w(e),i&&i.d(l)}}}function Mv(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?nl("/collections"):fe.logout()}return[i,async()=>{t(0,i=!1),await xt(),window.location.search=""}]}class Dv extends be{constructor(e){super(),ge(this,e,Mv,Ov,he,{})}}const At=On(""),Mo=On(""),Qi=On(!1);function Ev(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){S(s,e,o),n[13](e),ae(e,n[7]),i||(l=Z(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:x,o:x,d(s){s&&w(e),n[13](null),i=!1,l()}}}function Iv(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,disableCollectionJoinKeys:!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=Et(o,r(n)),te.push(()=>ke(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ve()},m(a,f){e&&z(e,a,f),S(a,i,f),l=!0},p(a,f){if(f&16&&o!==(o=a[4])){if(e){se();const u=e;L(u.$$.fragment,1,0,()=>{V(u,1)}),oe()}o?(e=Et(o,r(a)),te.push(()=>ke(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),I(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],ye(()=>t=!1)),e.$set(u)}},i(a){l||(e&&I(e.$$.fragment,a),l=!0)},o(a){e&&L(e.$$.fragment,a),l=!1},d(a){a&&w(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){S(l,e,s),i=!0},i(l){i||(l&&Je(()=>{i&&(t||(t=Re(e,Rn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Re(e,Rn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&w(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){S(o,e,r),i=!0,l||(s=Z(e,"click",n[15]),l=!0)},p:x,i(o){i||(o&&Je(()=>{i&&(t||(t=Re(e,Rn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Re(e,Rn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),l=!1,s()}}}function Av(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[Iv,Ev],m=[];function h(v,$){return v[4]&&!v[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=D(),o.c(),r=D(),_&&_.c(),a=D(),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(v,$){S(v,e,$),y(e,t),y(t,i),y(e,l),m[s].m(e,null),y(e,r),_&&_.m(e,null),y(e,a),g&&g.m(e,null),f=!0,u||(c=[Z(e,"click",Cn(n[11])),Z(e,"submit",Ue(n[10]))],u=!0)},p(v,[$]){let C=s;s=h(v),s===C?m[s].p(v,$):(se(),L(m[C],1,1,()=>{m[C]=null}),oe(),o=m[s],o?o.p(v,$):(o=m[s]=d[s](v),o.c()),I(o,1),o.m(e,r)),(v[0].length||v[7].length)&&v[7]!=v[0]?_?$&129&&I(_,1):(_=Kf(),_.c(),I(_,1),_.m(e,a)):_&&(se(),L(_,1,1,()=>{_=null}),oe()),v[0].length||v[7].length?g?(g.p(v,$),$&129&&I(g,1)):(g=Jf(v),g.c(),I(g,1),g.m(e,null)):g&&(se(),L(g,1,1,()=>{g=null}),oe())},i(v){f||(I(o),I(_),I(g),f=!0)},o(v){L(o),L(_),L(g),f=!1},d(v){v&&w(e),m[s].d(),_&&_.d(),g&&g.d(),u=!1,Te(c)}}}function Lv(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(O=!0){t(7,d=""),O&&(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-BL_1O7xH.js"),__vite__mapDeps([0,1]),import.meta.url)).default),t(5,u=!1))}zt(()=>{_()});function g(O){Oe.call(this,n,O)}function v(O){d=O,t(7,d),t(0,s)}function $(O){te[O?"unshift":"push"](()=>{c=O,t(6,c)})}function C(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.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,v,$,C,T]}class Ts extends be{constructor(e){super(),ge(this,e,Lv,Av,he,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Nv(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"),ee(e,"refreshing",n[2])},m(r,a){S(r,e,a),y(e,t),s||(o=[$e(l=Fe.call(null,e,n[0])),Z(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&&Ot(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&ee(e,"refreshing",r[2])},i:x,o:x,d(r){r&&w(e),s=!1,Te(o)}}}function Pv(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 zt(()=>()=>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 Go extends be{constructor(e){super(),ge(this,e,Pv,Nv,he,{tooltip:0,class:1})}}function Fv(n){let e,t,i,l,s;const o=n[6].default,r=St(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]),ee(e,"col-sort-disabled",n[3]),ee(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ee(e,"sort-desc",n[0]==="-"+n[2]),ee(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){S(a,e,f),r&&r.m(e,null),i=!0,l||(s=[Z(e,"click",n[7]),Z(e,"keydown",n[8])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&32)&&Tt(r,o,a,a[5],i?$t(o,a[5],f,null):Ct(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)&&ee(e,"col-sort-disabled",a[3]),(!i||f&7)&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||f&7)&&ee(e,"sort-desc",a[0]==="-"+a[2]),(!i||f&7)&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(I(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),l=!1,Te(s)}}}function Rv(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 be{constructor(e){super(),ge(this,e,Rv,Fv,he,{class:1,name:2,sort:0,disable:3})}}const qv=n=>({}),Zf=n=>({}),jv=n=>({}),Gf=n=>({});function Hv(n){let e,t,i,l,s,o,r,a;const f=n[11].before,u=St(f,n,n[10],Gf),c=n[11].default,d=St(c,n,n[10],null),m=n[11].after,h=St(m,n,n[10],Zf);return{c(){e=b("div"),u&&u.c(),t=D(),i=b("div"),d&&d.c(),s=D(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){S(_,e,g),u&&u.m(e,null),y(e,t),y(e,i),d&&d.m(i,null),n[12](i),y(e,s),h&&h.m(e,null),o=!0,r||(a=[Z(window,"resize",n[1]),Z(i,"scroll",n[1])],r=!0)},p(_,[g]){u&&u.p&&(!o||g&1024)&&Tt(u,f,_,_[10],o?$t(f,_[10],g,jv):Ct(_[10]),Gf),d&&d.p&&(!o||g&1024)&&Tt(d,c,_,_[10],o?$t(c,_[10],g,null):Ct(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&Tt(h,m,_,_[10],o?$t(m,_[10],g,qv):Ct(_[10]),Zf)},i(_){o||(I(u,_),I(d,_),I(h,_),o=!0)},o(_){L(u,_),L(d,_),L(h,_),o=!1},d(_){_&&w(e),u&&u.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,Te(a)}}}function zv(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,v;function $(){u&&t(2,u.scrollTop=0,u)}function C(){u&&t(2,u.scrollLeft=0,u)}function T(){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 O(){d||(d=setTimeout(()=>{T(),d=null},150))}zt(()=>(O(),v=new MutationObserver(O),v.observe(u,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{v==null||v.disconnect(),clearTimeout(d)}));function M(E){te[E?"unshift":"push"](()=>{u=E,t(2,u)})}return n.$$set=E=>{"class"in E&&t(0,o=E.class),"vThreshold"in E&&t(4,r=E.vThreshold),"hThreshold"in E&&t(5,a=E.hThreshold),"dispatchOnNoScroll"in E&&t(6,f=E.dispatchOnNoScroll),"$$scope"in E&&t(10,l=E.$$scope)},[o,O,u,c,r,a,f,$,C,T,l,i,M]}class Xo extends be{constructor(e){super(),ge(this,e,zv,Hv,he,{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 Vv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=J(i),s=J(" ("),o=J(n[0]),r=J(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(f,u){S(f,e,u),y(e,t),y(t,l),y(t,s),y(t,o),y(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:x,o:x,d(f){f&&w(e)}}}function Bv(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 be{constructor(e){super(),ge(this,e,Bv,Vv,he,{level:0})}}function Uv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=J(t),p(e,"class","txt-nowrap")},m(o,r){S(o,e,r),y(e,i),l||(s=$e(Fe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&re(i,t)},i:x,o:x,d(o){o&&w(e),l=!1,s()}}}function Wv(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 be{constructor(e){super(),ge(this,e,Wv,Uv,he,{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=i2(i[31]);return i[33]=s,i}function Qf(n,e,t){const i=n.slice();return i[36]=e[t],i}function Yv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=D(),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){S(a,e,f),y(e,t),y(e,l),y(e,s),o||(r=Z(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&&w(e),o=!1,r()}}}function Kv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function Jv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function Zv(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function Gv(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function xf(n){let e;function t(s,o){return s[7]?Qv:Xv}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},m(s,o){l.m(s,o),S(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&&w(e),l.d(s)}}}function Xv(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=D(),o&&o.c(),s=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){S(a,e,f),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(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&&w(e),o&&o.d()}}}function Qv(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){S(t,e,i)},p:x,d(t){t&&w(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){S(l,e,s),t||(i=Z(e,"click",n[25]),t=!0)},p:x,d(l){l&&w(e),t=!1,i()}}}function tu(n){let e,t=ce(n[33]),i=[];for(let l=0;l n,x:n=>n.x,y:n=>n.y};function A2(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 L2(n){const e=A2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Io(n,e){return(cu[e]||(cu[e]=L2(e)))(n)}function Ea(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ao=n=>typeof n<"u",Ei=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 N2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const on=Math.PI,Wn=2*on,P2=Wn+on,Lo=Number.POSITIVE_INFINITY,F2=on/180,Bn=on/2,qi=on/4,pu=on*2/3,Gr=Math.log10,Ol=Math.sign;function xl(n,e,t){return Math.abs(n-e)=0&&e$!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Tu(e,{x:_,y:h,w:f,h:a,radius:v}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Tu(e,{x:g,y:h+1,w:f-2,h:a-2,radius:v}),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=ni(i.bodyFont);let d=c.lineHeight,m=0;const h=gr(i.rtl,this.x,this.width),_=function(A){t.fillText(A,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let v,$,C,T,O,M,E;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Qs(this,g,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,_),m=r&&g!=="right"?o==="center"?f/2+u:f+2+u:0,T=0,M=l.length;T+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=Un(t,0,o),i=Un(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=wt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,f=cs(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 qt(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}=Ki(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}=Ki(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 ms{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=xs(t,this.min),this._tableRange=xs(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){S(c,e,d),y(e,t),S(c,l,d),S(c,s,d),ae(s,n[1].logs.maxDays),S(c,r,d),S(c,a,d),f||(u=Z(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&&(w(e),w(l),w(s),w(r),w(a)),f=!1,u()}}}function WS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Hb({}),{c(){e=b("label"),t=J("Min log level"),l=D(),s=b("input"),o=D(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=D(),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,_){S(h,e,_),y(e,t),S(h,l,_),S(h,s,_),ae(s,n[1].logs.minLevel),S(h,o,_),S(h,r,_),y(r,a),y(r,f),z(u,r,null),c=!0,d||(m=Z(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||(I(u.$$.fragment,h),c=!0)},o(h){L(u.$$.fragment,h),c=!1},d(h){h&&(w(e),w(l),w(s),w(o),w(r)),V(u),d=!1,m()}}}function YS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=D(),l=b("label"),s=J("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){S(f,e,u),e.checked=n[1].logs.logIp,S(f,i,u),S(f,l,u),y(l,s),r||(a=Z(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&&(w(e),w(i),w(l)),r=!1,a()}}}function KS(n){let e,t,i,l;const s=[BS,VS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},m(a,f){o[e].m(a,f),S(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),L(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){l||(I(t),l=!0)},o(a){L(t),l=!1},d(a){a&&w(i),o[e].d(a)}}}function JS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function ZS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),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],ee(l,"btn-loading",n[3])},m(f,u){S(f,e,u),y(e,t),S(f,i,u),S(f,l,u),y(l,s),r||(a=Z(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&&ee(l,"btn-loading",f[3])},d(f){f&&(w(e),w(i),w(l)),r=!1,a()}}}function GS(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[ZS],header:[JS],default:[KS]},$$scope:{ctx:n}};return e=new Xt({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||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function XS(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(){Gt(),t(9,u={}),t(1,c=JSON.parse(JSON.stringify(u||{})))}async function _(){t(4,f=!0);try{const N=await fe.settings.getAll()||{};v(N)}catch(N){fe.error(N)}t(4,f=!1)}async function g(){if(l){t(3,a=!0);try{const N=await fe.settings.update(H.filterRedactedProps(c));v(N),t(3,a=!1),m(),Nt("Successfully saved logs settings."),s("save",N)}catch(N){t(3,a=!1),fe.error(N)}}}function v(N={}){t(1,c={logs:(N==null?void 0:N.logs)||{}}),t(9,u=JSON.parse(JSON.stringify(c)))}function $(){c.logs.maxDays=lt(this.value),t(1,c)}function C(){c.logs.minLevel=lt(this.value),t(1,c)}function T(){c.logs.logIp=this.checked,t(1,c)}const O=()=>!a;function M(N){te[N?"unshift":"push"](()=>{r=N,t(2,r)})}function E(N){Oe.call(this,n,N)}function A(N){Oe.call(this,n,N)}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,$,C,T,O,M,E,A]}class QS extends be{constructor(e){super(),ge(this,e,XS,GS,he,{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=D(),l=b("label"),s=J("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){S(f,e,u),e.checked=n[2],S(f,i,u),S(f,l,u),y(l,s),r||(a=Z(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&&(w(e),w(i),w(l)),r=!1,a()}}}function Nc(n){let e,t;return e=new mS({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||(I(e.$$.fragment,i),t=!0)},o(i){L(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 s2({props:s}),te.push(()=>ke(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function e$(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C,T=n[4],O,M=n[4],E,A,N,q;f=new Go({}),f.$on("refresh",n[10]),h=new de({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[xS,({uniqueId:F})=>({22:F}),({uniqueId:F})=>F?4194304:0]},$$scope:{ctx:n}}}),g=new Ts({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),$=new Hb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let R=Nc(n),P=Pc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=J(n[6]),o=D(),r=b("button"),r.innerHTML='',a=D(),B(f.$$.fragment),u=D(),c=b("div"),d=D(),m=b("div"),B(h.$$.fragment),_=D(),B(g.$$.fragment),v=D(),B($.$$.fragment),C=D(),R.c(),O=D(),P.c(),E=ve(),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(F,j){S(F,e,j),y(e,t),y(t,i),y(i,l),y(l,s),y(t,o),y(t,r),y(t,a),z(f,t,null),y(t,u),y(t,c),y(t,d),y(t,m),z(h,m,null),y(e,_),z(g,e,null),y(e,v),z($,e,null),y(e,C),R.m(e,null),S(F,O,j),P.m(F,j),S(F,E,j),A=!0,N||(q=[$e(Fe.call(null,r,{text:"Logs settings",position:"right"})),Z(r,"click",n[9])],N=!0)},p(F,j){(!A||j&64)&&re(s,F[6]);const U={};j&12582916&&(U.$$scope={dirty:j,ctx:F}),h.$set(U);const Y={};j&2&&(Y.value=F[1]),g.$set(Y),j&16&&he(T,T=F[4])?(se(),L(R,1,1,x),oe(),R=Nc(F),R.c(),I(R,1),R.m(e,null)):R.p(F,j),j&16&&he(M,M=F[4])?(se(),L(P,1,1,x),oe(),P=Pc(F),P.c(),I(P,1),P.m(E.parentNode,E)):P.p(F,j)},i(F){A||(I(f.$$.fragment,F),I(h.$$.fragment,F),I(g.$$.fragment,F),I($.$$.fragment,F),I(R),I(P),A=!0)},o(F){L(f.$$.fragment,F),L(h.$$.fragment,F),L(g.$$.fragment,F),L($.$$.fragment,F),L(R),L(P),A=!1},d(F){F&&(w(e),w(O),w(E)),V(f),V(h),V(g),V($),R.d(F),P.d(F),N=!1,Te(q)}}}function t$(n){let e,t,i,l,s,o;e=new kn({props:{$$slots:{default:[e$]},$$scope:{ctx:n}}});let r={};i=new RS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new QS({props:a}),n[18](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),l=D(),B(s.$$.fragment)},m(f,u){z(e,f,u),S(f,t,u),z(i,f,u),S(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||(I(e.$$.fragment,f),I(i.$$.fragment,f),I(s.$$.fragment,f),o=!0)},o(f){L(e.$$.fragment,f),L(i.$$.fragment,f),L(s.$$.fragment,f),o=!1},d(f){f&&(w(t),w(l)),V(e,f),n[15](null),V(i,f),n[18](null),V(s,f)}}}const eo="logId",Fc="adminRequests",Rc="adminLogRequests";function n$(n,e,t){var N;let i,l,s;We(n,Ho,q=>t(19,l=q)),We(n,At,q=>t(6,s=q)),en(At,s="Logs",s);const o=new URLSearchParams(l);let r,a,f=1,u=o.get("filter")||"",c=(o.get(Fc)||((N=window.localStorage)==null?void 0:N.getItem(Rc)))<<0,d=c;function m(){t(4,f++,f)}function h(q={}){let R={};R.filter=u||null,R[Fc]=c<<0||null,H.replaceHashQueryParams(Object.assign(R,q))}const _=()=>a==null?void 0:a.show(),g=()=>m();function v(){c=this.checked,t(2,c)}const $=q=>t(1,u=q.detail);function C(q){u=q,t(1,u)}const T=q=>r==null?void 0:r.show(q==null?void 0:q.detail);function O(q){te[q?"unshift":"push"](()=>{r=q,t(0,r)})}const M=q=>{var P;let R={};R[eo]=((P=q.detail)==null?void 0:P.id)||null,H.replaceHashQueryParams(R)},E=()=>{let q={};q[eo]=null,H.replaceHashQueryParams(q)};function A(q){te[q?"unshift":"push"](()=>{a=q,t(3,a)})}return n.$$.update=()=>{var q;n.$$.dirty&1&&o.get(eo)&&r&&r.show(o.get(eo)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(q=window.localStorage)==null||q.setItem(Rc,c<<0),h()),n.$$.dirty&2&&typeof u<"u"&&h()},[r,u,c,a,f,i,s,m,d,_,g,v,$,C,T,O,M,E,A]}class i$ extends be{constructor(e){super(),ge(this,e,n$,t$,he,{})}}function l$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-1g2t3dj"),ee(e,"dragging",n[1])},m(l,s){S(l,e,s),n[4](e),t||(i=[Z(e,"mousedown",n[5]),Z(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&ee(e,"dragging",l[1])},i:x,o:x,d(l){l&&w(e),n[4](null),t=!1,Te(i)}}}function s$(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 v=g.clientX-o,$=g.clientY-r,C=g.clientX-a,T=g.clientY-f;!u&&Math.abs(C-s.offsetLeft)true
",_=D(),g=b("li"),g.innerHTML=""false" is converted to the json false
",v=D(),$=b("li"),$.innerHTML=""null" is converted to the json null
",C=D(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]
",O=D(),M=b("li"),A=J(E),N=J(" is converted to the json "),q=b("code"),q.textContent='{"a":1,"b":2}',R=D(),P=b("li"),P.textContent="numeric strings are converted to json number",F=D(),j=b("li"),j.textContent="double quoted strings are left as they are (aka. without normalizations)",U=D(),Y=b("li"),Y.textContent="any other string (empty string too) is double quoted",X=J(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),W=b("code"),W.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,me){S(ne,e,me),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,f),y(i,u),y(i,c),y(i,d),y(i,m),y(m,h),y(m,_),y(m,g),y(m,v),y(m,$),y(m,C),y(m,T),y(m,O),y(m,M),y(M,A),y(M,N),y(M,q),y(m,R),y(m,P),y(m,F),y(m,j),y(m,U),y(m,Y),y(i,X),y(i,W),le=!0},i(ne){le||(ne&&Je(()=>{le&&(K||(K=Re(e,tt,{duration:150},!0)),K.run(1))}),le=!0)},o(ne){ne&&(K||(K=Re(e,tt,{duration:150},!1)),K.run(0)),le=!1},d(ne){ne&&w(e),ne&&K&&K.end()}}}function aC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new de({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[sC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,v){return g[2]?rC:oC}let m=d(n),h=m(n),_=n[2]&&$d();return{c(){B(e.$$.fragment),t=D(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=D(),h.c(),r=D(),_&&_.c(),a=ve(),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,v){z(e,g,v),S(g,t,v),S(g,i,v),y(i,l),y(i,s),h.m(i,null),S(g,r,v),_&&_.m(g,v),S(g,a,v),f=!0,u||(c=Z(i,"click",n[5]),u=!0)},p(g,v){const $={};v&2&&($.name="schema."+g[1]+".options.maxSize"),v&6145&&($.$$scope={dirty:v,ctx:g}),e.$set($),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||v&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?v&4&&I(_,1):(_=$d(),_.c(),I(_,1),_.m(a.parentNode,a)):_&&(se(),L(_,1,1,()=>{_=null}),oe())},i(g){f||(I(e.$$.fragment,g),I(_),f=!0)},o(g){L(e.$$.fragment,g),L(_),f=!1},d(g){g&&(w(t),w(i),w(r),w(a)),V(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function fC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[aC]},$$scope:{ctx:n}};for(let r=0;r@request.headers.*
@request.query.*
@request.data.*
@request.auth.*
",m=D(),h=b("hr"),_=D(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the @collection filter:",v=D(),$=b("div"),$.innerHTML="@collection.ANY_COLLECTION_NAME.*
",C=D(),T=b("hr"),O=D(),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($,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(R,P){S(R,e,P),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let F=0;Fcreate
and update
API rules."},m(l,s){S(l,e,s),S(l,t,s),S(l,i,s)},p:x,d(l){l&&(w(e),w(t),w(i))}}}function i5(n){var P,F;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,v,$,C,T,O=n[1]&&jd(n);function M(j){n[4](j)}let E={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(E.rule=n[0].listRule),u=new Tl({props:E}),te.push(()=>ke(u,"rule",M));function A(j){n[5](j)}let N={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),m=new Tl({props:N}),te.push(()=>ke(m,"rule",A));let q=((P=n[0])==null?void 0:P.type)!=="view"&&zd(n),R=((F=n[0])==null?void 0:F.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=D(),s=b("button"),r=J(o),a=D(),O&&O.c(),f=D(),B(u.$$.fragment),d=D(),B(m.$$.fragment),_=D(),q&&q.c(),g=D(),R&&R.c(),v=ve(),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,U){S(j,e,U),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),O&&O.m(e,null),S(j,f,U),z(u,j,U),S(j,d,U),z(m,j,U),S(j,_,U),q&&q.m(j,U),S(j,g,U),R&&R.m(j,U),S(j,v,U),$=!0,C||(T=Z(s,"click",n[3]),C=!0)},p(j,[U]){var W,K;(!$||U&2)&&o!==(o=j[1]?"Hide available fields":"Show available fields")&&re(r,o),j[1]?O?(O.p(j,U),U&2&&I(O,1)):(O=jd(j),O.c(),I(O,1),O.m(e,null)):O&&(se(),L(O,1,1,()=>{O=null}),oe());const Y={};U&1&&(Y.collection=j[0]),!c&&U&1&&(c=!0,Y.rule=j[0].listRule,ye(()=>c=!1)),u.$set(Y);const X={};U&1&&(X.collection=j[0]),!h&&U&1&&(h=!0,X.rule=j[0].viewRule,ye(()=>h=!1)),m.$set(X),((W=j[0])==null?void 0:W.type)!=="view"?q?(q.p(j,U),U&1&&I(q,1)):(q=zd(j),q.c(),I(q,1),q.m(g.parentNode,g)):q&&(se(),L(q,1,1,()=>{q=null}),oe()),((K=j[0])==null?void 0:K.type)==="auth"?R?(R.p(j,U),U&1&&I(R,1)):(R=Bd(j),R.c(),I(R,1),R.m(v.parentNode,v)):R&&(se(),L(R,1,1,()=>{R=null}),oe())},i(j){$||(I(O),I(u.$$.fragment,j),I(m.$$.fragment,j),I(q),I(R),$=!0)},o(j){L(O),L(u.$$.fragment,j),L(m.$$.fragment,j),L(q),L(R),$=!1},d(j){j&&(w(e),w(f),w(d),w(_),w(g),w(v)),O&&O.d(),V(u,j),V(m,j),q&&q.d(j),R&&R.d(j),C=!1,T()}}}function l5(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 s5 extends be{constructor(e){super(),ge(this,e,l5,i5,he,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function o5(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=Et(o,r(n)),te.push(()=>ke(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ve()},m(a,f){e&&z(e,a,f),S(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){se();const u=e;L(u.$$.fragment,1,0,()=>{V(u,1)}),oe()}o?(e=Et(o,r(a)),te.push(()=>ke(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),I(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,ye(()=>t=!1)),e.$set(u)}},i(a){l||(e&&I(e.$$.fragment,a),l=!0)},o(a){e&&L(e.$$.fragment,a),l=!1},d(a){a&&w(i),e&&V(e,a)}}}function r5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:x,i:x,o:x,d(t){t&&w(e)}}}function Wd(n){let e,t,i=ce(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){S(t,e,i)},p:x,d(t){t&&w(e)}}}function MD(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){S(l,e,s),t||(i=Z(e,"click",n[44]),t=!0)},p:x,d(l){l&&w(e),t=!1,i()}}}function DD(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){S(l,e,s),t||(i=Z(e,"click",n[43]),t=!0)},p:x,d(l){l&&w(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=D(),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){S(d,e,m),y(e,t),y(t,i),y(t,o),y(t,r),f||(u=[Z(i,"change",c),Z(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&&w(e),f=!1,Te(u)}}}function wh(n){let e,t,i,l,s,o,r=n[63].id+"",a,f,u;l=new ol({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=D(),o=b("div"),a=J(r),f=D(),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){S(d,e,m),y(e,t),y(t,i),z(l,i,null),y(i,s),y(i,o),y(o,a),y(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||(I(l.$$.fragment,d),u=!0)},o(d){L(l.$$.fragment,d),u=!1},d(d){d&&w(e),V(l),c&&c.d()}}}function Sh(n){let e;function t(s,o){return s[63].verified?ID:ED}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},m(s,o){l.m(s,o),S(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&&w(e),l.d(s)}}}function ED(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){S(l,e,s),t||(i=$e(Fe.call(null,e,"Unverified")),t=!0)},d(l){l&&w(e),t=!1,i()}}}function ID(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){S(l,e,s),t||(i=$e(Fe.call(null,e,"Verified")),t=!0)},d(l){l&&w(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=D(),o&&o.c(),l=ve()},m(r,a){s&&s.m(r,a),S(r,t,a),o&&o.m(r,a),S(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&&(w(t),w(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?LD:AD}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){S(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&&w(e),s.d()}}}function AD(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=J(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){S(s,e,o),y(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&&w(e)}}}function LD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function Ch(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!H.isEmpty(o[63].email)),t?PD:ND}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){S(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&&w(e),s.d()}}}function ND(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=J(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){S(s,e,o),y(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&&w(e)}}}function PD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function Oh(n,e){let t,i,l,s;return i=new Xb({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){S(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||(I(i.$$.fragment,o),s=!0)},o(o){L(i.$$.fragment,o),s=!1},d(o){o&&w(t),V(i)}}}function Mh(n){let e,t,i;return t=new tl({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){S(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||(I(t.$$.fragment,l),i=!0)},o(l){L(t.$$.fragment,l),i=!1},d(l){l&&w(e),V(t)}}}function Dh(n){let e,t,i;return t=new tl({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){S(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||(I(t.$$.fragment,l),i=!0)},o(l){L(t.$$.fragment,l),i=!1},d(l){l&&w(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,v,$=!e[10]&&vh(e),C=l&&wh(e),T=e[9]&&$h(e),O=ce(e[19]);const M=R=>R[66].name;for(let R=0;R Loading collections...
',p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function nE(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[ZD,JD,KD],m=[];function h(C,T){return C[3]&&!C[11].length?0:C[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 g6({props:g}),n[32](o);let v={collection:n[2]};a=new Ka({props:v}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let $={collection:n[2]};return u=new gD({props:$}),n[37](u),u.$on("hide",n[38]),{c(){t.c(),i=D(),B(l.$$.fragment),s=D(),B(o.$$.fragment),r=D(),B(a.$$.fragment),f=D(),B(u.$$.fragment)},m(C,T){m[e].m(C,T),S(C,i,T),z(l,C,T),S(C,s,T),z(o,C,T),S(C,r,T),z(a,C,T),S(C,f,T),z(u,C,T),c=!0},p(C,T){let O=e;e=h(C),e===O?m[e].p(C,T):(se(),L(m[O],1,1,()=>{m[O]=null}),oe(),t=m[e],t?t.p(C,T):(t=m[e]=d[e](C),t.c()),I(t,1),t.m(i.parentNode,i));const M={};l.$set(M);const E={};o.$set(E);const A={};T[0]&4&&(A.collection=C[2]),a.$set(A);const N={};T[0]&4&&(N.collection=C[2]),u.$set(N)},i(C){c||(I(t),I(l.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),I(u.$$.fragment,C),c=!0)},o(C){L(t),L(l.$$.fragment,C),L(o.$$.fragment,C),L(a.$$.fragment,C),L(u.$$.fragment,C),c=!1},d(C){C&&(w(i),w(s),w(r),w(f)),m[e].d(C),n[31](null),V(l,C),n[32](null),V(o,C),n[33](null),V(a,C),n[37](null),V(u,C)}}}function iE(n,e,t){let i,l,s,o,r,a,f;We(n,Jn,Ee=>t(2,l=Ee)),We(n,At,Ee=>t(39,s=Ee)),We(n,Co,Ee=>t(3,o=Ee)),We(n,Ho,Ee=>t(16,r=Ee)),We(n,qn,Ee=>t(11,a=Ee)),We(n,Qi,Ee=>t(12,f=Ee));const u=new URLSearchParams(r);let c,d,m,h,_,g,v=u.get("filter")||"",$=u.get("sort")||"-created",C=u.get("collectionId")||(l==null?void 0:l.id),T=0;Z1(C);async function O(Ee){await xt(),(l==null?void 0:l.type)==="view"?h.show(Ee):m==null||m.show(Ee)}function M(){t(14,C=l==null?void 0:l.id),t(0,v=""),t(1,$="-created"),A({recordId:null}),E(),c==null||c.forceHide(),d==null||d.hide()}async function E(){if(!$)return;const Ee=H.getAllCollectionIdentifiers(l),Le=$.split(",").map(Ve=>Ve.startsWith("+")||Ve.startsWith("-")?Ve.substring(1):Ve);Le.filter(Ve=>Ee.includes(Ve)).length!=Le.length&&(Ee.includes("created")?t(1,$="-created"):t(1,$=""))}function A(Ee={}){const Le=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:v,sort:$},Ee);H.replaceHashQueryParams(Le)}const N=()=>c==null?void 0:c.show();function q(Ee){te[Ee?"unshift":"push"](()=>{g=Ee,t(9,g)})}function R(Ee){T=Ee,t(10,T)}const P=()=>c==null?void 0:c.show(l),F=()=>{_==null||_.load(),g==null||g.reload()},j=()=>d==null?void 0:d.show(l),U=()=>m==null?void 0:m.show(),Y=Ee=>t(0,v=Ee.detail);function X(Ee){te[Ee?"unshift":"push"](()=>{_=Ee,t(8,_)})}function W(Ee){v=Ee,t(0,v)}function K(Ee){$=Ee,t(1,$)}const le=Ee=>{A({recordId:Ee.detail.id});let Le=Ee.detail._partial?Ee.detail.id:Ee.detail;l.type==="view"?h==null||h.show(Le):m==null||m.show(Le)},ne=()=>{g==null||g.reload()},me=()=>m==null?void 0:m.show();function Pe(Ee){te[Ee?"unshift":"push"](()=>{c=Ee,t(4,c)})}function ze(Ee){te[Ee?"unshift":"push"](()=>{d=Ee,t(5,d)})}function Qe(Ee){te[Ee?"unshift":"push"](()=>{m=Ee,t(6,m)})}const et=()=>{A({recordId:null})},Dt=Ee=>{v?g==null||g.reload():Ee.detail.isNew&&t(10,T++,T),_==null||_.reloadLoadedPages()},ut=Ee=>{(!v||_!=null&&_.hasRecord(Ee.detail.id))&&t(10,T--,T),_==null||_.reloadLoadedPages()};function ht(Ee){te[Ee?"unshift":"push"](()=>{h=Ee,t(7,h)})}const Qt=()=>{A({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")!=C&&lv(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&C!=l.id&&M(),n.$$.dirty[0]&4&&l!=null&&l.id&&E(),n.$$.dirty[0]&8&&!o&&u.get("recordId")&&O(u.get("recordId")),n.$$.dirty[0]&15&&!o&&($||v||l!=null&&l.id)&&A(),n.$$.dirty[0]&4&&en(At,s=(l==null?void 0:l.name)||"Collections",s)},[v,$,l,o,c,d,m,h,_,g,T,a,f,A,C,i,r,N,q,R,P,F,j,U,Y,X,W,K,le,ne,me,Pe,ze,Qe,et,Dt,ut,ht,Qt]}class lE extends be{constructor(e){super(),ge(this,e,iE,nE,he,{},null,[-1,-1])}}function qh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=D(),i=b("a"),i.innerHTML=' Export collections',l=D(),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){S(a,e,f),S(a,t,f),S(a,i,f),S(a,l,f),S(a,s,f),o||(r=[$e(Nn.call(null,i,{path:"/settings/export-collections/?.*"})),$e(ln.call(null,i)),$e(Nn.call(null,s,{path:"/settings/import-collections/?.*"})),$e(ln.call(null,s))],o=!0)},d(a){a&&(w(e),w(t),w(i),w(l),w(s)),o=!1,Te(r)}}}function sE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C,T,O,M=!n[0]&&qh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=D(),l=b("a"),l.innerHTML=' Application',s=D(),o=b("a"),o.innerHTML=' Mail settings',r=D(),a=b("a"),a.innerHTML=' Files storage',f=D(),u=b("a"),u.innerHTML=' Backups',c=D(),M&&M.c(),d=D(),m=b("div"),m.textContent="Authentication",h=D(),_=b("a"),_.innerHTML=' Auth providers',g=D(),v=b("a"),v.innerHTML=' Token options',$=D(),C=b("a"),C.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(v,"href","/settings/tokens"),p(v,"class","sidebar-list-item"),p(C,"href","/settings/admins"),p(C,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(E,A){S(E,e,A),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),y(e,r),y(e,a),y(e,f),y(e,u),y(e,c),M&&M.m(e,null),y(e,d),y(e,m),y(e,h),y(e,_),y(e,g),y(e,v),y(e,$),y(e,C),T||(O=[$e(Nn.call(null,l,{path:"/settings"})),$e(ln.call(null,l)),$e(Nn.call(null,o,{path:"/settings/mail/?.*"})),$e(ln.call(null,o)),$e(Nn.call(null,a,{path:"/settings/storage/?.*"})),$e(ln.call(null,a)),$e(Nn.call(null,u,{path:"/settings/backups/?.*"})),$e(ln.call(null,u)),$e(Nn.call(null,_,{path:"/settings/auth-providers/?.*"})),$e(ln.call(null,_)),$e(Nn.call(null,v,{path:"/settings/tokens/?.*"})),$e(ln.call(null,v)),$e(Nn.call(null,C,{path:"/settings/admins/?.*"})),$e(ln.call(null,C))],T=!0)},p(E,A){E[0]?M&&(M.d(1),M=null):M||(M=qh(),M.c(),M.m(e,d))},d(E){E&&w(e),M&&M.d(),T=!1,Te(O)}}}function oE(n){let e,t;return e=new zb({props:{class:"settings-sidebar",$$slots:{default:[sE]},$$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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rE(n,e,t){let i;return We(n,Qi,l=>t(0,i=l)),[i]}class gi extends be{constructor(e){super(),ge(this,e,rE,oE,he,{})}}function jh(n,e,t){const i=n.slice();return i[31]=e[t],i}function Hh(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[aE,({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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function aE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return a=new Jb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=D(),l=b("span"),l.textContent="id",o=D(),r=b("div"),B(a.$$.fragment),f=D(),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,_){S(h,e,_),y(e,t),y(e,i),y(e,l),S(h,o,_),S(h,r,_),z(a,r,null),S(h,f,_),S(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||(I(a.$$.fragment,h),m=!0)},o(h){L(a.$$.fragment,h),m=!1},d(h){h&&(w(e),w(o),w(r),w(f),w(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=D(),tn(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){S(f,e,u),y(e,t),y(e,l),o||(r=Z(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&&w(e),o=!1,r()}}}function fE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=D(),l=b("span"),l.textContent="Email",o=D(),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){S(c,e,d),y(e,t),y(e,i),y(e,l),S(c,o,d),S(c,r,d),ae(r,n[3]),f||(u=Z(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&&(w(e),w(o),w(r)),f=!1,u()}}}function Vh(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[uE,({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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function uE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=D(),l=b("label"),s=J("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(f,u){S(f,e,u),e.checked=n[4],S(f,i,u),S(f,l,u),y(l,s),r||(a=Z(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&&(w(e),w(i),w(l)),r=!1,a()}}}function Bh(n){let e,t,i,l,s,o,r,a,f;return l=new de({props:{class:"form-field required",name:"password",$$slots:{default:[cE,({uniqueId:u})=>({30:u}),({uniqueId:u})=>[u?1073741824:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[dE,({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=D(),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){S(u,e,c),y(e,t),y(t,i),z(l,i,null),y(t,s),y(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||(I(l.$$.fragment,u),I(r.$$.fragment,u),u&&Je(()=>{f&&(a||(a=Re(t,tt,{duration:150},!0)),a.run(1))}),f=!0)},o(u){L(l.$$.fragment,u),L(r.$$.fragment,u),u&&(a||(a=Re(t,tt,{duration:150},!1)),a.run(0)),f=!1},d(u){u&&w(e),V(l),V(r),u&&a&&a.end()}}}function cE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h;return c=new Zb({}),{c(){e=b("label"),t=b("i"),i=D(),l=b("span"),l.textContent="Password",o=D(),r=b("input"),f=D(),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){S(_,e,g),y(e,t),y(e,i),y(e,l),S(_,o,g),S(_,r,g),ae(r,n[9]),S(_,f,g),S(_,u,g),z(c,u,null),d=!0,m||(h=Z(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||(I(c.$$.fragment,_),d=!0)},o(_){L(c.$$.fragment,_),d=!1},d(_){_&&(w(e),w(o),w(r),w(f),w(u)),V(c),m=!1,h()}}}function dE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=b("i"),i=D(),l=b("span"),l.textContent="Password confirm",o=D(),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){S(c,e,d),y(e,t),y(e,i),y(e,l),S(c,o,d),S(c,r,d),ae(r,n[10]),f||(u=Z(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&&(w(e),w(o),w(r)),f=!1,u()}}}function pE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h=!n[5]&&Hh(n),_=ce([0,1,2,3,4,5,6,7,8,9]),g=[];for(let C=0;C<10;C+=1)g[C]=zh(jh(n,_,C));a=new de({props:{class:"form-field required",name:"email",$$slots:{default:[fE,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let v=!n[5]&&Vh(n),$=(n[5]||n[4])&&Bh(n);return{c(){e=b("form"),h&&h.c(),t=D(),i=b("div"),l=b("p"),l.textContent="Avatar",s=D(),o=b("div");for(let C=0;C<10;C+=1)g[C].c();r=D(),B(a.$$.fragment),f=D(),v&&v.c(),u=D(),$&&$.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(C,T){S(C,e,T),h&&h.m(e,null),y(e,t),y(e,i),y(i,l),y(i,s),y(i,o);for(let O=0;O<10;O+=1)g[O]&&g[O].m(o,null);y(e,r),z(a,e,null),y(e,f),v&&v.m(e,null),y(e,u),$&&$.m(e,null),c=!0,d||(m=Z(e,"submit",Ue(n[13])),d=!0)},p(C,T){if(C[5]?h&&(se(),L(h,1,1,()=>{h=null}),oe()):h?(h.p(C,T),T[0]&32&&I(h,1)):(h=Hh(C),h.c(),I(h,1),h.m(e,t)),T[0]&4){_=ce([0,1,2,3,4,5,6,7,8,9]);let M;for(M=0;M<10;M+=1){const E=jh(C,_,M);g[M]?g[M].p(E,T):(g[M]=zh(E),g[M].c(),g[M].m(o,null))}for(;M<10;M+=1)g[M].d(1)}const O={};T[0]&1073741832|T[1]&8&&(O.$$scope={dirty:T,ctx:C}),a.$set(O),C[5]?v&&(se(),L(v,1,1,()=>{v=null}),oe()):v?(v.p(C,T),T[0]&32&&I(v,1)):(v=Vh(C),v.c(),I(v,1),v.m(e,u)),C[5]||C[4]?$?($.p(C,T),T[0]&48&&I($,1)):($=Bh(C),$.c(),I($,1),$.m(e,null)):$&&(se(),L($,1,1,()=>{$=null}),oe())},i(C){c||(I(h),I(a.$$.fragment,C),I(v),I($),c=!0)},o(C){L(h),L(a.$$.fragment,C),L(v),L($),c=!1},d(C){C&&w(e),h&&h.d(),rt(g,C),V(a),v&&v.d(),$&&$.d(),d=!1,m()}}}function mE(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=J(t)},m(l,s){S(l,e,s),y(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&re(i,t)},d(l){l&&w(e)}}}function Uh(n){let e,t,i,l,s,o,r,a,f;return o=new Mn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[hE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("span"),i=D(),l=b("i"),s=D(),B(o.$$.fragment),r=D(),a=b("div"),p(t,"aria-hidden","true"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"aria-label","More admin options"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(u,c){S(u,e,c),y(e,t),y(e,i),y(e,l),y(e,s),z(o,e,null),S(u,r,c),S(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||(I(o.$$.fragment,u),f=!0)},o(u){L(o.$$.fragment,u),f=!1},d(u){u&&(w(e),w(r),w(a)),V(o)}}}function hE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){S(l,e,s),t||(i=Z(e,"click",n[16]),t=!0)},p:x,d(l){l&&w(e),t=!1,i()}}}function _E(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=D(),t=b("button"),i=b("span"),i.textContent="Cancel",l=D(),s=b("button"),o=b("span"),a=J(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],ee(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),S(h,e,_),S(h,t,_),y(t,i),S(h,l,_),S(h,s,_),y(s,o),y(o,a),u=!0,c||(d=Z(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(se(),L(m,1,1,()=>{m=null}),oe()):m?(m.p(h,_),_[0]&32&&I(m,1)):(m=Uh(h),m.c(),I(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)&&ee(s,"btn-loading",h[7])},i(h){u||(I(m),u=!0)},o(h){L(m),u=!1},d(h){h&&(w(e),w(t),w(l),w(s)),m&&m.d(h),c=!1,d()}}}function gE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[_E],header:[mE],default:[pE]},$$scope:{ctx:n}};return e=new Xt({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||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function bE(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(X){return $(X),t(8,u=!0),r==null?void 0:r.show()}function v(){return r==null?void 0:r.hide()}function $(X){t(1,a=structuredClone(X||{})),C()}function C(){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=""),Gt({})}function T(){if(f||!l)return;t(7,f=!0);const X={email:d,avatar:c};(i||_)&&(X.password=m,X.passwordConfirm=h);let W;i?W=fe.admins.create(X):W=fe.admins.update(a.id,X),W.then(async K=>{var le;t(8,u=!1),v(),Nt(i?"Successfully created admin.":"Successfully updated admin."),((le=fe.authStore.model)==null?void 0:le.id)===K.id&&fe.authStore.save(fe.authStore.token,K),s("save",K)}).catch(K=>{fe.error(K)}).finally(()=>{t(7,f=!1)})}function O(){a!=null&&a.id&&un("Do you really want to delete the selected admin?",()=>fe.admins.delete(a.id).then(()=>{t(8,u=!1),v(),Nt("Successfully deleted admin."),s("delete",a)}).catch(X=>{fe.error(X)}))}const M=()=>O(),E=()=>v(),A=X=>t(2,c=X);function N(){d=this.value,t(3,d)}function q(){_=this.checked,t(4,_)}function R(){m=this.value,t(9,m)}function P(){h=this.value,t(10,h)}const F=()=>l&&u?(un("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,u=!1),v()}),!1):!0;function j(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function U(X){Oe.call(this,n,X)}function Y(X){Oe.call(this,n,X)}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)},[v,a,c,d,_,i,r,f,u,m,h,l,o,T,O,g,M,E,A,N,q,R,P,F,j,U,Y]}class kE extends be{constructor(e){super(),ge(this,e,bE,gE,he,{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 yE(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function vE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function wE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function SE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function Yh(n){let e;function t(s,o){return s[5]?TE:$E}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},m(s,o){l.m(s,o),S(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&&w(e),l.d(s)}}}function $E(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=D(),o&&o.c(),s=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){S(a,e,f),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(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&&w(e),o&&o.d()}}}function TE(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){S(t,e,i)},p:x,d(t){t&&w(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){S(l,e,s),t||(i=Z(e,"click",n[17]),t=!0)},p:x,d(l){l&&w(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){S(t,e,i)},d(t){t&&w(e)}}}function Zh(n,e){let t,i,l,s,o,r,a,f,u,c,d,m=e[24].id+"",h,_,g,v,$,C=e[24].email+"",T,O,M,E,A,N,q,R,P,F,j,U,Y,X;u=new ol({props:{value:e[24].id}});let W=e[24].id===e[7].id&&Jh();A=new tl({props:{date:e[24].created}}),R=new tl({props:{date:e[24].updated}});function K(){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=D(),a=b("td"),f=b("div"),B(u.$$.fragment),c=D(),d=b("span"),h=J(m),_=D(),W&&W.c(),g=D(),v=b("td"),$=b("span"),T=J(C),M=D(),E=b("td"),B(A.$$.fragment),N=D(),q=b("td"),B(R.$$.fragment),P=D(),F=b("td"),F.innerHTML='',j=D(),tn(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($,"class","txt txt-ellipsis"),p($,"title",O=e[24].email),p(v,"class","col-type-email col-field-email"),p(E,"class","col-type-date col-field-created"),p(q,"class","col-type-date col-field-updated"),p(F,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ne,me){S(ne,t,me),y(t,i),y(i,l),y(l,s),y(t,r),y(t,a),y(a,f),z(u,f,null),y(f,c),y(f,d),y(d,h),y(a,_),W&&W.m(a,null),y(t,g),y(t,v),y(v,$),y($,T),y(t,M),y(t,E),z(A,E,null),y(t,N),y(t,q),z(R,q,null),y(t,P),y(t,F),y(t,j),U=!0,Y||(X=[Z(t,"click",K),Z(t,"keydown",le)],Y=!0)},p(ne,me){e=ne,(!U||me&16&&!tn(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Pe={};me&16&&(Pe.value=e[24].id),u.$set(Pe),(!U||me&16)&&m!==(m=e[24].id+"")&&re(h,m),e[24].id===e[7].id?W||(W=Jh(),W.c(),W.m(a,null)):W&&(W.d(1),W=null),(!U||me&16)&&C!==(C=e[24].email+"")&&re(T,C),(!U||me&16&&O!==(O=e[24].email))&&p($,"title",O);const ze={};me&16&&(ze.date=e[24].created),A.$set(ze);const Qe={};me&16&&(Qe.date=e[24].updated),R.$set(Qe)},i(ne){U||(I(u.$$.fragment,ne),I(A.$$.fragment,ne),I(R.$$.fragment,ne),U=!0)},o(ne){L(u.$$.fragment,ne),L(A.$$.fragment,ne),L(R.$$.fragment,ne),U=!1},d(ne){ne&&w(t),V(u),W&&W.d(),V(A),V(R),Y=!1,Te(X)}}}function CE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C,T,O=[],M=new Map,E;function A(K){n[11](K)}let N={class:"col-type-text",name:"id",$$slots:{default:[yE]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),o=new $n({props:N}),te.push(()=>ke(o,"sort",A));function q(K){n[12](K)}let R={class:"col-type-email col-field-email",name:"email",$$slots:{default:[vE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),f=new $n({props:R}),te.push(()=>ke(f,"sort",q));function P(K){n[13](K)}let F={class:"col-type-date col-field-created",name:"created",$$slots:{default:[wE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),d=new $n({props:F}),te.push(()=>ke(d,"sort",P));function j(K){n[14](K)}let U={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[SE]},$$scope:{ctx:n}};n[2]!==void 0&&(U.sort=n[2]),_=new $n({props:U}),te.push(()=>ke(_,"sort",j));let Y=ce(n[4]);const X=K=>K[24].id;for(let K=0;K Admin sign in
",i=D(),B(l.$$.fragment),s=D(),B(o.$$.fragment),r=D(),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"),ee(a,"btn-disabled",n[2]),ee(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),y(e,a),f=!0,u||(c=Z(e,"submit",Ue(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)&&ee(a,"btn-disabled",d[2]),(!f||m&4)&&ee(a,"btn-loading",d[2])},i(d){f||(I(l.$$.fragment,d),I(o.$$.fragment,d),f=!0)},o(d){L(l.$$.fragment,d),L(o.$$.fragment,d),f=!1},d(d){d&&w(e),V(l),V(o),u=!1,c()}}}function PE(n){let e,t;return e=new G1({props:{$$slots:{default:[NE]},$$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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function FE(n,e,t){let i;We(n,Ho,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(()=>{Sa(),nl("/")}).catch(()=>{li("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 RE extends be{constructor(e){super(),ge(this,e,FE,PE,he,{})}}function qE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[HE,({uniqueId:O})=>({18:O}),({uniqueId:O})=>O?262144:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[zE,({uniqueId:O})=>({18:O}),({uniqueId:O})=>O?262144:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[VE,({uniqueId:O})=>({18:O}),({uniqueId:O})=>O?262144:0]},$$scope:{ctx:n}}});let T=n[3]&&Gh(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=D(),s=b("div"),B(o.$$.fragment),r=D(),B(a.$$.fragment),f=D(),u=b("div"),c=b("div"),d=D(),T&&T.c(),m=D(),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],ee(h,"btn-loading",n[2]),p(u,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,M){S(O,e,M),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),z(a,e,null),y(e,f),y(e,u),y(u,c),y(u,d),T&&T.m(u,null),y(u,m),y(u,h),y(h,_),v=!0,$||(C=Z(h,"click",n[12]),$=!0)},p(O,M){const E={};M&786433&&(E.$$scope={dirty:M,ctx:O}),i.$set(E);const A={};M&786433&&(A.$$scope={dirty:M,ctx:O}),o.$set(A);const N={};M&786433&&(N.$$scope={dirty:M,ctx:O}),a.$set(N),O[3]?T?T.p(O,M):(T=Gh(O),T.c(),T.m(u,m)):T&&(T.d(1),T=null),(!v||M&12&&g!==(g=!O[3]||O[2]))&&(h.disabled=g),(!v||M&4)&&ee(h,"btn-loading",O[2])},i(O){v||(I(i.$$.fragment,O),I(o.$$.fragment,O),I(a.$$.fragment,O),v=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),v=!1},d(O){O&&w(e),V(i),V(o),V(a),T&&T.d(),$=!1,C()}}}function jE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:x,i:x,o:x,d(t){t&&w(e)}}}function HE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=J("Application name"),l=D(),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){S(f,e,u),y(e,t),S(f,l,u),S(f,s,u),ae(s,n[0].meta.appName),r||(a=Z(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&&(w(e),w(l),w(s)),r=!1,a()}}}function zE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=J("Application URL"),l=D(),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){S(f,e,u),y(e,t),S(f,l,u),S(f,s,u),ae(s,n[0].meta.appUrl),r||(a=Z(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&&(w(e),w(l),w(s)),r=!1,a()}}}function VE(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=D(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=D(),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){S(c,e,d),e.checked=n[0].meta.hideControls,S(c,i,d),S(c,l,d),y(l,s),y(l,o),y(l,r),f||(u=[Z(e,"change",n[10]),$e(Fe.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&&(w(e),w(i),w(l)),f=!1,Te(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){S(s,e,o),y(e,t),i||(l=Z(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&w(e),i=!1,l()}}}function BE(n){let e,t,i,l,s,o,r,a,f;const u=[jE,qE],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=D(),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){S(m,e,h),S(m,t,h),S(m,i,h),y(i,l),c[s].m(l,null),r=!0,a||(f=Z(l,"submit",Ue(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(se(),L(c[_],1,1,()=>{c[_]=null}),oe(),o=c[s],o?o.p(m,h):(o=c[s]=u[s](m),o.c()),I(o,1),o.m(l,null))},i(m){r||(I(o),r=!0)},o(m){L(o),r=!1},d(m){m&&(w(e),w(t),w(i)),c[s].d(),a=!1,f()}}}function UE(n){let e,t,i,l;return e=new gi({}),i=new kn({props:{$$slots:{default:[BE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(s,o){z(e,s,o),S(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||(I(e.$$.fragment,s),I(i.$$.fragment,s),l=!0)},o(s){L(e.$$.fragment,s),L(i.$$.fragment,s),l=!1},d(s){s&&w(t),V(e,s),V(i,s)}}}function WE(n,e,t){let i,l,s,o;We(n,Qi,O=>t(13,l=O)),We(n,Mo,O=>t(14,s=O)),We(n,At,O=>t(15,o=O)),en(At,o="Application settings",o);let r={},a={},f=!1,u=!1,c="";d();async function d(){t(1,f=!0);try{const O=await fe.settings.getAll()||{};h(O)}catch(O){fe.error(O)}t(1,f=!1)}async function m(){if(!(u||!i)){t(2,u=!0);try{const O=await fe.settings.update(H.filterRedactedProps(a));h(O),Nt("Successfully saved application settings.")}catch(O){fe.error(O)}t(2,u=!1)}}function h(O={}){var M,E;en(Mo,s=(M=O==null?void 0:O.meta)==null?void 0:M.appName,s),en(Qi,l=!!((E=O==null?void 0:O.meta)!=null&&E.hideControls),l),t(0,a={meta:(O==null?void 0:O.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 v(){a.meta.appUrl=this.value,t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>_(),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,v,$,C,T]}class YE extends be{constructor(e){super(),ge(this,e,WE,UE,he,{})}}function KE(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 and use it only with trusted backups!
Backup restore is experimental and 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.
This means that on success all of your data (including app settings, users, admins, etc.) will be replaced with the ones from the backup.
Nothing will happen if the backup is invalid or incompatible (ex. missing
data.db
file).