From 9efd68ff4cb3e3dd39cd4f57c8ad747aafa3484a Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Mon, 9 Dec 2024 12:24:12 +0200 Subject: [PATCH 1/3] [#6066] updated text field validation message --- core/field_text.go | 2 +- ...Jf1CDOL.js => AuthMethodsDocs-DOUEhU-E.js} | 2 +- ...il4P-ZL.js => AuthRefreshDocs-DvYw-jkZ.js} | 2 +- ...eqoG.js => AuthWithOAuth2Docs-JwYoBVwZ.js} | 2 +- ...5DhPmCe.js => AuthWithOtpDocs-Dz4mWsXl.js} | 2 +- ...5u.js => AuthWithPasswordDocs-sk8JSDnL.js} | 2 +- ...s-BXCzlbPG.js => BatchApiDocs-BLANcPai.js} | 2 +- ...tor-7pyapRXP.js => CodeEditor-Bfa8qogr.js} | 2 +- ...-DOHOivQZ.js => CreateApiDocs-CyJpcgbh.js} | 2 +- ...-Cq92M3qc.js => DeleteApiDocs-B6O82IZT.js} | 2 +- ...PQ6URGG.js => EmailChangeDocs-TbOAn4ur.js} | 2 +- ...Sg3pfe.js => FieldsQueryParam-CCSkXZO8.js} | 2 +- ...js => FilterAutocompleteInput-fHLXb8ZI.js} | 2 +- ...cs-B1zjO_1B.js => ListApiDocs-BAgbsZ7y.js} | 2 +- ...-Bqy1Pxsp.js => PageInstaller-BoVX3p9e.js} | 2 +- ... => PageOAuth2RedirectFailure-CiWjdUmU.js} | 2 +- ... => PageOAuth2RedirectSuccess-QlMkpX15.js} | 2 +- ... PageRecordConfirmEmailChange-DObT4JXT.js} | 2 +- ...ageRecordConfirmPasswordReset-K2sQyrEp.js} | 2 +- ...PageRecordConfirmVerification-BncDRzrb.js} | 2 +- ...SuperuserConfirmPasswordReset-BcotKF-n.js} | 2 +- ...SuperuserRequestPasswordReset-hkDUY4aR.js} | 2 +- ...0sANu.js => PasswordResetDocs-ClH0edc2.js} | 2 +- ...LgiyZ5n.js => RealtimeApiDocs-D_C9UwDU.js} | 2 +- ...-DsdeVsYD.js => UpdateApiDocs-CO2UpPcw.js} | 2 +- ...jha8VY.js => VerificationDocs-Fh8xavie.js} | 2 +- ...cs-Dd7XOl9A.js => ViewApiDocs-fmO-uILm.js} | 2 +- .../{index-BqD65rZb.js => index-MfvG--Vz.js} | 122 +++++++++--------- ui/dist/index.html | 2 +- .../collections/schema/SchemaFieldText.svelte | 2 +- .../records/RecordUpsertPanel.svelte | 3 +- 31 files changed, 92 insertions(+), 91 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-BJf1CDOL.js => AuthMethodsDocs-DOUEhU-E.js} (97%) rename ui/dist/assets/{AuthRefreshDocs-Cil4P-ZL.js => AuthRefreshDocs-DvYw-jkZ.js} (98%) rename ui/dist/assets/{AuthWithOAuth2Docs-DSr9eqoG.js => AuthWithOAuth2Docs-JwYoBVwZ.js} (98%) rename ui/dist/assets/{AuthWithOtpDocs-D5DhPmCe.js => AuthWithOtpDocs-Dz4mWsXl.js} (99%) rename ui/dist/assets/{AuthWithPasswordDocs-Bcbb3J5u.js => AuthWithPasswordDocs-sk8JSDnL.js} (98%) rename ui/dist/assets/{BatchApiDocs-BXCzlbPG.js => BatchApiDocs-BLANcPai.js} (99%) rename ui/dist/assets/{CodeEditor-7pyapRXP.js => CodeEditor-Bfa8qogr.js} (99%) rename ui/dist/assets/{CreateApiDocs-DOHOivQZ.js => CreateApiDocs-CyJpcgbh.js} (99%) rename ui/dist/assets/{DeleteApiDocs-Cq92M3qc.js => DeleteApiDocs-B6O82IZT.js} (98%) rename ui/dist/assets/{EmailChangeDocs-uPQ6URGG.js => EmailChangeDocs-TbOAn4ur.js} (99%) rename ui/dist/assets/{FieldsQueryParam-BESg3pfe.js => FieldsQueryParam-CCSkXZO8.js} (96%) rename ui/dist/assets/{FilterAutocompleteInput-RpihTcvl.js => FilterAutocompleteInput-fHLXb8ZI.js} (98%) rename ui/dist/assets/{ListApiDocs-B1zjO_1B.js => ListApiDocs-BAgbsZ7y.js} (99%) rename ui/dist/assets/{PageInstaller-Bqy1Pxsp.js => PageInstaller-BoVX3p9e.js} (98%) rename ui/dist/assets/{PageOAuth2RedirectFailure-acTrdeCH.js => PageOAuth2RedirectFailure-CiWjdUmU.js} (88%) rename ui/dist/assets/{PageOAuth2RedirectSuccess-CoFUeL82.js => PageOAuth2RedirectSuccess-QlMkpX15.js} (88%) rename ui/dist/assets/{PageRecordConfirmEmailChange-BEWFj7Qa.js => PageRecordConfirmEmailChange-DObT4JXT.js} (98%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-D3SGAiQ4.js => PageRecordConfirmPasswordReset-K2sQyrEp.js} (98%) rename ui/dist/assets/{PageRecordConfirmVerification-CO9r4-wZ.js => PageRecordConfirmVerification-BncDRzrb.js} (98%) rename ui/dist/assets/{PageSuperuserConfirmPasswordReset-DyqJmTiD.js => PageSuperuserConfirmPasswordReset-BcotKF-n.js} (98%) rename ui/dist/assets/{PageSuperuserRequestPasswordReset-C6l2tAoS.js => PageSuperuserRequestPasswordReset-hkDUY4aR.js} (98%) rename ui/dist/assets/{PasswordResetDocs-Dnq0sANu.js => PasswordResetDocs-ClH0edc2.js} (99%) rename ui/dist/assets/{RealtimeApiDocs-CLgiyZ5n.js => RealtimeApiDocs-D_C9UwDU.js} (99%) rename ui/dist/assets/{UpdateApiDocs-DsdeVsYD.js => UpdateApiDocs-CO2UpPcw.js} (99%) rename ui/dist/assets/{VerificationDocs-Bojha8VY.js => VerificationDocs-Fh8xavie.js} (99%) rename ui/dist/assets/{ViewApiDocs-Dd7XOl9A.js => ViewApiDocs-fmO-uILm.js} (98%) rename ui/dist/assets/{index-BqD65rZb.js => index-MfvG--Vz.js} (91%) diff --git a/core/field_text.go b/core/field_text.go index 3fda2cd1..fcb56fe8 100644 --- a/core/field_text.go +++ b/core/field_text.go @@ -232,7 +232,7 @@ func (f *TextField) ValidatePlainValue(value string) error { } if max > 0 && length > max { - return validation.NewError("validation_max_text_constraint", "Must be less than {{.max}} character(s)"). + return validation.NewError("validation_max_text_constraint", "Must be no more than {{.max}} character(s)"). SetParams(map[string]any{"max": max}) } diff --git a/ui/dist/assets/AuthMethodsDocs-BJf1CDOL.js b/ui/dist/assets/AuthMethodsDocs-DOUEhU-E.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-BJf1CDOL.js rename to ui/dist/assets/AuthMethodsDocs-DOUEhU-E.js index 70833ff3..f5ca37d7 100644 --- a/ui/dist/assets/AuthMethodsDocs-BJf1CDOL.js +++ b/ui/dist/assets/AuthMethodsDocs-DOUEhU-E.js @@ -1,4 +1,4 @@ -import{S as Be,i as Ce,s as Te,V as Le,X as J,h as c,z as w,j as k,c as ae,k as h,n as d,o as a,m as ne,H as Q,Y as $e,Z as Se,E as je,_ as qe,G as Ee,t as z,a as I,v as u,d as ie,p as oe,J as He,l as N,q as Re,W as Ue}from"./index-BqD65rZb.js";import{F as De}from"./FieldsQueryParam-BESg3pfe.js";function we(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=w(o),b=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(v,y){d(v,l,y),a(l,p),a(l,b),i||(f=Re(l,"click",m),i=!0)},p(v,y){s=v,y&4&&o!==(o=s[8].code+"")&&Q(p,o),y&6&&N(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ue({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&N(l,"active",s[1]===s[8].code)},i(i){b||(z(o.$$.fragment,i),b=!0)},o(i){I(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,y,g=n[0].name+"",O,ce,V,M,W,L,X,A,U,re,D,S,de,Y,F=n[0].name+"",Z,ue,K,j,x,P,ee,fe,te,T,le,q,se,B,E,$=[],me=new Map,pe,H,_=[],be=new Map,C;M=new Le({props:{js:` +import{S as Be,i as Ce,s as Te,V as Le,X as J,h as c,z as w,j as k,c as ae,k as h,n as d,o as a,m as ne,H as Q,Y as $e,Z as Se,E as je,_ as qe,G as Ee,t as z,a as I,v as u,d as ie,p as oe,J as He,l as N,q as Re,W as Ue}from"./index-MfvG--Vz.js";import{F as De}from"./FieldsQueryParam-CCSkXZO8.js";function we(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=w(o),b=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(v,y){d(v,l,y),a(l,p),a(l,b),i||(f=Re(l,"click",m),i=!0)},p(v,y){s=v,y&4&&o!==(o=s[8].code+"")&&Q(p,o),y&6&&N(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ue({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&N(l,"active",s[1]===s[8].code)},i(i){b||(z(o.$$.fragment,i),b=!0)},o(i){I(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,y,g=n[0].name+"",O,ce,V,M,W,L,X,A,U,re,D,S,de,Y,F=n[0].name+"",Z,ue,K,j,x,P,ee,fe,te,T,le,q,se,B,E,$=[],me=new Map,pe,H,_=[],be=new Map,C;M=new Le({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-Cil4P-ZL.js b/ui/dist/assets/AuthRefreshDocs-DvYw-jkZ.js similarity index 98% rename from ui/dist/assets/AuthRefreshDocs-Cil4P-ZL.js rename to ui/dist/assets/AuthRefreshDocs-DvYw-jkZ.js index f6fd2eb0..1525a9ac 100644 --- a/ui/dist/assets/AuthRefreshDocs-Cil4P-ZL.js +++ b/ui/dist/assets/AuthRefreshDocs-DvYw-jkZ.js @@ -1,4 +1,4 @@ -import{S as Ue,i as xe,s as Ke,V as Qe,W as Ne,X as K,h as s,z as k,j as p,c as Q,k as b,n as d,o,m as W,H as de,Y as Le,Z as We,E as Ge,_ as Ie,G as Xe,t as V,a as z,v as u,d as G,J as Oe,p as Ye,l as I,q as Ze}from"./index-BqD65rZb.js";import{F as et}from"./FieldsQueryParam-BESg3pfe.js";function Ve(r,a,l){const n=r.slice();return n[5]=a[l],n}function ze(r,a,l){const n=r.slice();return n[5]=a[l],n}function je(r,a){let l,n=a[5].code+"",m,_,i,h;function g(){return a[4](a[5])}return{key:r,first:null,c(){l=s("button"),m=k(n),_=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(v,w){d(v,l,w),o(l,m),o(l,_),i||(h=Ze(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&I(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function Je(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),Q(n.$$.fragment),m=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(i,h){d(i,l,h),W(n,l,null),o(l,m),_=!0},p(i,h){a=i;const g={};h&4&&(g.content=a[5].body),n.$set(g),(!_||h&6)&&I(l,"active",a[1]===a[5].code)},i(i){_||(V(n.$$.fragment,i),_=!0)},o(i){z(n.$$.fragment,i),_=!1},d(i){i&&u(l),G(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,j,ue,J,M,pe,Y,N=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,q,ie,H,ce,R,E,y=[],Pe=new Map,qe,L,$=[],Ae=new Map,A;v=new Qe({props:{js:` +import{S as Ue,i as xe,s as Ke,V as Qe,W as Ne,X as K,h as s,z as k,j as p,c as Q,k as b,n as d,o,m as W,H as de,Y as Le,Z as We,E as Ge,_ as Ie,G as Xe,t as V,a as z,v as u,d as G,J as Oe,p as Ye,l as I,q as Ze}from"./index-MfvG--Vz.js";import{F as et}from"./FieldsQueryParam-CCSkXZO8.js";function Ve(r,a,l){const n=r.slice();return n[5]=a[l],n}function ze(r,a,l){const n=r.slice();return n[5]=a[l],n}function je(r,a){let l,n=a[5].code+"",m,_,i,h;function g(){return a[4](a[5])}return{key:r,first:null,c(){l=s("button"),m=k(n),_=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(v,w){d(v,l,w),o(l,m),o(l,_),i||(h=Ze(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&I(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function Je(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),Q(n.$$.fragment),m=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(i,h){d(i,l,h),W(n,l,null),o(l,m),_=!0},p(i,h){a=i;const g={};h&4&&(g.content=a[5].body),n.$set(g),(!_||h&6)&&I(l,"active",a[1]===a[5].code)},i(i){_||(V(n.$$.fragment,i),_=!0)},o(i){z(n.$$.fragment,i),_=!1},d(i){i&&u(l),G(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,j,ue,J,M,pe,Y,N=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,q,ie,H,ce,R,E,y=[],Pe=new Map,qe,L,$=[],Ae=new Map,A;v=new Qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-DSr9eqoG.js b/ui/dist/assets/AuthWithOAuth2Docs-JwYoBVwZ.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-DSr9eqoG.js rename to ui/dist/assets/AuthWithOAuth2Docs-JwYoBVwZ.js index 726f13ce..5383f99e 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-DSr9eqoG.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-JwYoBVwZ.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Je,s as xe,V as ze,W as Ve,X as Q,h as o,z as _,j as h,c as G,k as p,n as r,o as a,m as I,H as pe,Y as Ue,Z as Ne,E as Qe,_ as Ge,G as Ie,t as V,a as E,v as c,d as K,J as Be,p as Ke,l as X,q as Xe}from"./index-BqD65rZb.js";import{F as Ye}from"./FieldsQueryParam-BESg3pfe.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l){let n,i=l[5].code+"",f,g,d,b;function k(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=_(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Xe(n,"click",k),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function je(s,l){let n,i,f,g;return i=new Ve({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),G(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),I(i,n,null),a(n,f),g=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),i.$set(k),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(V(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),K(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,D,Y,A,J,be,x,P,me,Z,z=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,_e,ie,ke,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],Re=new Map,De,L,w=[],Pe=new Map,R;v=new ze({props:{js:` +import{S as Ee,i as Je,s as xe,V as ze,W as Ve,X as Q,h as o,z as _,j as h,c as G,k as p,n as r,o as a,m as I,H as pe,Y as Ue,Z as Ne,E as Qe,_ as Ge,G as Ie,t as V,a as E,v as c,d as K,J as Be,p as Ke,l as X,q as Xe}from"./index-MfvG--Vz.js";import{F as Ye}from"./FieldsQueryParam-CCSkXZO8.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l){let n,i=l[5].code+"",f,g,d,b;function k(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=_(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Xe(n,"click",k),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function je(s,l){let n,i,f,g;return i=new Ve({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),G(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),I(i,n,null),a(n,f),g=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),i.$set(k),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(V(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),K(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,D,Y,A,J,be,x,P,me,Z,z=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,_e,ie,ke,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],Re=new Map,De,L,w=[],Pe=new Map,R;v=new ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithOtpDocs-D5DhPmCe.js b/ui/dist/assets/AuthWithOtpDocs-Dz4mWsXl.js similarity index 99% rename from ui/dist/assets/AuthWithOtpDocs-D5DhPmCe.js rename to ui/dist/assets/AuthWithOtpDocs-Dz4mWsXl.js index 03f76e86..b0d07b91 100644 --- a/ui/dist/assets/AuthWithOtpDocs-D5DhPmCe.js +++ b/ui/dist/assets/AuthWithOtpDocs-Dz4mWsXl.js @@ -1,4 +1,4 @@ -import{S as ee,i as te,s as le,X as U,h as p,j as S,z as H,k as g,n as b,o as h,H as X,Y as Z,Z as ge,E as Q,_ as ke,G as x,t as J,a as L,v as _,J as oe,l as Y,q as ae,W as we,c as F,m as G,d as K,V as $e,$ as se,p as Te,a0 as ne}from"./index-BqD65rZb.js";function ie(s,t,e){const a=s.slice();return a[4]=t[e],a}function ce(s,t,e){const a=s.slice();return a[4]=t[e],a}function re(s,t){let e,a=t[4].code+"",d,c,r,n;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=p("button"),d=H(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,y){b(m,e,y),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,y){t=m,y&4&&a!==(a=t[4].code+"")&&X(d,a),y&6&&Y(e,"active",t[1]===t[4].code)},d(m){m&&_(e),r=!1,n()}}}function de(s,t){let e,a,d,c;return a=new we({props:{content:t[4].body}}),{key:s,first:null,c(){e=p("div"),F(a.$$.fragment),d=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(r,n){b(r,e,n),G(a,e,null),h(e,d),c=!0},p(r,n){t=r;const u={};n&4&&(u.content=t[4].body),a.$set(u),(!c||n&6)&&Y(e,"active",t[1]===t[4].code)},i(r){c||(J(a.$$.fragment,r),c=!0)},o(r){L(a.$$.fragment,r),c=!1},d(r){r&&_(e),K(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,y,M,C,B,A,V,R,W,q,P,w=[],$=new Map,E,D,k=[],N=new Map,I,i=U(s[2]);const v=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required otpId
String The id of the OTP request.
Required password
String The one-time password.',V=S(),R=p("div"),R.textContent="Responses",W=S(),q=p("div"),P=p("div");for(let l=0;le(1,d=n.code);return s.$$set=n=>{"collection"in n&&e(0,a=n.collection)},s.$$.update=()=>{s.$$.dirty&1&&e(2,c=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:oe.dummyCollectionRecord(a)},null,2)},{code:400,body:` +import{S as ee,i as te,s as le,X as U,h as p,j as S,z as H,k as g,n as b,o as h,H as X,Y as Z,Z as ge,E as Q,_ as ke,G as x,t as J,a as L,v as _,J as oe,l as Y,q as ae,W as we,c as F,m as G,d as K,V as $e,$ as se,p as Te,a0 as ne}from"./index-MfvG--Vz.js";function ie(s,t,e){const a=s.slice();return a[4]=t[e],a}function ce(s,t,e){const a=s.slice();return a[4]=t[e],a}function re(s,t){let e,a=t[4].code+"",d,c,r,n;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=p("button"),d=H(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,y){b(m,e,y),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,y){t=m,y&4&&a!==(a=t[4].code+"")&&X(d,a),y&6&&Y(e,"active",t[1]===t[4].code)},d(m){m&&_(e),r=!1,n()}}}function de(s,t){let e,a,d,c;return a=new we({props:{content:t[4].body}}),{key:s,first:null,c(){e=p("div"),F(a.$$.fragment),d=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(r,n){b(r,e,n),G(a,e,null),h(e,d),c=!0},p(r,n){t=r;const u={};n&4&&(u.content=t[4].body),a.$set(u),(!c||n&6)&&Y(e,"active",t[1]===t[4].code)},i(r){c||(J(a.$$.fragment,r),c=!0)},o(r){L(a.$$.fragment,r),c=!1},d(r){r&&_(e),K(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,y,M,C,B,A,V,R,W,q,P,w=[],$=new Map,E,D,k=[],N=new Map,I,i=U(s[2]);const v=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required otpId
String The id of the OTP request.
Required password
String The one-time password.',V=S(),R=p("div"),R.textContent="Responses",W=S(),q=p("div"),P=p("div");for(let l=0;le(1,d=n.code);return s.$$set=n=>{"collection"in n&&e(0,a=n.collection)},s.$$.update=()=>{s.$$.dirty&1&&e(2,c=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:oe.dummyCollectionRecord(a)},null,2)},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/AuthWithPasswordDocs-Bcbb3J5u.js b/ui/dist/assets/AuthWithPasswordDocs-sk8JSDnL.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-Bcbb3J5u.js rename to ui/dist/assets/AuthWithPasswordDocs-sk8JSDnL.js index e91de498..830bbce7 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-Bcbb3J5u.js +++ b/ui/dist/assets/AuthWithPasswordDocs-sk8JSDnL.js @@ -1,4 +1,4 @@ -import{S as kt,i as gt,s as vt,V as St,X as B,W as _t,h as s,z as f,j as u,c as ae,k,n as c,o as t,m as oe,H as X,Y as ct,Z as wt,E as yt,_ as $t,G as Pt,t as G,a as K,v as d,d as se,$ as Rt,J as dt,p as Ct,l as ne,q as Ot}from"./index-BqD65rZb.js";import{F as Tt}from"./FieldsQueryParam-BESg3pfe.js";function pt(i,o,a){const n=i.slice();return n[7]=o[a],n}function ut(i,o,a){const n=i.slice();return n[7]=o[a],n}function ht(i,o,a){const n=i.slice();return n[12]=o[a],n[14]=a,n}function At(i){let o;return{c(){o=f("or")},m(a,n){c(a,o,n)},d(a){a&&d(o)}}}function bt(i){let o,a,n=i[12]+"",m,b=i[14]>0&&At();return{c(){b&&b.c(),o=u(),a=s("strong"),m=f(n)},m(r,h){b&&b.m(r,h),c(r,o,h),c(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&X(m,n)},d(r){r&&(d(o),d(a)),b&&b.d(r)}}}function ft(i,o){let a,n=o[7].code+"",m,b,r,h;function g(){return o[6](o[7])}return{key:i,first:null,c(){a=s("button"),m=f(n),b=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m($,_){c($,a,_),t(a,m),t(a,b),r||(h=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&X(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&d(a),r=!1,h()}}}function mt(i,o){let a,n,m,b;return n=new _t({props:{content:o[7].body}}),{key:i,first:null,c(){a=s("div"),ae(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){c(r,a,h),oe(n,a,null),t(a,m),b=!0},p(r,h){o=r;const g={};h&8&&(g.content=o[7].body),n.$set(g),(!b||h&12)&&ne(a,"active",o[2]===o[7].code)},i(r){b||(G(n.$$.fragment,r),b=!0)},o(r){K(n.$$.fragment,r),b=!1},d(r){r&&d(a),se(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,Z=i[1].join("/")+"",ie,De,re,We,ce,R,de,H,pe,C,x,Fe,ee,L,Me,ue,te=i[0].name+"",he,Ue,be,j,fe,O,me,qe,Y,T,_e,Be,ke,He,E,ge,Le,ve,Se,V,we,A,ye,je,N,D,$e,Ye,Pe,Ee,v,Ve,M,Ne,Je,Ie,Re,Qe,Ce,ze,Ge,Ke,Oe,Xe,Ze,U,Te,J,Ae,W,I,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;R=new St({props:{js:` +import{S as kt,i as gt,s as vt,V as St,X as B,W as _t,h as s,z as f,j as u,c as ae,k,n as c,o as t,m as oe,H as X,Y as ct,Z as wt,E as yt,_ as $t,G as Pt,t as G,a as K,v as d,d as se,$ as Rt,J as dt,p as Ct,l as ne,q as Ot}from"./index-MfvG--Vz.js";import{F as Tt}from"./FieldsQueryParam-CCSkXZO8.js";function pt(i,o,a){const n=i.slice();return n[7]=o[a],n}function ut(i,o,a){const n=i.slice();return n[7]=o[a],n}function ht(i,o,a){const n=i.slice();return n[12]=o[a],n[14]=a,n}function At(i){let o;return{c(){o=f("or")},m(a,n){c(a,o,n)},d(a){a&&d(o)}}}function bt(i){let o,a,n=i[12]+"",m,b=i[14]>0&&At();return{c(){b&&b.c(),o=u(),a=s("strong"),m=f(n)},m(r,h){b&&b.m(r,h),c(r,o,h),c(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&X(m,n)},d(r){r&&(d(o),d(a)),b&&b.d(r)}}}function ft(i,o){let a,n=o[7].code+"",m,b,r,h;function g(){return o[6](o[7])}return{key:i,first:null,c(){a=s("button"),m=f(n),b=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m($,_){c($,a,_),t(a,m),t(a,b),r||(h=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&X(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&d(a),r=!1,h()}}}function mt(i,o){let a,n,m,b;return n=new _t({props:{content:o[7].body}}),{key:i,first:null,c(){a=s("div"),ae(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){c(r,a,h),oe(n,a,null),t(a,m),b=!0},p(r,h){o=r;const g={};h&8&&(g.content=o[7].body),n.$set(g),(!b||h&12)&&ne(a,"active",o[2]===o[7].code)},i(r){b||(G(n.$$.fragment,r),b=!0)},o(r){K(n.$$.fragment,r),b=!1},d(r){r&&d(a),se(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,Z=i[1].join("/")+"",ie,De,re,We,ce,R,de,H,pe,C,x,Fe,ee,L,Me,ue,te=i[0].name+"",he,Ue,be,j,fe,O,me,qe,Y,T,_e,Be,ke,He,E,ge,Le,ve,Se,V,we,A,ye,je,N,D,$e,Ye,Pe,Ee,v,Ve,M,Ne,Je,Ie,Re,Qe,Ce,ze,Ge,Ke,Oe,Xe,Ze,U,Te,J,Ae,W,I,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;R=new St({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[5]}'); diff --git a/ui/dist/assets/BatchApiDocs-BXCzlbPG.js b/ui/dist/assets/BatchApiDocs-BLANcPai.js similarity index 99% rename from ui/dist/assets/BatchApiDocs-BXCzlbPG.js rename to ui/dist/assets/BatchApiDocs-BLANcPai.js index ee21ff42..91483649 100644 --- a/ui/dist/assets/BatchApiDocs-BXCzlbPG.js +++ b/ui/dist/assets/BatchApiDocs-BLANcPai.js @@ -1,4 +1,4 @@ -import{S as St,i as Lt,s as jt,V as At,W as It,X as Z,h as o,z as _,j as i,c as Re,k as b,n as d,o as t,m as Te,C as Mt,D as Nt,H as Ut,Y as Pt,Z as zt,E as Jt,_ as Wt,G as Gt,t as Q,a as x,v as u,d as Pe,J as Ft,p as Kt,l as ee,q as Vt}from"./index-BqD65rZb.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s){let n,c,y;function f(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),c||(y=Vt(n,"click",f),c=!0)},p(r,h){s=r,h&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function Ht(a,s){let n,c,y,f;return c=new It({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),Te(c,n,null),t(n,y),f=!0},p(r,h){s=r,(!f||h&10)&&ee(n,"active",s[1]===s[6].code)},i(r){f||(Q(c.$$.fragment,r),f=!0)},o(r){x(c.$$.fragment,r),f=!1},d(r){r&&u(n),Pe(c)}}}function Xt(a){var pt,mt,bt,ht,ft,_t,yt,kt;let s,n,c=a[0].name+"",y,f,r,h,F,g,U,Fe,P,B,Be,E,Ee,Oe,te,le,q,oe,O,ae,H,se,I,ne,z,ie,w,ce,He,re,S,J,Ie,k,W,Se,de,Le,C,G,je,ue,Ae,K,Me,pe,Ne,D,Ue,me,ze,Je,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ye,p,_e,Ze,ye,Qe,ke,xe,$e,et,ge,tt,ve,lt,ot,at,Ce,st,R,De,L,qe,T,j,v=[],nt=new Map,it,A,$=[],ct=new Map,M,we,rt;q=new At({props:{js:` +import{S as St,i as Lt,s as jt,V as At,W as It,X as Z,h as o,z as _,j as i,c as Re,k as b,n as d,o as t,m as Te,C as Mt,D as Nt,H as Ut,Y as Pt,Z as zt,E as Jt,_ as Wt,G as Gt,t as Q,a as x,v as u,d as Pe,J as Ft,p as Kt,l as ee,q as Vt}from"./index-MfvG--Vz.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s){let n,c,y;function f(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),c||(y=Vt(n,"click",f),c=!0)},p(r,h){s=r,h&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function Ht(a,s){let n,c,y,f;return c=new It({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),Te(c,n,null),t(n,y),f=!0},p(r,h){s=r,(!f||h&10)&&ee(n,"active",s[1]===s[6].code)},i(r){f||(Q(c.$$.fragment,r),f=!0)},o(r){x(c.$$.fragment,r),f=!1},d(r){r&&u(n),Pe(c)}}}function Xt(a){var pt,mt,bt,ht,ft,_t,yt,kt;let s,n,c=a[0].name+"",y,f,r,h,F,g,U,Fe,P,B,Be,E,Ee,Oe,te,le,q,oe,O,ae,H,se,I,ne,z,ie,w,ce,He,re,S,J,Ie,k,W,Se,de,Le,C,G,je,ue,Ae,K,Me,pe,Ne,D,Ue,me,ze,Je,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ye,p,_e,Ze,ye,Qe,ke,xe,$e,et,ge,tt,ve,lt,ot,at,Ce,st,R,De,L,qe,T,j,v=[],nt=new Map,it,A,$=[],ct=new Map,M,we,rt;q=new At({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[2]}'); diff --git a/ui/dist/assets/CodeEditor-7pyapRXP.js b/ui/dist/assets/CodeEditor-Bfa8qogr.js similarity index 99% rename from ui/dist/assets/CodeEditor-7pyapRXP.js rename to ui/dist/assets/CodeEditor-Bfa8qogr.js index b86fdbfb..8616ab97 100644 --- a/ui/dist/assets/CodeEditor-7pyapRXP.js +++ b/ui/dist/assets/CodeEditor-Bfa8qogr.js @@ -1,4 +1,4 @@ -import{S as wt,i as vt,s as qt,h as Yt,k as Tt,a1 as OO,n as Rt,I as IO,v as Vt,O as _t,T as jt,U as zt,Q as Gt,J as Ut,y as Ct}from"./index-BqD65rZb.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-C-PlLH2L.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a,apply:a+": "}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { +import{S as wt,i as vt,s as qt,h as Yt,k as Tt,a1 as OO,n as Rt,I as IO,v as Vt,O as _t,T as jt,U as zt,Q as Gt,J as Ut,y as Ct}from"./index-MfvG--Vz.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-C-PlLH2L.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a,apply:a+": "}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/CreateApiDocs-DOHOivQZ.js b/ui/dist/assets/CreateApiDocs-CyJpcgbh.js similarity index 99% rename from ui/dist/assets/CreateApiDocs-DOHOivQZ.js rename to ui/dist/assets/CreateApiDocs-CyJpcgbh.js index f12c6fd5..70e633ea 100644 --- a/ui/dist/assets/CreateApiDocs-DOHOivQZ.js +++ b/ui/dist/assets/CreateApiDocs-CyJpcgbh.js @@ -1,4 +1,4 @@ -import{S as $t,i as qt,s as St,V as Tt,J as ee,X as ue,W as Ct,h as s,z as _,j as p,c as $e,k as w,n as r,o as i,m as qe,H as oe,Y as Ve,Z as pt,E as Ot,_ as Mt,G as Lt,t as ye,a as ve,v as d,d as Se,p as Pt,l as Te,q as Ft,I as we,L as Ht}from"./index-BqD65rZb.js";import{F as Rt}from"./FieldsQueryParam-BESg3pfe.js";function mt(a,e,t){const l=a.slice();return l[10]=e[t],l}function bt(a,e,t){const l=a.slice();return l[10]=e[t],l}function _t(a,e,t){const l=a.slice();return l[15]=e[t],l}function kt(a){let e;return{c(){e=s("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function ht(a){let e,t,l,u,c,f,b,m,$,h,g,A,T,O,R,M,I,J,S,Q,L,q,k,P,te,Y,U,re,G,K,X;function fe(y,C){var V,W,H;return C&1&&(f=null),f==null&&(f=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Kt))!=null&&H.required)),f?At:jt}let le=fe(a,-1),E=le(a);function Z(y,C){var V,W,H;return C&1&&(I=null),I==null&&(I=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Gt))!=null&&H.required)),I?Vt:Bt}let x=Z(a,-1),F=x(a);return{c(){e=s("tr"),e.innerHTML='Auth specific fields',t=p(),l=s("tr"),u=s("td"),c=s("div"),E.c(),b=p(),m=s("span"),m.textContent="email",$=p(),h=s("td"),h.innerHTML='String',g=p(),A=s("td"),A.textContent="Auth record email address.",T=p(),O=s("tr"),R=s("td"),M=s("div"),F.c(),J=p(),S=s("span"),S.textContent="emailVisibility",Q=p(),L=s("td"),L.innerHTML='Boolean',q=p(),k=s("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",P=p(),te=s("tr"),te.innerHTML='
Required password
String Auth record password.',Y=p(),U=s("tr"),U.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',re=p(),G=s("tr"),G.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not. +import{S as $t,i as qt,s as St,V as Tt,J as ee,X as ue,W as Ct,h as s,z as _,j as p,c as $e,k as w,n as r,o as i,m as qe,H as oe,Y as Ve,Z as pt,E as Ot,_ as Mt,G as Lt,t as ye,a as ve,v as d,d as Se,p as Pt,l as Te,q as Ft,I as we,L as Ht}from"./index-MfvG--Vz.js";import{F as Rt}from"./FieldsQueryParam-CCSkXZO8.js";function mt(a,e,t){const l=a.slice();return l[10]=e[t],l}function bt(a,e,t){const l=a.slice();return l[10]=e[t],l}function _t(a,e,t){const l=a.slice();return l[15]=e[t],l}function kt(a){let e;return{c(){e=s("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function ht(a){let e,t,l,u,c,f,b,m,$,h,g,A,T,O,R,M,I,J,S,Q,L,q,k,P,te,Y,U,re,G,K,X;function fe(y,C){var V,W,H;return C&1&&(f=null),f==null&&(f=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Kt))!=null&&H.required)),f?At:jt}let le=fe(a,-1),E=le(a);function Z(y,C){var V,W,H;return C&1&&(I=null),I==null&&(I=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Gt))!=null&&H.required)),I?Vt:Bt}let x=Z(a,-1),F=x(a);return{c(){e=s("tr"),e.innerHTML='Auth specific fields',t=p(),l=s("tr"),u=s("td"),c=s("div"),E.c(),b=p(),m=s("span"),m.textContent="email",$=p(),h=s("td"),h.innerHTML='String',g=p(),A=s("td"),A.textContent="Auth record email address.",T=p(),O=s("tr"),R=s("td"),M=s("div"),F.c(),J=p(),S=s("span"),S.textContent="emailVisibility",Q=p(),L=s("td"),L.innerHTML='Boolean',q=p(),k=s("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",P=p(),te=s("tr"),te.innerHTML='
Required password
String Auth record password.',Y=p(),U=s("tr"),U.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',re=p(),G=s("tr"),G.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
This field can be set only by superusers or auth records with "Manage" access.`,K=p(),X=s("tr"),X.innerHTML='Other fields',w(c,"class","inline-flex"),w(M,"class","inline-flex")},m(y,C){r(y,e,C),r(y,t,C),r(y,l,C),i(l,u),i(u,c),E.m(c,null),i(c,b),i(c,m),i(l,$),i(l,h),i(l,g),i(l,A),r(y,T,C),r(y,O,C),i(O,R),i(R,M),F.m(M,null),i(M,J),i(M,S),i(O,Q),i(O,L),i(O,q),i(O,k),r(y,P,C),r(y,te,C),r(y,Y,C),r(y,U,C),r(y,re,C),r(y,G,C),r(y,K,C),r(y,X,C)},p(y,C){le!==(le=fe(y,C))&&(E.d(1),E=le(y),E&&(E.c(),E.m(c,b))),x!==(x=Z(y,C))&&(F.d(1),F=x(y),F&&(F.c(),F.m(M,J)))},d(y){y&&(d(e),d(t),d(l),d(T),d(O),d(P),d(te),d(Y),d(U),d(re),d(G),d(K),d(X)),E.d(),F.d()}}}function jt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function At(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Bt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Vt(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Nt(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Dt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Jt(a){let e,t=a[15].maxSelect===1?"id":"ids",l,u;return{c(){e=_("Relation record "),l=_(t),u=_(".")},m(c,f){r(c,e,f),r(c,l,f),r(c,u,f)},p(c,f){f&64&&t!==(t=c[15].maxSelect===1?"id":"ids")&&oe(l,t)},d(c){c&&(d(e),d(l),d(u))}}}function Et(a){let e,t,l,u,c,f,b,m,$;return{c(){e=_("File object."),t=s("br"),l=_(` Set to empty value (`),u=s("code"),u.textContent="null",c=_(", "),f=s("code"),f.textContent='""',b=_(" or "),m=s("code"),m.textContent="[]",$=_(`) to delete diff --git a/ui/dist/assets/DeleteApiDocs-Cq92M3qc.js b/ui/dist/assets/DeleteApiDocs-B6O82IZT.js similarity index 98% rename from ui/dist/assets/DeleteApiDocs-Cq92M3qc.js rename to ui/dist/assets/DeleteApiDocs-B6O82IZT.js index 35a81b33..cd7e7252 100644 --- a/ui/dist/assets/DeleteApiDocs-Cq92M3qc.js +++ b/ui/dist/assets/DeleteApiDocs-B6O82IZT.js @@ -1,4 +1,4 @@ -import{S as Re,i as Ee,s as Pe,V as Te,X as U,h as c,z as y,j as k,c as De,k as m,n as p,o as i,m as Ce,H as ee,Y as he,Z as Be,E as Oe,_ as Ie,G as qe,t as te,a as le,v as f,d as we,J as Ae,p as Me,l as z,q as He,W as Le}from"./index-BqD65rZb.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&f(l)}}}function ye(a,l){let s,o,h;function r(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),o||(h=He(s,"click",r),o=!0)},p(n,d){l=n,d&20&&z(s,"active",l[2]===l[6].code)},d(n){n&&f(s),o=!1,h()}}}function $e(a,l){let s,o,h,r;return o=new Le({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),Ce(o,s,null),i(s,h),r=!0},p(n,d){l=n,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(n){r||(te(o.$$.fragment,n),r=!0)},o(n){le(o.$$.fragment,n),r=!1},d(n){n&&f(s),we(o)}}}function Se(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,M=a[0].name+"",G,se,J,C,K,P,N,g,H,ae,L,E,oe,V,S=a[0].name+"",W,ne,X,ie,Y,T,Z,B,Q,O,x,w,I,v=[],ce=new Map,re,q,b=[],de=new Map,R;C=new Te({props:{js:` +import{S as Re,i as Ee,s as Pe,V as Te,X as U,h as c,z as y,j as k,c as De,k as m,n as p,o as i,m as Ce,H as ee,Y as he,Z as Be,E as Oe,_ as Ie,G as qe,t as te,a as le,v as f,d as we,J as Ae,p as Me,l as z,q as He,W as Le}from"./index-MfvG--Vz.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&f(l)}}}function ye(a,l){let s,o,h;function r(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),o||(h=He(s,"click",r),o=!0)},p(n,d){l=n,d&20&&z(s,"active",l[2]===l[6].code)},d(n){n&&f(s),o=!1,h()}}}function $e(a,l){let s,o,h,r;return o=new Le({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),Ce(o,s,null),i(s,h),r=!0},p(n,d){l=n,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(n){r||(te(o.$$.fragment,n),r=!0)},o(n){le(o.$$.fragment,n),r=!1},d(n){n&&f(s),we(o)}}}function Se(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,M=a[0].name+"",G,se,J,C,K,P,N,g,H,ae,L,E,oe,V,S=a[0].name+"",W,ne,X,ie,Y,T,Z,B,Q,O,x,w,I,v=[],ce=new Map,re,q,b=[],de=new Map,R;C=new Te({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/EmailChangeDocs-uPQ6URGG.js b/ui/dist/assets/EmailChangeDocs-TbOAn4ur.js similarity index 99% rename from ui/dist/assets/EmailChangeDocs-uPQ6URGG.js rename to ui/dist/assets/EmailChangeDocs-TbOAn4ur.js index ced574fa..1abb68c3 100644 --- a/ui/dist/assets/EmailChangeDocs-uPQ6URGG.js +++ b/ui/dist/assets/EmailChangeDocs-TbOAn4ur.js @@ -1,4 +1,4 @@ -import{S as se,i as oe,s as ie,X as I,h as p,j as C,z as U,k as b,n as g,o as u,H as F,Y as le,Z as Re,E as ne,_ as Se,G as ae,t as V,a as X,v,l as K,q as ce,W as Oe,c as x,m as ee,d as te,V as Me,$ as _e,J as Be,p as De,a0 as be}from"./index-BqD65rZb.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&F(d,l),A&6&&K(t,"active",e[1]===e[4].code)},d(k){k&&v(t),r=!1,a()}}}function $e(n,e){let t,l,d,i;return l=new Oe({props:{content:e[4].body}}),{key:n,first:null,c(){t=p("div"),x(l.$$.fragment),d=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(r,a){g(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&K(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function He(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,Y,W,J,L,z,B,D,S,H,q=[],O=new Map,P,j,T=[],N=new Map,w,E=I(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);N.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=C(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),Y=C(),W=p("div"),W.textContent="Body Parameters",J=C(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=C(),B=p("div"),B.textContent="Responses",D=C(),S=p("div"),H=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as oe,s as ie,X as I,h as p,j as C,z as U,k as b,n as g,o as u,H as F,Y as le,Z as Re,E as ne,_ as Se,G as ae,t as V,a as X,v,l as K,q as ce,W as Oe,c as x,m as ee,d as te,V as Me,$ as _e,J as Be,p as De,a0 as be}from"./index-MfvG--Vz.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&F(d,l),A&6&&K(t,"active",e[1]===e[4].code)},d(k){k&&v(t),r=!1,a()}}}function $e(n,e){let t,l,d,i;return l=new Oe({props:{content:e[4].body}}),{key:n,first:null,c(){t=p("div"),x(l.$$.fragment),d=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(r,a){g(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&K(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function He(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,Y,W,J,L,z,B,D,S,H,q=[],O=new Map,P,j,T=[],N=new Map,w,E=I(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);N.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=C(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),Y=C(),W=p("div"),W.textContent="Body Parameters",J=C(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=C(),B=p("div"),B.textContent="Responses",D=C(),S=p("div"),H=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/FieldsQueryParam-BESg3pfe.js b/ui/dist/assets/FieldsQueryParam-CCSkXZO8.js similarity index 96% rename from ui/dist/assets/FieldsQueryParam-BESg3pfe.js rename to ui/dist/assets/FieldsQueryParam-CCSkXZO8.js index 8a9781c4..43219a06 100644 --- a/ui/dist/assets/FieldsQueryParam-BESg3pfe.js +++ b/ui/dist/assets/FieldsQueryParam-CCSkXZO8.js @@ -1,4 +1,4 @@ -import{S as I,i as J,s as N,W as O,h as t,j as c,z as i,c as P,k as Q,n as R,o as e,m as W,H as A,t as D,a as G,v as K,d as U}from"./index-BqD65rZb.js";function V(f){let n,o,u,d,v,s,p,y,g,F,r,S,_,w,b,E,C,a,$,H,L,q,M,T,m,j,k,z,x;return r=new O({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),y=i(`Comma separated string of the fields to return in the JSON response +import{S as I,i as J,s as N,W as O,h as t,j as c,z as i,c as P,k as Q,n as R,o as e,m as W,H as A,t as D,a as G,v as K,d as U}from"./index-MfvG--Vz.js";function V(f){let n,o,u,d,v,s,p,y,g,F,r,S,_,w,b,E,C,a,$,H,L,q,M,T,m,j,k,z,x;return r=new O({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),y=i(`Comma separated string of the fields to return in the JSON response `),g=t("em"),g.textContent="(by default returns all fields)",F=i(`. Ex.: `),P(r.$$.fragment),S=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",w=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",H=c(),L=t("br"),q=i(` Returns a short plain text version of the field string value. diff --git a/ui/dist/assets/FilterAutocompleteInput-RpihTcvl.js b/ui/dist/assets/FilterAutocompleteInput-fHLXb8ZI.js similarity index 98% rename from ui/dist/assets/FilterAutocompleteInput-RpihTcvl.js rename to ui/dist/assets/FilterAutocompleteInput-fHLXb8ZI.js index 7554bf11..e3ae8092 100644 --- a/ui/dist/assets/FilterAutocompleteInput-RpihTcvl.js +++ b/ui/dist/assets/FilterAutocompleteInput-fHLXb8ZI.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,h as ne,k as re,n as ie,I,v as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-BqD65rZb.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ke,n as Ce,o as Re,p as Le,q as Q,C as R,S as qe,t as ve,u as Oe,v as We}from"./index-C-PlLH2L.js";function _e(e){return new Worker(""+new URL("autocomplete.worker-BdIjQwYp.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Ie(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],a=e[h],i=0;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,D=new R,J=new R,A=new R,B=new R,v=new _e,M=[],T=[],H=[],K="",O="";function W(){d==null||d.focus()}let _=null;v.onmessage=n=>{H=n.data.baseKeys||[],M=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function G(){clearTimeout(_),_=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function U(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function F(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",W)}function N(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",W)}function Y(n=!0,c=!0){let l=[].concat(L);return l=l.concat(H||[]),n&&(l=l.concat(M||[])),c&&(l=l.concat(T||[])),l}function z(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=We(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let C=Y(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return qe.define(Ie({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",a)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(Oe,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[z],icons:!1}),B.of(Q(o)),J.of(E.editable.of(!i)),A.of(S.readOnly.of(i)),D.of(P()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),U())})]})})),()=>{clearTimeout(_),F(),d==null||d.destroy(),v.terminate()}});function X(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,K=He(s)),e.$$.dirty[0]&25352&&!i&&(O!=K||b!==-1||m!==-1)&&(t(14,O=K),G()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[D.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!i)),A.reconfigure(S.readOnly.of(i))]}),t(12,q=i),U()),e.$$.dirty[0]&2050&&d&&a!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:a}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[B.reconfigure(Q(o))]})},[p,a,f,i,o,s,y,L,b,m,W,d,q,K,O,X]}class Pe extends ${constructor(r){super(),ee(this,r,Ue,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Pe as default}; +import{S as $,i as ee,s as te,h as ne,k as re,n as ie,I,v as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-MfvG--Vz.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ke,n as Ce,o as Re,p as Le,q as Q,C as R,S as qe,t as ve,u as Oe,v as We}from"./index-C-PlLH2L.js";function _e(e){return new Worker(""+new URL("autocomplete.worker-BdIjQwYp.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Ie(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],a=e[h],i=0;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,D=new R,J=new R,A=new R,B=new R,v=new _e,M=[],T=[],H=[],K="",O="";function W(){d==null||d.focus()}let _=null;v.onmessage=n=>{H=n.data.baseKeys||[],M=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function G(){clearTimeout(_),_=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function U(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function F(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",W)}function N(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",W)}function Y(n=!0,c=!0){let l=[].concat(L);return l=l.concat(H||[]),n&&(l=l.concat(M||[])),c&&(l=l.concat(T||[])),l}function z(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=We(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let C=Y(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return qe.define(Ie({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",a)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(Oe,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[z],icons:!1}),B.of(Q(o)),J.of(E.editable.of(!i)),A.of(S.readOnly.of(i)),D.of(P()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),U())})]})})),()=>{clearTimeout(_),F(),d==null||d.destroy(),v.terminate()}});function X(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,K=He(s)),e.$$.dirty[0]&25352&&!i&&(O!=K||b!==-1||m!==-1)&&(t(14,O=K),G()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[D.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!i)),A.reconfigure(S.readOnly.of(i))]}),t(12,q=i),U()),e.$$.dirty[0]&2050&&d&&a!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:a}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[B.reconfigure(Q(o))]})},[p,a,f,i,o,s,y,L,b,m,W,d,q,K,O,X]}class Pe extends ${constructor(r){super(),ee(this,r,Ue,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Pe as default}; diff --git a/ui/dist/assets/ListApiDocs-B1zjO_1B.js b/ui/dist/assets/ListApiDocs-BAgbsZ7y.js similarity index 99% rename from ui/dist/assets/ListApiDocs-B1zjO_1B.js rename to ui/dist/assets/ListApiDocs-BAgbsZ7y.js index 9ad012ff..5527dfc8 100644 --- a/ui/dist/assets/ListApiDocs-B1zjO_1B.js +++ b/ui/dist/assets/ListApiDocs-BAgbsZ7y.js @@ -1,4 +1,4 @@ -import{S as el,i as ll,s as sl,h as e,j as s,L as ol,k as a,n as m,q as nl,I as Ue,v as h,z as g,o as t,V as al,W as Le,X as ae,c as Kt,m as Qt,H as ve,Y as Je,Z as il,E as rl,_ as cl,G as dl,t as Ct,a as kt,d as Vt,$ as pl,J as Te,p as fl,l as Ae}from"./index-BqD65rZb.js";import{F as ul}from"./FieldsQueryParam-BESg3pfe.js";function ml(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function hl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,S,Xt,H,it,P,Z,ie,j,z,re,rt,vt,tt,Ft,ce,ct,dt,et,q,Yt,Lt,k,lt,At,Zt,Tt,U,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,D,Et,nt,St,F,ut,fe,J,qt,ee,Nt,le,Ht,ue,L,mt,me,ht,he,M,be,T,Dt,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,zt,Ce,G,ke,wt,se,R,xt,V,W,O,Ut,ne,X;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as el,i as ll,s as sl,h as e,j as s,L as ol,k as a,n as m,q as nl,I as Ue,v as h,z as g,o as t,V as al,W as Le,X as ae,c as Kt,m as Qt,H as ve,Y as Je,Z as il,E as rl,_ as cl,G as dl,t as Ct,a as kt,d as Vt,$ as pl,J as Te,p as fl,l as Ae}from"./index-MfvG--Vz.js";import{F as ul}from"./FieldsQueryParam-CCSkXZO8.js";function ml(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function hl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,S,Xt,H,it,P,Z,ie,j,z,re,rt,vt,tt,Ft,ce,ct,dt,et,q,Yt,Lt,k,lt,At,Zt,Tt,U,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,D,Et,nt,St,F,ut,fe,J,qt,ee,Nt,le,Ht,ue,L,mt,me,ht,he,M,be,T,Dt,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,zt,Ce,G,ke,wt,se,R,xt,V,W,O,Ut,ne,X;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,b=s(),p=e("li"),u=e("code"),u.textContent="OPERATOR",C=g(` - is one of: `),_=e("br"),x=s(),d=e("ul"),Y=e("li"),yt=e("code"),yt.textContent="=",Wt=s(),S=e("span"),S.textContent="Equal",Xt=s(),H=e("li"),it=e("code"),it.textContent="!=",P=s(),Z=e("span"),Z.textContent="NOT equal",ie=s(),j=e("li"),z=e("code"),z.textContent=">",re=s(),rt=e("span"),rt.textContent="Greater than",vt=s(),tt=e("li"),Ft=e("code"),Ft.textContent=">=",ce=s(),ct=e("span"),ct.textContent="Greater than or equal",dt=s(),et=e("li"),q=e("code"),q.textContent="<",Yt=s(),Lt=e("span"),Lt.textContent="Less than",k=s(),lt=e("li"),At=e("code"),At.textContent="<=",Zt=s(),Tt=e("span"),Tt.textContent="Less than or equal",U=s(),st=e("li"),Pt=e("code"),Pt.textContent="~",te=s(),Rt=e("span"),Rt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/PageInstaller-Bqy1Pxsp.js b/ui/dist/assets/PageInstaller-BoVX3p9e.js similarity index 98% rename from ui/dist/assets/PageInstaller-Bqy1Pxsp.js rename to ui/dist/assets/PageInstaller-BoVX3p9e.js index 77aae97b..1ba546de 100644 --- a/ui/dist/assets/PageInstaller-Bqy1Pxsp.js +++ b/ui/dist/assets/PageInstaller-BoVX3p9e.js @@ -1,3 +1,3 @@ -import{S as W,i as G,s as J,F as Q,c as S,m as E,t as O,a as j,d as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as k,j as q,k as r,l as z,n as m,o as T,q as I,u as Z,v as h,w as x,x as ee,y as U,z as N,A,B as te}from"./index-BqD65rZb.js";function ne(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Email"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","email"),r(e,"autocomplete","off"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),s[11](e),A(e,s[2]),_||(d=I(e,"input",s[12]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&4&&e.value!==a[2]&&A(e,a[2])},d(a){a&&(h(t),h(n),h(e)),s[11](null),_=!1,d()}}}function le(s){let t,o,u,n,e,p,_,d,a,i;return{c(){t=k("label"),o=N("Password"),n=q(),e=k("input"),_=q(),d=k("div"),d.textContent="Recommended at least 10 characters.",r(t,"for",u=s[20]),r(e,"type","password"),r(e,"autocomplete","new-password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0,r(d,"class","help-block")},m(c,g){m(c,t,g),T(t,o),m(c,n,g),m(c,e,g),A(e,s[3]),m(c,_,g),m(c,d,g),a||(i=I(e,"input",s[13]),a=!0)},p(c,g){g&1048576&&u!==(u=c[20])&&r(t,"for",u),g&1048576&&p!==(p=c[20])&&r(e,"id",p),g&128&&(e.disabled=c[7]),g&8&&e.value!==c[3]&&A(e,c[3])},d(c){c&&(h(t),h(n),h(e),h(_),h(d)),a=!1,i()}}}function se(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Password confirm"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),A(e,s[4]),_||(d=I(e,"input",s[14]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&16&&e.value!==a[4]&&A(e,a[4])},d(a){a&&(h(t),h(n),h(e)),_=!1,d()}}}function ie(s){let t,o,u,n,e,p,_,d,a,i,c,g,B,w,F,$,v,y,L;return n=new K({props:{class:"form-field required",name:"email",$$slots:{default:[ne,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),p=new K({props:{class:"form-field required",name:"password",$$slots:{default:[le,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),d=new K({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[se,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),{c(){t=k("form"),o=k("div"),o.innerHTML="

Create your first superuser account in order to continue

",u=q(),S(n.$$.fragment),e=q(),S(p.$$.fragment),_=q(),S(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='Create superuser and login ',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML=' Or initialize from backup',F=q(),$=k("input"),r(o,"class","content txt-center m-b-base"),r(i,"type","submit"),r(i,"class","btn btn-lg btn-block btn-next"),z(i,"btn-disabled",s[7]),z(i,"btn-loading",s[0]),r(t,"class","block"),r(t,"autocomplete","off"),r(w,"for","backupFileInput"),r(w,"class","btn btn-lg btn-hint btn-transparent btn-block"),z(w,"btn-disabled",s[7]),z(w,"btn-loading",s[1]),r($,"id","backupFileInput"),r($,"type","file"),r($,"class","hidden"),r($,"accept",".zip")},m(l,b){m(l,t,b),T(t,o),T(t,u),E(n,t,null),T(t,e),E(p,t,null),T(t,_),E(d,t,null),T(t,a),T(t,i),m(l,c,b),m(l,g,b),m(l,B,b),m(l,w,b),m(l,F,b),m(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",Z(s[8])),I($,"change",s[16])],y=!0)},p(l,b){const H={};b&3145892&&(H.$$scope={dirty:b,ctx:l}),n.$set(H);const f={};b&3145864&&(f.$$scope={dirty:b,ctx:l}),p.$set(f);const P={};b&3145872&&(P.$$scope={dirty:b,ctx:l}),d.$set(P),(!v||b&128)&&z(i,"btn-disabled",l[7]),(!v||b&1)&&z(i,"btn-loading",l[0]),(!v||b&128)&&z(w,"btn-disabled",l[7]),(!v||b&2)&&z(w,"btn-loading",l[1])},i(l){v||(O(n.$$.fragment,l),O(p.$$.fragment,l),O(d.$$.fragment,l),v=!0)},o(l){j(n.$$.fragment,l),j(p.$$.fragment,l),j(d.$$.fragment,l),v=!1},d(l){l&&(h(t),h(c),h(g),h(B),h(w),h(F),h($)),D(n),D(p),D(d),s[15](null),y=!1,x(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},m(u,n){E(t,u,n),o=!0},p(u,[n]){const e={};n&2097407&&(e.$$scope={dirty:n,ctx:u}),t.$set(e)},i(u){o||(O(t.$$.fragment,u),o=!0)},o(u){j(t.$$.fragment,u),o=!1},d(u){D(t,u)}}}function oe(s,t,o){let u,{params:n}=t,e="",p="",_="",d=!1,a=!1,i,c;g();async function g(){if(!(n!=null&&n.token))return M("/");o(0,d=!0);try{const f=V(n==null?void 0:n.token);await C.collection("_superusers").getOne(f.id,{requestKey:"installer_token_check",headers:{Authorization:n==null?void 0:n.token}})}catch(f){f!=null&&f.isAbort||(X("The installer token is invalid or has expired."),M("/"))}o(0,d=!1),await Y(),i==null||i.focus()}async function B(){if(!u){o(0,d=!0);try{await C.collection("_superusers").create({email:e,password:p,passwordConfirm:_},{headers:{Authorization:n==null?void 0:n.token}}),await C.collection("_superusers").authWithPassword(e,p),M("/")}catch(f){C.error(f)}o(0,d=!1)}}function w(){c&&o(6,c.value="",c)}function F(f){f&&ee(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the file source. +import{S as W,i as G,s as J,F as Q,c as S,m as E,t as O,a as j,d as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as k,j as q,k as r,l as z,n as m,o as T,q as I,u as Z,v as h,w as x,x as ee,y as U,z as N,A,B as te}from"./index-MfvG--Vz.js";function ne(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Email"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","email"),r(e,"autocomplete","off"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),s[11](e),A(e,s[2]),_||(d=I(e,"input",s[12]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&4&&e.value!==a[2]&&A(e,a[2])},d(a){a&&(h(t),h(n),h(e)),s[11](null),_=!1,d()}}}function le(s){let t,o,u,n,e,p,_,d,a,i;return{c(){t=k("label"),o=N("Password"),n=q(),e=k("input"),_=q(),d=k("div"),d.textContent="Recommended at least 10 characters.",r(t,"for",u=s[20]),r(e,"type","password"),r(e,"autocomplete","new-password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0,r(d,"class","help-block")},m(c,g){m(c,t,g),T(t,o),m(c,n,g),m(c,e,g),A(e,s[3]),m(c,_,g),m(c,d,g),a||(i=I(e,"input",s[13]),a=!0)},p(c,g){g&1048576&&u!==(u=c[20])&&r(t,"for",u),g&1048576&&p!==(p=c[20])&&r(e,"id",p),g&128&&(e.disabled=c[7]),g&8&&e.value!==c[3]&&A(e,c[3])},d(c){c&&(h(t),h(n),h(e),h(_),h(d)),a=!1,i()}}}function se(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Password confirm"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),A(e,s[4]),_||(d=I(e,"input",s[14]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&16&&e.value!==a[4]&&A(e,a[4])},d(a){a&&(h(t),h(n),h(e)),_=!1,d()}}}function ie(s){let t,o,u,n,e,p,_,d,a,i,c,g,B,w,F,$,v,y,L;return n=new K({props:{class:"form-field required",name:"email",$$slots:{default:[ne,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),p=new K({props:{class:"form-field required",name:"password",$$slots:{default:[le,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),d=new K({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[se,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),{c(){t=k("form"),o=k("div"),o.innerHTML="

Create your first superuser account in order to continue

",u=q(),S(n.$$.fragment),e=q(),S(p.$$.fragment),_=q(),S(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='Create superuser and login ',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML=' Or initialize from backup',F=q(),$=k("input"),r(o,"class","content txt-center m-b-base"),r(i,"type","submit"),r(i,"class","btn btn-lg btn-block btn-next"),z(i,"btn-disabled",s[7]),z(i,"btn-loading",s[0]),r(t,"class","block"),r(t,"autocomplete","off"),r(w,"for","backupFileInput"),r(w,"class","btn btn-lg btn-hint btn-transparent btn-block"),z(w,"btn-disabled",s[7]),z(w,"btn-loading",s[1]),r($,"id","backupFileInput"),r($,"type","file"),r($,"class","hidden"),r($,"accept",".zip")},m(l,b){m(l,t,b),T(t,o),T(t,u),E(n,t,null),T(t,e),E(p,t,null),T(t,_),E(d,t,null),T(t,a),T(t,i),m(l,c,b),m(l,g,b),m(l,B,b),m(l,w,b),m(l,F,b),m(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",Z(s[8])),I($,"change",s[16])],y=!0)},p(l,b){const H={};b&3145892&&(H.$$scope={dirty:b,ctx:l}),n.$set(H);const f={};b&3145864&&(f.$$scope={dirty:b,ctx:l}),p.$set(f);const P={};b&3145872&&(P.$$scope={dirty:b,ctx:l}),d.$set(P),(!v||b&128)&&z(i,"btn-disabled",l[7]),(!v||b&1)&&z(i,"btn-loading",l[0]),(!v||b&128)&&z(w,"btn-disabled",l[7]),(!v||b&2)&&z(w,"btn-loading",l[1])},i(l){v||(O(n.$$.fragment,l),O(p.$$.fragment,l),O(d.$$.fragment,l),v=!0)},o(l){j(n.$$.fragment,l),j(p.$$.fragment,l),j(d.$$.fragment,l),v=!1},d(l){l&&(h(t),h(c),h(g),h(B),h(w),h(F),h($)),D(n),D(p),D(d),s[15](null),y=!1,x(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},m(u,n){E(t,u,n),o=!0},p(u,[n]){const e={};n&2097407&&(e.$$scope={dirty:n,ctx:u}),t.$set(e)},i(u){o||(O(t.$$.fragment,u),o=!0)},o(u){j(t.$$.fragment,u),o=!1},d(u){D(t,u)}}}function oe(s,t,o){let u,{params:n}=t,e="",p="",_="",d=!1,a=!1,i,c;g();async function g(){if(!(n!=null&&n.token))return M("/");o(0,d=!0);try{const f=V(n==null?void 0:n.token);await C.collection("_superusers").getOne(f.id,{requestKey:"installer_token_check",headers:{Authorization:n==null?void 0:n.token}})}catch(f){f!=null&&f.isAbort||(X("The installer token is invalid or has expired."),M("/"))}o(0,d=!1),await Y(),i==null||i.focus()}async function B(){if(!u){o(0,d=!0);try{await C.collection("_superusers").create({email:e,password:p,passwordConfirm:_},{headers:{Authorization:n==null?void 0:n.token}}),await C.collection("_superusers").authWithPassword(e,p),M("/")}catch(f){C.error(f)}o(0,d=!1)}}function w(){c&&o(6,c.value="",c)}function F(f){f&&ee(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the file source. Do you really want to upload and initialize "${f.name}"?`,()=>{$(f)},()=>{w()})}async function $(f){if(!(!f||u)){o(1,a=!0);try{await C.backups.upload({file:f},{headers:{Authorization:n==null?void 0:n.token}}),await C.backups.restore(f.name,{headers:{Authorization:n==null?void 0:n.token}}),te("Please wait while extracting the uploaded archive!"),await new Promise(P=>setTimeout(P,2e3)),M("/")}catch(P){C.error(P)}w(),o(1,a=!1)}}function v(f){U[f?"unshift":"push"](()=>{i=f,o(5,i)})}function y(){e=this.value,o(2,e)}function L(){p=this.value,o(3,p)}function l(){_=this.value,o(4,_)}function b(f){U[f?"unshift":"push"](()=>{c=f,o(6,c)})}const H=f=>{var P,R;F((R=(P=f.target)==null?void 0:P.files)==null?void 0:R[0])};return s.$$set=f=>{"params"in f&&o(10,n=f.params)},s.$$.update=()=>{s.$$.dirty&3&&o(7,u=d||a)},[d,a,e,p,_,i,c,u,B,F,n,v,y,L,l,b,H]}class re extends W{constructor(t){super(),G(this,t,oe,ae,J,{params:10})}}export{re as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectFailure-acTrdeCH.js b/ui/dist/assets/PageOAuth2RedirectFailure-CiWjdUmU.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectFailure-acTrdeCH.js rename to ui/dist/assets/PageOAuth2RedirectFailure-CiWjdUmU.js index 250da863..ca67e337 100644 --- a/ui/dist/assets/PageOAuth2RedirectFailure-acTrdeCH.js +++ b/ui/dist/assets/PageOAuth2RedirectFailure-CiWjdUmU.js @@ -1 +1 @@ -import{S as r,i as c,s as l,h as u,k as h,n as p,I as n,v as d,O as f,P as m,Q as g,R as o}from"./index-BqD65rZb.js";function _(s){let t;return{c(){t=u("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',h(t,"class","content txt-hint txt-center p-base")},m(e,a){p(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function b(s,t,e){let a;return f(s,o,i=>e(0,a=i)),m(o,a="OAuth2 auth failed",a),g(()=>{window.close()}),[]}class x extends r{constructor(t){super(),c(this,t,b,_,l,{})}}export{x as default}; +import{S as r,i as c,s as l,h as u,k as h,n as p,I as n,v as d,O as f,P as m,Q as g,R as o}from"./index-MfvG--Vz.js";function _(s){let t;return{c(){t=u("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',h(t,"class","content txt-hint txt-center p-base")},m(e,a){p(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function b(s,t,e){let a;return f(s,o,i=>e(0,a=i)),m(o,a="OAuth2 auth failed",a),g(()=>{window.close()}),[]}class x extends r{constructor(t){super(),c(this,t,b,_,l,{})}}export{x as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-CoFUeL82.js b/ui/dist/assets/PageOAuth2RedirectSuccess-QlMkpX15.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectSuccess-CoFUeL82.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-QlMkpX15.js index aedbd0dc..a6ea8ac8 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-CoFUeL82.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-QlMkpX15.js @@ -1 +1 @@ -import{S as i,i as r,s as u,h as l,k as p,n as h,I as n,v as d,O as m,P as f,Q as _,R as o}from"./index-BqD65rZb.js";function b(a){let t;return{c(){t=l("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',p(t,"class","content txt-hint txt-center p-base")},m(e,s){h(e,t,s)},p:n,i:n,o:n,d(e){e&&d(t)}}}function g(a,t,e){let s;return m(a,o,c=>e(0,s=c)),f(o,s="OAuth2 auth completed",s),_(()=>{window.close()}),[]}class x extends i{constructor(t){super(),r(this,t,g,b,u,{})}}export{x as default}; +import{S as i,i as r,s as u,h as l,k as p,n as h,I as n,v as d,O as m,P as f,Q as _,R as o}from"./index-MfvG--Vz.js";function b(a){let t;return{c(){t=l("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',p(t,"class","content txt-hint txt-center p-base")},m(e,s){h(e,t,s)},p:n,i:n,o:n,d(e){e&&d(t)}}}function g(a,t,e){let s;return m(a,o,c=>e(0,s=c)),f(o,s="OAuth2 auth completed",s),_(()=>{window.close()}),[]}class x extends i{constructor(t){super(),r(this,t,g,b,u,{})}}export{x as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-BEWFj7Qa.js b/ui/dist/assets/PageRecordConfirmEmailChange-DObT4JXT.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-BEWFj7Qa.js rename to ui/dist/assets/PageRecordConfirmEmailChange-DObT4JXT.js index c8f6b89e..dda4bea4 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-BEWFj7Qa.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-DObT4JXT.js @@ -1,2 +1,2 @@ -import{S as J,i as M,s as j,F as z,c as L,m as S,t as h,a as v,d as I,J as A,L as G,n as _,E as N,G as R,v as b,M as W,g as Y,p as B,f as D,h as m,z as y,j as C,k as p,l as T,o as g,q as P,u as K,I as E,H as O,A as F}from"./index-BqD65rZb.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address +import{S as J,i as M,s as j,F as z,c as L,m as S,t as h,a as v,d as I,J as A,L as G,n as _,E as N,G as R,v as b,M as W,g as Y,p as B,f as D,h as m,z as y,j as C,k as p,l as T,o as g,q as P,u as K,I as E,H as O,A as F}from"./index-MfvG--Vz.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address `),d&&d.c(),s=C(),L(o.$$.fragment),f=C(),a=m("button"),r=m("span"),r.textContent="Confirm new email",p(t,"class","content txt-center m-b-base"),p(r,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=i[1],T(a,"btn-loading",i[1])},m(c,w){_(c,e,w),g(e,t),g(t,n),g(n,l),d&&d.m(n,null),g(e,s),S(o,e,null),g(e,f),g(e,a),g(a,r),u=!0,k||($=P(e,"submit",K(i[4])),k=!0)},p(c,w){c[3]?d?d.p(c,w):(d=H(c),d.c(),d.m(n,null)):d&&(d.d(1),d=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:c}),o.$set(q),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(h(o.$$.fragment,c),u=!0)},o(c){v(o.$$.fragment,c),u=!1},d(c){c&&b(e),d&&d.d(),I(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=C(),n=m("button"),n.textContent="Close",p(e,"class","alert alert-success"),p(n,"type","button"),p(n,"class","btn btn-transparent btn-block")},m(o,f){_(o,e,f),_(o,t,f),_(o,n,f),l||(s=P(n,"click",i[6]),l=!0)},p:E,i:E,o:E,d(o){o&&(b(e),b(t),b(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=y("to "),t=m("strong"),n=y(i[3]),p(t,"class","txt-nowrap")},m(l,s){_(l,e,s),_(l,t,s),g(t,n)},p(l,s){s&8&&O(n,l[3])},d(l){l&&(b(e),b(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=y("Password"),l=C(),s=m("input"),p(e,"for",n=i[8]),p(s,"type","password"),p(s,"id",o=i[8]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),g(e,t),_(r,l,u),_(r,s,u),F(s,i[0]),s.focus(),f||(a=P(s,"input",i[7]),f=!0)},p(r,u){u&256&&n!==(n=r[8])&&p(e,"for",n),u&256&&o!==(o=r[8])&&p(s,"id",o),u&1&&s.value!==r[0]&&F(s,r[0])},d(r){r&&(b(e),b(l),b(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=G()},m(a,r){o[e].m(a,r),_(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(N(),v(o[u],1,1,()=>{o[u]=null}),R(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),h(t,1),t.m(n.parentNode,n))},i(a){l||(h(t),l=!0)},o(a){v(t),l=!1},d(a){a&&b(n),o[e].d(a)}}}function Z(i){let e,t;return e=new z({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){L(e.$$.fragment)},m(n,l){S(e,n,l),t=!0},p(n,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||(h(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){I(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new W("../");try{const $=Y(l==null?void 0:l.token);await k.collection($.collectionId).confirmEmailChange(l==null?void 0:l.token,s),t(2,f=!0)}catch($){B.error($)}t(1,o=!1)}const r=()=>window.close();function u(){s=this.value,t(0,s)}return i.$$set=k=>{"params"in k&&t(5,l=k.params)},i.$$.update=()=>{i.$$.dirty&32&&t(3,n=A.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends J{constructor(e){super(),M(this,e,x,Z,j,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-D3SGAiQ4.js b/ui/dist/assets/PageRecordConfirmPasswordReset-K2sQyrEp.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-D3SGAiQ4.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-K2sQyrEp.js index ac05181c..f528e9df 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-D3SGAiQ4.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-K2sQyrEp.js @@ -1,2 +1,2 @@ -import{S as z,i as A,s as E,F as G,c as H,m as L,t as P,a as q,d as N,J as W,L as Y,n as _,E as B,G as D,v as m,M as K,g as O,p as Q,f as J,h as b,z as y,j as C,k as p,l as M,o as w,q as S,u as U,I as F,H as V,A as R}from"./index-BqD65rZb.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&j(a);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=y(`Reset your user password +import{S as z,i as A,s as E,F as G,c as H,m as L,t as P,a as q,d as N,J as W,L as Y,n as _,E as B,G as D,v as m,M as K,g as O,p as Q,f as J,h as b,z as y,j as C,k as p,l as M,o as w,q as S,u as U,I as F,H as V,A as R}from"./index-MfvG--Vz.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&j(a);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=y(`Reset your user password `),d&&d.c(),t=C(),H(o.$$.fragment),c=C(),H(r.$$.fragment),i=C(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=a[2],M(u,"btn-loading",a[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),L(o,e,null),w(e,c),L(r,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(h=S(e,"submit",U(a[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=j(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const I={};$&3074&&(I.$$scope={dirty:$,ctx:f}),r.$set(I),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&M(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),N(o),N(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(m(e),m(l),m(s)),n=!1,t()}}}function j(a){let e,l,s;return{c(){e=y("for "),l=b("strong"),s=y(a[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&(m(e),m(l))}}}function x(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=y("New password"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[0]),t.focus(),c||(r=S(t,"input",a[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function ee(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=y("New password confirm"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[1]),c||(r=S(t,"input",a[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&R(t,i[1])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function te(a){let e,l,s,n;const t=[Z,X],o=[];function c(r,i){return r[3]?0:1}return e=c(a),l=o[e]=t[e](a),{c(){l.c(),s=Y()},m(r,i){o[e].m(r,i),_(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),q(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),P(l,1),l.m(s.parentNode,s))},i(r){n||(P(l),n=!0)},o(r){q(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new G({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(e.$$.fragment)},m(s,n){L(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){N(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=W.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends z{constructor(e){super(),A(this,e,le,se,E,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-CO9r4-wZ.js b/ui/dist/assets/PageRecordConfirmVerification-BncDRzrb.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmVerification-CO9r4-wZ.js rename to ui/dist/assets/PageRecordConfirmVerification-BncDRzrb.js index b07e9971..30e89c22 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-CO9r4-wZ.js +++ b/ui/dist/assets/PageRecordConfirmVerification-BncDRzrb.js @@ -1 +1 @@ -import{S as M,i as P,s as R,F as H,c as q,m as N,t as S,a as V,d as F,M as w,g as y,N as j,L as g,n as r,v as a,p as E,h as u,j as v,k as d,q as k,I as m,l as C,o as z}from"./index-BqD65rZb.js";function A(o){let e,l,n;function t(i,f){return i[4]?K:J}let s=t(o),c=s(o);return{c(){e=u("div"),e.innerHTML='

Invalid or expired verification token.

',l=v(),c.c(),n=g(),d(e,"class","alert alert-danger")},m(i,f){r(i,e,f),r(i,l,f),c.m(i,f),r(i,n,f)},p(i,f){s===(s=t(i))&&c?c.p(i,f):(c.d(1),c=s(i),c&&(c.c(),c.m(n.parentNode,n)))},d(i){i&&(a(e),a(l),a(n)),c.d(i)}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[8]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function D(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[7]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function G(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',d(e,"class","txt-center")},m(l,n){r(l,e,n)},p:m,d(l){l&&a(e)}}}function J(o){let e,l,n;return{c(){e=u("button"),e.textContent="Close",d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(t,s){r(t,e,s),l||(n=k(e,"click",o[9]),l=!0)},p:m,d(t){t&&a(e),l=!1,n()}}}function K(o){let e,l,n,t;return{c(){e=u("button"),l=u("span"),l.textContent="Resend",d(l,"class","txt"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),z(e,l),n||(t=k(e,"click",o[5]),n=!0)},p(s,c){c&8&&(e.disabled=s[3]),c&8&&C(e,"btn-loading",s[3])},d(s){s&&a(e),n=!1,t()}}}function O(o){let e;function l(s,c){return s[1]?G:s[0]?D:s[2]?B:A}let n=l(o),t=n(o);return{c(){t.c(),e=g()},m(s,c){t.m(s,c),r(s,e,c)},p(s,c){n===(n=l(s))&&t?t.p(s,c):(t.d(1),t=n(s),t&&(t.c(),t.m(e.parentNode,e)))},d(s){s&&a(e),t.d(s)}}}function Q(o){let e,l;return e=new H({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){q(e.$$.fragment)},m(n,t){N(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(S(e.$$.fragment,n),l=!0)},o(n){V(e.$$.fragment,n),l=!1},d(n){F(e,n)}}}function U(o,e,l){let n,{params:t}=e,s=!1,c=!1,i=!1,f=!1;x();async function x(){if(c)return;l(1,c=!0);const p=new w("../");try{const b=y(t==null?void 0:t.token);await p.collection(b.collectionId).confirmVerification(t==null?void 0:t.token),l(0,s=!0)}catch{l(0,s=!1)}l(1,c=!1)}async function T(){const p=y(t==null?void 0:t.token);if(f||!p.collectionId||!p.email)return;l(3,f=!0);const b=new w("../");try{const _=y(t==null?void 0:t.token);await b.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){E.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),I=()=>window.close(),L=()=>window.close();return o.$$set=p=>{"params"in p&&l(6,t=p.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&j(t.token))},[s,c,i,f,n,T,t,h,I,L]}class X extends M{constructor(e){super(),P(this,e,U,Q,R,{params:6})}}export{X as default}; +import{S as M,i as P,s as R,F as H,c as q,m as N,t as S,a as V,d as F,M as w,g as y,N as j,L as g,n as r,v as a,p as E,h as u,j as v,k as d,q as k,I as m,l as C,o as z}from"./index-MfvG--Vz.js";function A(o){let e,l,n;function t(i,f){return i[4]?K:J}let s=t(o),c=s(o);return{c(){e=u("div"),e.innerHTML='

Invalid or expired verification token.

',l=v(),c.c(),n=g(),d(e,"class","alert alert-danger")},m(i,f){r(i,e,f),r(i,l,f),c.m(i,f),r(i,n,f)},p(i,f){s===(s=t(i))&&c?c.p(i,f):(c.d(1),c=s(i),c&&(c.c(),c.m(n.parentNode,n)))},d(i){i&&(a(e),a(l),a(n)),c.d(i)}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[8]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function D(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[7]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function G(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',d(e,"class","txt-center")},m(l,n){r(l,e,n)},p:m,d(l){l&&a(e)}}}function J(o){let e,l,n;return{c(){e=u("button"),e.textContent="Close",d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(t,s){r(t,e,s),l||(n=k(e,"click",o[9]),l=!0)},p:m,d(t){t&&a(e),l=!1,n()}}}function K(o){let e,l,n,t;return{c(){e=u("button"),l=u("span"),l.textContent="Resend",d(l,"class","txt"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),z(e,l),n||(t=k(e,"click",o[5]),n=!0)},p(s,c){c&8&&(e.disabled=s[3]),c&8&&C(e,"btn-loading",s[3])},d(s){s&&a(e),n=!1,t()}}}function O(o){let e;function l(s,c){return s[1]?G:s[0]?D:s[2]?B:A}let n=l(o),t=n(o);return{c(){t.c(),e=g()},m(s,c){t.m(s,c),r(s,e,c)},p(s,c){n===(n=l(s))&&t?t.p(s,c):(t.d(1),t=n(s),t&&(t.c(),t.m(e.parentNode,e)))},d(s){s&&a(e),t.d(s)}}}function Q(o){let e,l;return e=new H({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){q(e.$$.fragment)},m(n,t){N(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(S(e.$$.fragment,n),l=!0)},o(n){V(e.$$.fragment,n),l=!1},d(n){F(e,n)}}}function U(o,e,l){let n,{params:t}=e,s=!1,c=!1,i=!1,f=!1;x();async function x(){if(c)return;l(1,c=!0);const p=new w("../");try{const b=y(t==null?void 0:t.token);await p.collection(b.collectionId).confirmVerification(t==null?void 0:t.token),l(0,s=!0)}catch{l(0,s=!1)}l(1,c=!1)}async function T(){const p=y(t==null?void 0:t.token);if(f||!p.collectionId||!p.email)return;l(3,f=!0);const b=new w("../");try{const _=y(t==null?void 0:t.token);await b.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){E.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),I=()=>window.close(),L=()=>window.close();return o.$$set=p=>{"params"in p&&l(6,t=p.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&j(t.token))},[s,c,i,f,n,T,t,h,I,L]}class X extends M{constructor(e){super(),P(this,e,U,Q,R,{params:6})}}export{X as default}; diff --git a/ui/dist/assets/PageSuperuserConfirmPasswordReset-DyqJmTiD.js b/ui/dist/assets/PageSuperuserConfirmPasswordReset-BcotKF-n.js similarity index 98% rename from ui/dist/assets/PageSuperuserConfirmPasswordReset-DyqJmTiD.js rename to ui/dist/assets/PageSuperuserConfirmPasswordReset-BcotKF-n.js index aa009e3a..a8af3202 100644 --- a/ui/dist/assets/PageSuperuserConfirmPasswordReset-DyqJmTiD.js +++ b/ui/dist/assets/PageSuperuserConfirmPasswordReset-BcotKF-n.js @@ -1,2 +1,2 @@ -import{S as y,i as E,s as G,F as I,c as R,m as H,t as J,a as N,d as T,J as M,f as D,h as _,z as P,j as h,k as f,l as K,n as b,o as c,q as j,u as O,C as Q,D as U,v as w,w as V,p as L,K as X,r as Y,H as Z,A as q}from"./index-BqD65rZb.js";function W(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0,t.autofocus=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[0]),t.focus(),p||(d=j(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[1]),p||(d=j(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,k,F,z,m=r[3]&&W(r);return i=new D({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new D({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your superuser password +import{S as y,i as E,s as G,F as I,c as R,m as H,t as J,a as N,d as T,J as M,f as D,h as _,z as P,j as h,k as f,l as K,n as b,o as c,q as j,u as O,C as Q,D as U,v as w,w as V,p as L,K as X,r as Y,H as Z,A as q}from"./index-MfvG--Vz.js";function W(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0,t.autofocus=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[0]),t.focus(),p||(d=j(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[1]),p||(d=j(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,k,F,z,m=r[3]&&W(r);return i=new D({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new D({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your superuser password `),m&&m.c(),t=h(),R(i.$$.fragment),p=h(),R(d.$$.fragment),u=h(),a=_("button"),g=_("span"),g.textContent="Set new password",S=h(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=r[2],K(a,"btn-loading",r[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),H(i,e,null),c(e,p),H(d,e,null),c(e,u),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),k=!0,F||(z=[j(e,"submit",O(r[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=W(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const A={};$&769&&(A.$$scope={dirty:$,ctx:o}),i.$set(A);const B={};$&770&&(B.$$scope={dirty:$,ctx:o}),d.$set(B),(!k||$&4)&&(a.disabled=o[2]),(!k||$&4)&&K(a,"btn-loading",o[2])},i(o){k||(J(i.$$.fragment,o),J(d.$$.fragment,o),k=!0)},o(o){N(i.$$.fragment,o),N(d.$$.fragment,o),k=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(i),T(d),F=!1,V(z)}}}function se(r){let e,n;return e=new I({props:{$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){R(e.$$.fragment)},m(s,l){H(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(J(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(r,e,n){let s,{params:l}=e,t="",i="",p=!1;async function d(){if(!p){n(2,p=!0);try{await L.collection("_superusers").confirmPasswordReset(l==null?void 0:l.token,t,i),X("Successfully set a new superuser password."),Y("/")}catch(g){L.error(g)}n(2,p=!1)}}function u(){t=this.value,n(0,t)}function a(){i=this.value,n(1,i)}return r.$$set=g=>{"params"in g&&n(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,i,p,s,d,l,u,a]}class ae extends y{constructor(e){super(),E(this,e,le,se,G,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageSuperuserRequestPasswordReset-C6l2tAoS.js b/ui/dist/assets/PageSuperuserRequestPasswordReset-hkDUY4aR.js similarity index 98% rename from ui/dist/assets/PageSuperuserRequestPasswordReset-C6l2tAoS.js rename to ui/dist/assets/PageSuperuserRequestPasswordReset-hkDUY4aR.js index 8c2ed47a..2b4769c2 100644 --- a/ui/dist/assets/PageSuperuserRequestPasswordReset-C6l2tAoS.js +++ b/ui/dist/assets/PageSuperuserRequestPasswordReset-hkDUY4aR.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as E,m as H,t as w,a as y,d as L,j as v,h as m,k as p,n as g,o as d,C as A,D as B,E as D,G,v as k,p as C,f as I,l as F,q as R,u as N,z as h,H as J,I as P,A as S}from"./index-BqD65rZb.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new I({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=m("form"),s=m("div"),s.innerHTML='

Forgotten superuser password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),E(l.$$.fragment),t=v(),r=m("button"),c=m("i"),_=v(),i=m("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(i,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block"),r.disabled=u[1],F(r,"btn-loading",u[1]),p(e,"class","m-b-base")},m(o,$){g(o,e,$),d(e,s),d(e,n),H(l,e,null),d(e,t),d(e,r),d(r,c),d(r,_),d(r,i),a=!0,b||(f=R(e,"submit",N(u[3])),b=!0)},p(o,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:o}),l.$set(q),(!a||$&2)&&(r.disabled=o[1]),(!a||$&2)&&F(r,"btn-loading",o[1])},i(o){a||(w(l.$$.fragment,o),a=!0)},o(o){y(l.$$.fragment,o),a=!1},d(o){o&&k(e),L(l),b=!1,f()}}}function O(u){let e,s,n,l,t,r,c,_,i;return{c(){e=m("div"),s=m("div"),s.innerHTML='',n=v(),l=m("div"),t=m("p"),r=h("Check "),c=m("strong"),_=h(u[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,r),d(t,c),d(c,_),d(t,i)},p(a,b){b&1&&J(_,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,r,c,_;return{c(){e=m("label"),s=h("Email"),l=v(),t=m("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",r=u[5]),t.required=!0,t.autofocus=!0},m(i,a){g(i,e,a),d(e,s),g(i,l,a),g(i,t,a),S(t,u[0]),t.focus(),c||(_=R(t,"input",u[4]),c=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&r!==(r=i[5])&&p(t,"id",r),a&1&&t.value!==i[0]&&S(t,i[0])},d(i){i&&(k(e),k(l),k(t)),c=!1,_()}}}function U(u){let e,s,n,l,t,r,c,_;const i=[O,K],a=[];function b(f,o){return f[2]?0:1}return e=b(u),s=a[e]=i[e](u),{c(){s.c(),n=v(),l=m("div"),t=m("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,o){a[e].m(f,o),g(f,n,o),g(f,l,o),d(l,t),r=!0,c||(_=A(B.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(D(),y(a[$],1,1,()=>{a[$]=null}),G(),s=a[e],s?s.p(f,o):(s=a[e]=i[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){r||(w(s),r=!0)},o(f){y(s),r=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,_()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){E(e.$$.fragment)},m(n,l){H(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){L(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function r(){if(!l){s(1,l=!0);try{await C.collection("_superusers").requestPasswordReset(n),s(2,t=!0)}catch(_){C.error(_)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,r,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; +import{S as M,i as T,s as j,F as z,c as E,m as H,t as w,a as y,d as L,j as v,h as m,k as p,n as g,o as d,C as A,D as B,E as D,G,v as k,p as C,f as I,l as F,q as R,u as N,z as h,H as J,I as P,A as S}from"./index-MfvG--Vz.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new I({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=m("form"),s=m("div"),s.innerHTML='

Forgotten superuser password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),E(l.$$.fragment),t=v(),r=m("button"),c=m("i"),_=v(),i=m("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(i,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block"),r.disabled=u[1],F(r,"btn-loading",u[1]),p(e,"class","m-b-base")},m(o,$){g(o,e,$),d(e,s),d(e,n),H(l,e,null),d(e,t),d(e,r),d(r,c),d(r,_),d(r,i),a=!0,b||(f=R(e,"submit",N(u[3])),b=!0)},p(o,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:o}),l.$set(q),(!a||$&2)&&(r.disabled=o[1]),(!a||$&2)&&F(r,"btn-loading",o[1])},i(o){a||(w(l.$$.fragment,o),a=!0)},o(o){y(l.$$.fragment,o),a=!1},d(o){o&&k(e),L(l),b=!1,f()}}}function O(u){let e,s,n,l,t,r,c,_,i;return{c(){e=m("div"),s=m("div"),s.innerHTML='',n=v(),l=m("div"),t=m("p"),r=h("Check "),c=m("strong"),_=h(u[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,r),d(t,c),d(c,_),d(t,i)},p(a,b){b&1&&J(_,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,r,c,_;return{c(){e=m("label"),s=h("Email"),l=v(),t=m("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",r=u[5]),t.required=!0,t.autofocus=!0},m(i,a){g(i,e,a),d(e,s),g(i,l,a),g(i,t,a),S(t,u[0]),t.focus(),c||(_=R(t,"input",u[4]),c=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&r!==(r=i[5])&&p(t,"id",r),a&1&&t.value!==i[0]&&S(t,i[0])},d(i){i&&(k(e),k(l),k(t)),c=!1,_()}}}function U(u){let e,s,n,l,t,r,c,_;const i=[O,K],a=[];function b(f,o){return f[2]?0:1}return e=b(u),s=a[e]=i[e](u),{c(){s.c(),n=v(),l=m("div"),t=m("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,o){a[e].m(f,o),g(f,n,o),g(f,l,o),d(l,t),r=!0,c||(_=A(B.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(D(),y(a[$],1,1,()=>{a[$]=null}),G(),s=a[e],s?s.p(f,o):(s=a[e]=i[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){r||(w(s),r=!0)},o(f){y(s),r=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,_()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){E(e.$$.fragment)},m(n,l){H(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){L(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function r(){if(!l){s(1,l=!0);try{await C.collection("_superusers").requestPasswordReset(n),s(2,t=!0)}catch(_){C.error(_)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,r,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PasswordResetDocs-Dnq0sANu.js b/ui/dist/assets/PasswordResetDocs-ClH0edc2.js similarity index 99% rename from ui/dist/assets/PasswordResetDocs-Dnq0sANu.js rename to ui/dist/assets/PasswordResetDocs-ClH0edc2.js index 31c36a83..09d5a250 100644 --- a/ui/dist/assets/PasswordResetDocs-Dnq0sANu.js +++ b/ui/dist/assets/PasswordResetDocs-ClH0edc2.js @@ -1,4 +1,4 @@ -import{S as se,i as ne,s as oe,X as K,h as p,j as S,z as D,k,n as b,o as u,H as X,Y as ee,Z as ye,E as te,_ as Te,G as le,t as G,a as J,v,l as j,q as ae,W as Ee,c as Z,m as Q,d as x,V as qe,$ as fe,J as Ce,p as Oe,a0 as pe}from"./index-BqD65rZb.js";function me(o,t,e){const n=o.slice();return n[4]=t[e],n}function _e(o,t,e){const n=o.slice();return n[4]=t[e],n}function he(o,t){let e,n=t[4].code+"",d,c,r,a;function f(){return t[3](t[4])}return{key:o,first:null,c(){e=p("button"),d=D(n),c=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(g,y){b(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&X(d,n),y&6&&j(e,"active",t[1]===t[4].code)},d(g){g&&v(e),r=!1,a()}}}function be(o,t){let e,n,d,c;return n=new Ee({props:{content:t[4].body}}),{key:o,first:null,c(){e=p("div"),Z(n.$$.fragment),d=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Q(n,e,null),u(e,d),c=!0},p(r,a){t=r;const f={};a&4&&(f.content=t[4].body),n.$set(f),(!c||a&6)&&j(e,"active",t[1]===t[4].code)},i(r){c||(G(n.$$.fragment,r),c=!0)},o(r){J(n.$$.fragment,r),c=!1},d(r){r&&v(e),x(n)}}}function We(o){let t,e,n,d,c,r,a,f=o[0].name+"",g,y,F,C,z,A,L,O,W,T,q,R=[],M=new Map,U,N,h=[],H=new Map,E,P=K(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),q=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as ne,s as oe,X as K,h as p,j as S,z as D,k,n as b,o as u,H as X,Y as ee,Z as ye,E as te,_ as Te,G as le,t as G,a as J,v,l as j,q as ae,W as Ee,c as Z,m as Q,d as x,V as qe,$ as fe,J as Ce,p as Oe,a0 as pe}from"./index-MfvG--Vz.js";function me(o,t,e){const n=o.slice();return n[4]=t[e],n}function _e(o,t,e){const n=o.slice();return n[4]=t[e],n}function he(o,t){let e,n=t[4].code+"",d,c,r,a;function f(){return t[3](t[4])}return{key:o,first:null,c(){e=p("button"),d=D(n),c=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(g,y){b(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&X(d,n),y&6&&j(e,"active",t[1]===t[4].code)},d(g){g&&v(e),r=!1,a()}}}function be(o,t){let e,n,d,c;return n=new Ee({props:{content:t[4].body}}),{key:o,first:null,c(){e=p("div"),Z(n.$$.fragment),d=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Q(n,e,null),u(e,d),c=!0},p(r,a){t=r;const f={};a&4&&(f.content=t[4].body),n.$set(f),(!c||a&6)&&j(e,"active",t[1]===t[4].code)},i(r){c||(G(n.$$.fragment,r),c=!0)},o(r){J(n.$$.fragment,r),c=!1},d(r){r&&v(e),x(n)}}}function We(o){let t,e,n,d,c,r,a,f=o[0].name+"",g,y,F,C,z,A,L,O,W,T,q,R=[],M=new Map,U,N,h=[],H=new Map,E,P=K(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),q=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/RealtimeApiDocs-CLgiyZ5n.js b/ui/dist/assets/RealtimeApiDocs-D_C9UwDU.js similarity index 99% rename from ui/dist/assets/RealtimeApiDocs-CLgiyZ5n.js rename to ui/dist/assets/RealtimeApiDocs-D_C9UwDU.js index 2d3036d6..9e8a6866 100644 --- a/ui/dist/assets/RealtimeApiDocs-CLgiyZ5n.js +++ b/ui/dist/assets/RealtimeApiDocs-D_C9UwDU.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,V as pe,W as ue,J as P,h as p,z as y,j as a,c as se,k as u,n as s,o as I,m as ne,H as me,t as ie,a as ce,v as n,d as le,p as de}from"./index-BqD65rZb.js";function he(o){var B,U,W,H,L,A,T,j,q,J,M,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,E,v,w,r,R;return l=new pe({props:{js:` +import{S as re,i as ae,s as be,V as pe,W as ue,J as P,h as p,z as y,j as a,c as se,k as u,n as s,o as I,m as ne,H as me,t as ie,a as ce,v as n,d as le,p as de}from"./index-MfvG--Vz.js";function he(o){var B,U,W,H,L,A,T,j,q,J,M,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,E,v,w,r,R;return l=new pe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[1]}'); diff --git a/ui/dist/assets/UpdateApiDocs-DsdeVsYD.js b/ui/dist/assets/UpdateApiDocs-CO2UpPcw.js similarity index 99% rename from ui/dist/assets/UpdateApiDocs-DsdeVsYD.js rename to ui/dist/assets/UpdateApiDocs-CO2UpPcw.js index 3f9fb999..18e968a7 100644 --- a/ui/dist/assets/UpdateApiDocs-DsdeVsYD.js +++ b/ui/dist/assets/UpdateApiDocs-CO2UpPcw.js @@ -1,4 +1,4 @@ -import{S as Ot,i as St,s as Mt,V as $t,J as x,X as ie,W as Tt,h as i,z as h,j as f,c as ve,k,n as o,o as n,m as we,H as te,Y as Je,Z as bt,E as qt,_ as Rt,G as Ht,t as he,a as ye,v as r,d as Ce,p as Dt,l as Te,q as Lt,I as de}from"./index-BqD65rZb.js";import{F as Pt}from"./FieldsQueryParam-BESg3pfe.js";function mt(d,e,t){const a=d.slice();return a[10]=e[t],a}function _t(d,e,t){const a=d.slice();return a[10]=e[t],a}function ht(d,e,t){const a=d.slice();return a[15]=e[t],a}function yt(d){let e;return{c(){e=i("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as Ot,i as St,s as Mt,V as $t,J as x,X as ie,W as Tt,h as i,z as h,j as f,c as ve,k,n as o,o as n,m as we,H as te,Y as Je,Z as bt,E as qt,_ as Rt,G as Ht,t as he,a as ye,v as r,d as Ce,p as Dt,l as Te,q as Lt,I as de}from"./index-MfvG--Vz.js";import{F as Pt}from"./FieldsQueryParam-CCSkXZO8.js";function mt(d,e,t){const a=d.slice();return a[10]=e[t],a}function _t(d,e,t){const a=d.slice();return a[10]=e[t],a}function ht(d,e,t){const a=d.slice();return a[15]=e[t],a}function yt(d){let e;return{c(){e=i("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,a){o(t,e,a)},d(t){t&&r(e)}}}function kt(d){let e;return{c(){e=i("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",k(e,"class","txt-hint txt-sm txt-right")},m(t,a){o(t,e,a)},d(t){t&&r(e)}}}function gt(d){let e,t,a,m,p,c,u,b,O,T,M,H,S,E,q,D,J,I,$,R,L,g,v,w;function z(_,C){var le,W,ne;return C&1&&(b=null),b==null&&(b=!!((ne=(W=(le=_[0])==null?void 0:le.fields)==null?void 0:W.find(Qt))!=null&&ne.required)),b?jt:Ft}let Q=z(d,-1),F=Q(d);return{c(){e=i("tr"),e.innerHTML='Auth specific fields',t=f(),a=i("tr"),a.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/VerificationDocs-Bojha8VY.js b/ui/dist/assets/VerificationDocs-Fh8xavie.js similarity index 99% rename from ui/dist/assets/VerificationDocs-Bojha8VY.js rename to ui/dist/assets/VerificationDocs-Fh8xavie.js index 30fabf38..dbacd0ea 100644 --- a/ui/dist/assets/VerificationDocs-Bojha8VY.js +++ b/ui/dist/assets/VerificationDocs-Fh8xavie.js @@ -1,4 +1,4 @@ -import{S as le,i as ne,s as ie,X as F,h as m,j as y,z as M,k as v,n as b,o as d,H as W,Y as x,Z as Te,E as ee,_ as qe,G as te,t as L,a as U,v as h,l as H,q as oe,W as Ce,c as Y,m as Z,d as Q,V as Ve,$ as fe,J as Ae,p as Ie,a0 as de}from"./index-BqD65rZb.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,q){b(g,e,q),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,q){t=g,q&4&&o!==(o=t[4].code+"")&&W(f,o),q&6&&H(e,"active",t[1]===t[4].code)},d(g){g&&h(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new Ce({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Y(o.$$.fragment),f=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){U(o.$$.fragment,r),c=!1},d(r){r&&h(e),Q(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,q,D,P,j,R,B,E,N,C,V,$=[],z=new Map,K,I,p=[],T=new Map,A,_=F(s[2]);const J=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=J(i);z.set(n,$[l]=pe(n,i))}let O=F(s[2]);const G=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=y(),E=m("div"),E.textContent="Responses",N=y(),C=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();K=y(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as le,i as ne,s as ie,X as F,h as m,j as y,z as M,k as v,n as b,o as d,H as W,Y as x,Z as Te,E as ee,_ as qe,G as te,t as L,a as U,v as h,l as H,q as oe,W as Ce,c as Y,m as Z,d as Q,V as Ve,$ as fe,J as Ae,p as Ie,a0 as de}from"./index-MfvG--Vz.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,q){b(g,e,q),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,q){t=g,q&4&&o!==(o=t[4].code+"")&&W(f,o),q&6&&H(e,"active",t[1]===t[4].code)},d(g){g&&h(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new Ce({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Y(o.$$.fragment),f=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){U(o.$$.fragment,r),c=!1},d(r){r&&h(e),Q(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,q,D,P,j,R,B,E,N,C,V,$=[],z=new Map,K,I,p=[],T=new Map,A,_=F(s[2]);const J=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=J(i);z.set(n,$[l]=pe(n,i))}let O=F(s[2]);const G=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=y(),E=m("div"),E.textContent="Responses",N=y(),C=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();K=y(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/ViewApiDocs-Dd7XOl9A.js b/ui/dist/assets/ViewApiDocs-fmO-uILm.js similarity index 98% rename from ui/dist/assets/ViewApiDocs-Dd7XOl9A.js rename to ui/dist/assets/ViewApiDocs-fmO-uILm.js index a5b9cd66..45089fd2 100644 --- a/ui/dist/assets/ViewApiDocs-Dd7XOl9A.js +++ b/ui/dist/assets/ViewApiDocs-fmO-uILm.js @@ -1,4 +1,4 @@ -import{S as lt,i as st,s as nt,V as ot,W as tt,X as K,h as o,z as _,j as b,c as W,k as m,n as r,o as l,m as X,H as ve,Y as Qe,Z as at,E as it,_ as rt,G as dt,t as U,a as V,v as d,d as Y,J as Ke,p as ct,l as Z,q as pt}from"./index-BqD65rZb.js";import{F as ut}from"./FieldsQueryParam-BESg3pfe.js";function We(a,s,n){const i=a.slice();return i[6]=s[n],i}function Xe(a,s,n){const i=a.slice();return i[6]=s[n],i}function Ye(a){let s;return{c(){s=o("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){r(n,s,i)},d(n){n&&d(s)}}}function Ze(a,s){let n,i,v;function p(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Z(n,"active",s[2]===s[6].code)},d(c){c&&d(n),i=!1,v()}}}function et(a,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),W(i.$$.fragment),v=b(),m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Z(n,"active",s[2]===s[6].code)},i(c){p||(U(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var ze,Ge;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,z=a[0].name+"",te,$e,le,F,se,S,ne,$,G,ye,J,T,we,oe,N=a[0].name+"",ae,Ce,ie,Fe,re,q,de,x,ce,A,pe,R,ue,Re,H,O,fe,Oe,be,De,h,Pe,E,Te,Ee,Be,me,Se,_e,qe,xe,Ae,he,He,Ie,B,ke,I,ge,D,M,y=[],Me=new Map,Le,L,k=[],je=new Map,P;F=new ot({props:{js:` +import{S as lt,i as st,s as nt,V as ot,W as tt,X as K,h as o,z as _,j as b,c as W,k as m,n as r,o as l,m as X,H as ve,Y as Qe,Z as at,E as it,_ as rt,G as dt,t as U,a as V,v as d,d as Y,J as Ke,p as ct,l as Z,q as pt}from"./index-MfvG--Vz.js";import{F as ut}from"./FieldsQueryParam-CCSkXZO8.js";function We(a,s,n){const i=a.slice();return i[6]=s[n],i}function Xe(a,s,n){const i=a.slice();return i[6]=s[n],i}function Ye(a){let s;return{c(){s=o("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){r(n,s,i)},d(n){n&&d(s)}}}function Ze(a,s){let n,i,v;function p(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Z(n,"active",s[2]===s[6].code)},d(c){c&&d(n),i=!1,v()}}}function et(a,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),W(i.$$.fragment),v=b(),m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Z(n,"active",s[2]===s[6].code)},i(c){p||(U(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var ze,Ge;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,z=a[0].name+"",te,$e,le,F,se,S,ne,$,G,ye,J,T,we,oe,N=a[0].name+"",ae,Ce,ie,Fe,re,q,de,x,ce,A,pe,R,ue,Re,H,O,fe,Oe,be,De,h,Pe,E,Te,Ee,Be,me,Se,_e,qe,xe,Ae,he,He,Ie,B,ke,I,ge,D,M,y=[],Me=new Map,Le,L,k=[],je=new Map,P;F=new ot({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-BqD65rZb.js b/ui/dist/assets/index-MfvG--Vz.js similarity index 91% rename from ui/dist/assets/index-BqD65rZb.js rename to ui/dist/assets/index-MfvG--Vz.js index 6dbd2e81..5b8253fd 100644 --- a/ui/dist/assets/index-BqD65rZb.js +++ b/ui/dist/assets/index-MfvG--Vz.js @@ -1,8 +1,8 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-RpihTcvl.js","./index-C-PlLH2L.js","./ListApiDocs-B1zjO_1B.js","./FieldsQueryParam-BESg3pfe.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-Dd7XOl9A.js","./CreateApiDocs-DOHOivQZ.js","./UpdateApiDocs-DsdeVsYD.js","./AuthMethodsDocs-BJf1CDOL.js","./AuthWithPasswordDocs-Bcbb3J5u.js","./AuthWithOAuth2Docs-DSr9eqoG.js","./AuthRefreshDocs-Cil4P-ZL.js","./CodeEditor-7pyapRXP.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-fHLXb8ZI.js","./index-C-PlLH2L.js","./ListApiDocs-BAgbsZ7y.js","./FieldsQueryParam-CCSkXZO8.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-fmO-uILm.js","./CreateApiDocs-CyJpcgbh.js","./UpdateApiDocs-CO2UpPcw.js","./AuthMethodsDocs-DOUEhU-E.js","./AuthWithPasswordDocs-sk8JSDnL.js","./AuthWithOAuth2Docs-JwYoBVwZ.js","./AuthRefreshDocs-DvYw-jkZ.js","./CodeEditor-Bfa8qogr.js"])))=>i.map(i=>d[i]); var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>Iy(n,typeof e!="symbol"?e+"":e,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 te(){}const lo=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function Ly(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ub(n){return n()}function df(){return Object.create(null)}function Ie(n){n.forEach(Ub)}function It(n){return typeof n=="function"}function ke(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function bn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function Ay(n){return Object.keys(n).length===0}function cu(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Vb(n){let e;return cu(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(cu(e,t))}function Lt(n,e,t,i){if(n){const l=Bb(n,e,t,i);return n[0](l)}}function Bb(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function At(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;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),du=Wb?n=>requestAnimationFrame(n):te;const Zl=new Set;function Yb(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&du(Yb)}function Or(n){let e;return Zl.size===0&&du(Yb),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function Kb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Py(n){const e=b("style");return e.textContent="/* empty */",Ny(Kb(n),e),e.sheet}function Ny(n,e){return w(n.head||n,e),e.sheet}function v(n,e,t){n.insertBefore(e,t||null)}function y(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function nt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function On(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const Ry=["width","height"];function ei(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&Ry.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function Fy(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function gt(n){return n===""?null:+n}function qy(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function he(n,e){n.value=e??""}function Hy(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function ee(n,e,t){n.classList.toggle(e,!!t)}function Jb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function zt(n,e){return new n(e)}const fr=new Map;let cr=0;function jy(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function zy(n,e){const t={stylesheet:Py(e),rules:{}};return fr.set(n,t),t}function Us(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{ `;for(let _=0;_<=1;_+=a){const k=e+(t-e)*s(_);u+=_*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${jy(f)}_${r}`,d=Kb(n),{stylesheet:m,rules:h}=fr.get(d)||zy(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${l}ms 1 both`,cr+=1,c}function Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),cr-=l,cr||Uy())}function Uy(){du(()=>{cr||(fr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&y(e)}),fr.clear())})}function Vy(n,e,t,i){if(!e)return te;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return te;const{delay:s=0,duration:o=300,easing:r=lo,start:a=Cr()+s,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function g(){c&&(h=Us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Vs(n,h),d=!1}return Or(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),g(),f(0,1),_}function By(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Zb(n,l)}}function Zb(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function Fi(n){Bs=n}function so(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function Xt(n){so().$$.on_mount.push(n)}function Wy(n){so().$$.after_update.push(n)}function oo(n){so().$$.on_destroy.push(n)}function kt(){const n=so();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Jb(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Yl=[],ie=[];let Gl=[];const Na=[],Gb=Promise.resolve();let Ra=!1;function Xb(){Ra||(Ra=!0,Gb.then(pu))}function dn(){return Xb(),Gb}function tt(n){Gl.push(n)}function $e(n){Na.push(n)}const Zr=new Set;let jl=0;function pu(){if(jl!==0)return;const n=Bs;do{try{for(;jln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let ks;function mu(){return ks||(ks=Promise.resolve(),ks.then(()=>{ks=null})),ks}function Cl(n,e,t){n.dispatchEvent(Jb(`${e?"intro":"outro"}${t}`))}const Xo=new Set;let wi;function re(){wi={r:0,c:[],p:wi}}function ae(){wi.r||Ie(wi.c),wi=wi.p}function O(n,e){n&&n.i&&(Xo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Xo.has(n))return;Xo.add(n),wi.c.push(()=>{Xo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const hu={duration:0};function Qb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=lo,tick:g=te,css:_}=l||hu;_&&(o=Us(n,0,1,m,d,h,_,a++)),g(0,1);const k=Cr()+d,S=k+m;r&&r.abort(),s=!0,tt(()=>Cl(n,!0,"start")),r=Or($=>{if(s){if($>=S)return g(1,0),Cl(n,!0,"end"),u(),s=!1;if($>=k){const T=h(($-k)/m);g(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),It(l)?(l=l(i),mu().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function _u(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=wi;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=lo,tick:m=te,css:h}=l||hu;h&&(o=Us(n,1,0,c,f,d,h));const g=Cr()+f,_=g+c;tt(()=>Cl(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Or(k=>{if(s){if(k>=_)return m(0,1),Cl(n,!1,"end"),--r.r||Ie(r.c),!1;if(k>=g){const S=d((k-g)/c);m(1-S,S)}}return s})}return It(l)?mu().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&Vs(n,o),s=!1)}}}function He(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Vs(n,u)}function d(h,g){const _=h.b-o;return g*=Math.abs(_),{a:o,b:h.b,d:_,duration:g,start:h.start,end:h.start+g,group:h.group}}function m(h){const{delay:g=0,duration:_=300,easing:k=lo,tick:S=te,css:$}=s||hu,T={start:Cr()+g,b:h};h||(T.group=wi,wi.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=Us(n,o,h,_,g,k,$)),h&&S(0,1),r=d(T,_),tt(()=>Cl(n,h,"start")),Or(M=>{if(a&&M>a.start&&(r=d(a,_),a=null,Cl(n,r.b,"start"),$&&(c(),u=Us(n,o,r.b,r.duration,0,k,s.css))),r){if(M>=r.end)S(o=r.b,1-o),Cl(n,r.b,"end"),a||(r.b?c():--r.group.r||Ie(r.group.c)),r=null;else if(M>=r.start){const E=M-r.start;o=r.a+r.d*k(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){It(s)?mu().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function mf(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(re(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),O(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&pu()}if(Ly(n)){const l=so();if(n.then(s=>{Fi(l),i(e.then,1,e.value,s),Fi(null)},s=>{if(Fi(l),i(e.catch,2,e.error,s),Fi(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function Jy(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function de(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function di(n,e){n.d(1),e.delete(n.key)}function Bt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Zy(n,e){n.f(),Bt(n,e)}function vt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,h=d;const g={};for(;h--;)g[n[h].key]=h;const _=[],k=new Map,S=new Map,$=[];for(h=m;h--;){const L=c(l,s,h),I=t(L);let A=o.get(I);A?$.push(()=>A.p(L,e)):(A=u(I,L),A.c()),k.set(I,_[h]=A),I in g&&S.set(I,Math.abs(h-g[I]))}const T=new Set,M=new Set;function E(L){O(L,1),L.m(r,f),o.set(L.key,L),f=L.first,m--}for(;d&&m;){const L=_[m-1],I=n[d-1],A=L.key,P=I.key;L===I?(f=L.first,d--,m--):k.has(P)?!o.has(A)||T.has(A)?E(L):M.has(P)?d--:S.get(A)>S.get(P)?(M.add(A),E(L)):(T.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];k.has(L.key)||a(L,o)}for(;m;)E(_[m-1]);return Ie($),_}function wt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Rt(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function j(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),tt(()=>{const s=n.$$.on_mount.map(Ub).filter(It);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ie(s),n.$$.on_mount=[]}),l.forEach(tt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Ky(t.after_update),Ie(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Gy(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),Xb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&Gy(n,c)),d}):[],u.update(),f=!0,Ie(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=qy(e.target);u.fragment&&u.fragment.l(c),c.forEach(y)}else u.fragment&&u.fragment.c();e.intro&&O(n.$$.fragment),q(n,e.target,e.anchor),pu()}Fi(a)}class Se{constructor(){pt(this,"$$");pt(this,"$$set")}$destroy(){H(this,1),this.$destroy=te}$on(e,t){if(!It(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!Ay(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Xy="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Xy);class Al extends Error{}class Qy extends Al{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class xy extends Al{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ev extends Al{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Al{}class xb extends Al{constructor(e){super(`Invalid unit ${e}`)}}class pn extends Al{}class Wi extends Al{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ci="short",Wn="long",dr={year:Ue,month:Ue,day:Ue},e0={year:Ue,month:ci,day:Ue},tv={year:Ue,month:ci,day:Ue,weekday:ci},t0={year:Ue,month:Wn,day:Ue},n0={year:Ue,month:Wn,day:Ue,weekday:Wn},i0={hour:Ue,minute:Ue},l0={hour:Ue,minute:Ue,second:Ue},s0={hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},o0={hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn},r0={hour:Ue,minute:Ue,hourCycle:"h23"},a0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},u0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ci},f0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Wn},c0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},d0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},p0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue},m0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue,second:Ue},nv={year:Ue,month:ci,day:Ue,weekday:ci,hour:Ue,minute:Ue},h0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ci},_0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},g0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,timeZoneName:Wn},b0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn};class ro{get type(){throw new Wi}get name(){throw new Wi}get ianaName(){return this.name}get isUniversal(){throw new Wi}offsetName(e,t){throw new Wi}formatOffset(e,t){throw new Wi}offset(e){throw new Wi}equals(e){throw new Wi}get isValid(){throw new Wi}}let Gr=null;class Mr extends ro{static get instance(){return Gr===null&&(Gr=new Mr),Gr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return O0(e,t,i)}formatOffset(e,t){return Is(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Qo={};function iv(n){return Qo[n]||(Qo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Qo[n]}const lv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function sv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function ov(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let hf={};function rv(n,e={}){const t=JSON.stringify([n,e]);let i=hf[t];return i||(i=new Intl.ListFormat(n,e),hf[t]=i),i}let Fa={};function qa(n,e={}){const t=JSON.stringify([n,e]);let i=Fa[t];return i||(i=new Intl.DateTimeFormat(n,e),Fa[t]=i),i}let Ha={};function av(n,e={}){const t=JSON.stringify([n,e]);let i=Ha[t];return i||(i=new Intl.NumberFormat(n,e),Ha[t]=i),i}let ja={};function uv(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=ja[l];return s||(s=new Intl.RelativeTimeFormat(n,e),ja[l]=s),s}let Cs=null;function fv(){return Cs||(Cs=new Intl.DateTimeFormat().resolvedOptions().locale,Cs)}let _f={};function cv(n){let e=_f[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,_f[n]=e}return e}function dv(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=qa(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=qa(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function pv(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function mv(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function hv(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function $o(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function _v(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class gv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=av(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):vu(e,3);return en(t,this.padTo)}}}class bv{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Hi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=qa(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class kv{constructor(e,t,i){this.opts={style:"long",...i},!t&&$0()&&(this.rtf=uv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Uv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const yv={firstDay:1,minimalDays:4,weekend:[6,7]};class Et{static fromOpts(e){return Et.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Jt.defaultLocale,r=o||(s?"en-US":fv()),a=t||Jt.defaultNumberingSystem,u=i||Jt.defaultOutputCalendar,f=za(l)||Jt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){Cs=null,Fa={},Ha={},ja={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return Et.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=dv(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=pv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=_v(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Et.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,za(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return $o(this,e,D0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=mv(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return $o(this,e,A0,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=hv(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return $o(this,void 0,()=>P0,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return $o(this,e,N0,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Xe.utc(-40,1,1),Xe.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new gv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new bv(e,this.intl,t)}relFormatter(e={}){return new kv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return rv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:C0()?cv(this.locale):yv}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Xr=null;class Cn extends ro{static get utcInstance(){return Xr===null&&(Xr=new Cn(0)),Xr}static instance(e){return e===0?Cn.utcInstance:new Cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Cn(Ir(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Is(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Is(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Is(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class vv extends ro{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gi(n,e){if(it(n)||n===null)return e;if(n instanceof ro)return n;if(Ov(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?Cn.utcInstance:Cn.parseSpecifier(t)||Hi.create(n)}else return el(n)?Cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new vv(n)}const gu={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},gf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},wv=gu.hanidec.replace(/[\[|\]]/g,"").split("");function Sv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let Kl={};function Tv(){Kl={}}function oi({numberingSystem:n},e=""){const t=n||"latn";return Kl[t]||(Kl[t]={}),Kl[t][e]||(Kl[t][e]=new RegExp(`${gu[t]}${e}`)),Kl[t][e]}let bf=()=>Date.now(),kf="system",yf=null,vf=null,wf=null,Sf=60,Tf,$f=null;class Jt{static get now(){return bf}static set now(e){bf=e}static set defaultZone(e){kf=e}static get defaultZone(){return Gi(kf,Mr.instance)}static get defaultLocale(){return yf}static set defaultLocale(e){yf=e}static get defaultNumberingSystem(){return vf}static set defaultNumberingSystem(e){vf=e}static get defaultOutputCalendar(){return wf}static set defaultOutputCalendar(e){wf=e}static get defaultWeekSettings(){return $f}static set defaultWeekSettings(e){$f=za(e)}static get twoDigitCutoffYear(){return Sf}static set twoDigitCutoffYear(e){Sf=e%100}static get throwOnInvalid(){return Tf}static set throwOnInvalid(e){Tf=e}static resetCaches(){Et.resetCache(),Hi.resetCache(),Xe.resetCache(),Tv()}}class ai{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const k0=[0,31,59,90,120,151,181,212,243,273,304,334],y0=[0,31,60,91,121,152,182,213,244,274,305,335];function Qn(n,e){return new ai("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function bu(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function v0(n,e,t){return t+(ao(n)?y0:k0)[e-1]}function w0(n,e){const t=ao(n)?y0:k0,i=t.findIndex(s=>sWs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Lr(n)}}function Cf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ku(bu(i,1,e),t),r=Xl(i);let a=l*7+s-o-7+e,u;a<1?(u=i-1,a+=Xl(u)):a>r?(u=i+1,a-=Xl(i)):u=i;const{month:f,day:c}=w0(u,a);return{year:u,month:f,day:c,...Lr(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=v0(e,t,i);return{year:e,ordinal:l,...Lr(n)}}function Of(n){const{year:e,ordinal:t}=n,{month:i,day:l}=w0(e,t);return{year:e,month:i,day:l,...Lr(n)}}function Mf(n,e){if(!it(n.localWeekday)||!it(n.localWeekNumber)||!it(n.localWeekYear)){if(!it(n.weekday)||!it(n.weekNumber)||!it(n.weekYear))throw new Jl("Cannot mix locale-based week fields with ISO-based week fields");return it(n.localWeekday)||(n.weekday=n.localWeekday),it(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),it(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function $v(n,e=4,t=1){const i=Er(n.weekYear),l=xn(n.weekNumber,1,Ws(n.weekYear,e,t)),s=xn(n.weekday,1,7);return i?l?s?!1:Qn("weekday",n.weekday):Qn("week",n.weekNumber):Qn("weekYear",n.weekYear)}function Cv(n){const e=Er(n.year),t=xn(n.ordinal,1,Xl(n.year));return e?t?!1:Qn("ordinal",n.ordinal):Qn("year",n.year)}function S0(n){const e=Er(n.year),t=xn(n.month,1,12),i=xn(n.day,1,mr(n.year,n.month));return e?t?i?!1:Qn("day",n.day):Qn("month",n.month):Qn("year",n.year)}function T0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=xn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=xn(t,0,59),r=xn(i,0,59),a=xn(l,0,999);return s?o?r?a?!1:Qn("millisecond",l):Qn("second",i):Qn("minute",t):Qn("hour",e)}function it(n){return typeof n>"u"}function el(n){return typeof n=="number"}function Er(n){return typeof n=="number"&&n%1===0}function Ov(n){return typeof n=="string"}function Mv(n){return Object.prototype.toString.call(n)==="[object Date]"}function $0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function C0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ev(n){return Array.isArray(n)?n:[n]}function Ef(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Dv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ns(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function za(n){if(n==null)return null;if(typeof n!="object")throw new pn("Week settings must be an object");if(!xn(n.firstDay,1,7)||!xn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!xn(e,1,7)))throw new pn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function xn(n,e,t){return Er(n)&&n>=e&&n<=t}function Iv(n,e){return n-e*Math.floor(n/e)}function en(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ji(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function ml(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function yu(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function vu(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ao(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return ao(n)?366:365}function mr(n,e){const t=Iv(e-1,12)+1,i=n+(e-t)/12;return t===2?ao(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Dr(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Df(n,e,t){return-ku(bu(n,1,e),t)+e-1}function Ws(n,e=4,t=1){const i=Df(n,e,t),l=Df(n+1,e,t);return(Xl(n)-i+l)/7}function Ua(n){return n>99?n:n>Jt.twoDigitCutoffYear?1900+n:2e3+n}function O0(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ir(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function M0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new pn(`Invalid unit value ${n}`);return e}function hr(n,e){const t={};for(const i in n)if(ns(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=M0(l)}return t}function Is(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${en(t,2)}:${en(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${en(t,2)}${en(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Lr(n){return Dv(n,["hour","minute","second","millisecond"])}const Lv=["January","February","March","April","May","June","July","August","September","October","November","December"],E0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Av=["J","F","M","A","M","J","J","A","S","O","N","D"];function D0(n){switch(n){case"narrow":return[...Av];case"short":return[...E0];case"long":return[...Lv];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const I0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],L0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Pv=["M","T","W","T","F","S","S"];function A0(n){switch(n){case"narrow":return[...Pv];case"short":return[...L0];case"long":return[...I0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const P0=["AM","PM"],Nv=["Before Christ","Anno Domini"],Rv=["BC","AD"],Fv=["B","A"];function N0(n){switch(n){case"narrow":return[...Fv];case"short":return[...Rv];case"long":return[...Nv];default:return null}}function qv(n){return P0[n.hour<12?0:1]}function Hv(n,e){return A0(e)[n.weekday-1]}function jv(n,e){return D0(e)[n.month-1]}function zv(n,e){return N0(e)[n.year<0?0:1]}function Uv(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function If(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Vv={D:dr,DD:e0,DDD:t0,DDDD:n0,t:i0,tt:l0,ttt:s0,tttt:o0,T:r0,TT:a0,TTT:u0,TTTT:f0,f:c0,ff:p0,fff:h0,ffff:g0,F:d0,FF:m0,FFF:_0,FFFF:b0};class hn{static create(e,t={}){return new hn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Vv[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return en(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?qv(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?jv(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Hv(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=hn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?zv(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return If(hn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=hn.parseFormat(t),o=s.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return If(s,l(r))}}const R0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function as(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function us(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function F0(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&f)?-m:m;return[{years:d(ml(t)),months:d(ml(i)),weeks:d(ml(l)),days:d(ml(s)),hours:d(ml(o)),minutes:d(ml(r)),seconds:d(ml(a),a==="-0"),milliseconds:d(yu(u),c)}]}const n2={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Tu(n,e,t,i,l,s,o){const r={year:e.length===2?Ua(Ji(e)):Ji(e),month:E0.indexOf(t)+1,day:Ji(i),hour:Ji(l),minute:Ji(s)};return o&&(r.second=Ji(o)),n&&(r.weekday=n.length>3?I0.indexOf(n)+1:L0.indexOf(n)+1),r}const i2=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function l2(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Tu(e,l,i,t,s,o,r);let m;return a?m=n2[a]:u?m=0:m=Ir(f,c),[d,new Cn(m)]}function s2(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const o2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,r2=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,a2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Lf(n){const[,e,t,i,l,s,o,r]=n;return[Tu(e,l,i,t,s,o,r),Cn.utcInstance]}function u2(n){const[,e,t,i,l,s,o,r]=n;return[Tu(e,r,t,i,l,s,o),Cn.utcInstance]}const f2=as(Wv,Su),c2=as(Yv,Su),d2=as(Kv,Su),p2=as(H0),z0=us(Qv,cs,uo,fo),m2=us(Jv,cs,uo,fo),h2=us(Zv,cs,uo,fo),_2=us(cs,uo,fo);function g2(n){return fs(n,[f2,z0],[c2,m2],[d2,h2],[p2,_2])}function b2(n){return fs(s2(n),[i2,l2])}function k2(n){return fs(n,[o2,Lf],[r2,Lf],[a2,u2])}function y2(n){return fs(n,[e2,t2])}const v2=us(cs);function w2(n){return fs(n,[xv,v2])}const S2=as(Gv,Xv),T2=as(j0),$2=us(cs,uo,fo);function C2(n){return fs(n,[S2,z0],[T2,$2])}const Af="Invalid Duration",U0={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},O2={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...U0},Jn=146097/400,zl=146097/4800,M2={years:{quarters:4,months:12,weeks:Jn/7,days:Jn,hours:Jn*24,minutes:Jn*24*60,seconds:Jn*24*60*60,milliseconds:Jn*24*60*60*1e3},quarters:{months:3,weeks:Jn/28,days:Jn/4,hours:Jn*24/4,minutes:Jn*24*60/4,seconds:Jn*24*60*60/4,milliseconds:Jn*24*60*60*1e3/4},months:{weeks:zl/7,days:zl,hours:zl*24,minutes:zl*24*60,seconds:zl*24*60*60,milliseconds:zl*24*60*60*1e3},...U0},Sl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],E2=Sl.slice(0).reverse();function Yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function V0(n,e){let t=e.milliseconds??0;for(const i of E2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Pf(n,e){const t=V0(n,e)<0?-1:1;Sl.reduceRight((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Sl.reduce((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function D2(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class St{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?M2:O2;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Et.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return St.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new pn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new St({values:hr(e,St.normalizeUnit),loc:Et.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(el(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new pn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=y2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=w2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new pn("need to specify a reason the Duration is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new ev(i);return new St({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new xb(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?hn.create(this.loc,i).formatDurationFromString(this,e):Af}toHuman(e={}){if(!this.isValid)return Af;const t=Sl.map(i=>{const l=this.values[i];return it(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=vu(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Xe.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?V0(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e),i={};for(const l of Sl)(ns(t.values,l)||ns(this.values,l))&&(i[l]=t.get(l)+this.get(l));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=M0(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...hr(e,St.normalizeUnit)};return Yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return Yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Pf(this.matrix,e),Yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=D2(this.normalize().shiftToAll().toObject());return Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>St.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Sl)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;el(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else el(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Pf(this.matrix,t),Yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Sl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Ul="Invalid Interval";function I2(n,e){return!n||!n.isValid?Kt.invalid("missing or invalid start"):!e||!e.isValid?Kt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Kt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ys).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Kt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=St.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Kt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Kt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Kt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Kt.fromDateTimes(t,a.time)),t=null);return Kt.merge(l)}difference(...e){return Kt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ul}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=dr,t={}){return this.isValid?hn.create(this.s.loc.clone(t),e).formatInterval(this):Ul}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ul}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ul}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ul}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ul}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):St.invalid(this.invalidReason)}mapEndpoints(e){return Kt.fromDateTimes(e(this.s),e(this.e))}}class Co{static hasDST(e=Jt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Hi.isValidZone(e)}static normalizeZone(e){return Gi(e,Jt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Et.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Et.create(t,null,"gregory").eras(e)}static features(){return{relative:$0(),localeWeek:C0()}}}function Nf(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(St.fromMillis(i).as("days"))}function L2(n,e,t){const i=[["years",(a,u)=>u.year-a.year],["quarters",(a,u)=>u.quarter-a.quarter+(u.year-a.year)*4],["months",(a,u)=>u.month-a.month+(u.year-a.year)*12],["weeks",(a,u)=>{const f=Nf(a,u);return(f-f%7)/7}],["days",Nf]],l={},s=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,l[a]=u(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function A2(n,e,t,i){let[l,s,o,r]=L2(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?St.fromMillis(a,i).shiftTo(...u).plus(f):f}const P2="missing Intl.DateTimeFormat.formatToParts support";function Ct(n,e=t=>t){return{regex:n,deser:([t])=>e(Sv(t))}}const N2=" ",B0=`[ ${N2}]`,W0=new RegExp(B0,"g");function R2(n){return n.replace(/\./g,"\\.?").replace(W0,B0)}function Rf(n){return n.replace(/\./g,"").replace(W0," ").toLowerCase()}function ri(n,e){return n===null?null:{regex:RegExp(n.map(R2).join("|")),deser:([t])=>n.findIndex(i=>Rf(t)===Rf(i))+e}}function Ff(n,e){return{regex:n,deser:([,t,i])=>Ir(t,i),groups:e}}function Oo(n){return{regex:n,deser:([e])=>e}}function F2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function q2(n,e){const t=oi(e),i=oi(e,"{2}"),l=oi(e,"{3}"),s=oi(e,"{4}"),o=oi(e,"{6}"),r=oi(e,"{1,2}"),a=oi(e,"{1,3}"),u=oi(e,"{1,6}"),f=oi(e,"{1,9}"),c=oi(e,"{2,4}"),d=oi(e,"{4,6}"),m=_=>({regex:RegExp(F2(_.val)),deser:([k])=>k,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return ri(e.eras("short"),0);case"GG":return ri(e.eras("long"),0);case"y":return Ct(u);case"yy":return Ct(c,Ua);case"yyyy":return Ct(s);case"yyyyy":return Ct(d);case"yyyyyy":return Ct(o);case"M":return Ct(r);case"MM":return Ct(i);case"MMM":return ri(e.months("short",!0),1);case"MMMM":return ri(e.months("long",!0),1);case"L":return Ct(r);case"LL":return Ct(i);case"LLL":return ri(e.months("short",!1),1);case"LLLL":return ri(e.months("long",!1),1);case"d":return Ct(r);case"dd":return Ct(i);case"o":return Ct(a);case"ooo":return Ct(l);case"HH":return Ct(i);case"H":return Ct(r);case"hh":return Ct(i);case"h":return Ct(r);case"mm":return Ct(i);case"m":return Ct(r);case"q":return Ct(r);case"qq":return Ct(i);case"s":return Ct(r);case"ss":return Ct(i);case"S":return Ct(a);case"SSS":return Ct(l);case"u":return Oo(f);case"uu":return Oo(r);case"uuu":return Ct(t);case"a":return ri(e.meridiems(),0);case"kkkk":return Ct(s);case"kk":return Ct(c,Ua);case"W":return Ct(r);case"WW":return Ct(i);case"E":case"c":return Ct(t);case"EEE":return ri(e.weekdays("short",!1),1);case"EEEE":return ri(e.weekdays("long",!1),1);case"ccc":return ri(e.weekdays("short",!0),1);case"cccc":return ri(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ff(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ff(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Oo(/[a-z_+-/]{1,256}?/i);case" ":return Oo(/[^\S\n\r]/);default:return m(_)}})(n)||{invalidReason:P2};return g.token=n,g}const H2={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function j2(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=H2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function z2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function U2(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(ns(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function V2(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return it(n.z)||(t=Hi.create(n.z)),it(n.Z)||(t||(t=new Cn(n.Z)),i=n.Z),it(n.q)||(n.M=(n.q-1)*3+1),it(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),it(n.u)||(n.S=yu(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let xr=null;function B2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function W2(n,e){if(n.literal)return n;const t=hn.macroTokenToFormatOpts(n.val),i=Z0(t,e);return i==null||i.includes(void 0)?n:i}function Y0(n,e){return Array.prototype.concat(...n.map(t=>W2(t,e)))}class K0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Y0(hn.parseFormat(t),e),this.units=this.tokens.map(i=>q2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=z2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=U2(e,this.regex,this.handlers),[l,s,o]=i?V2(i):[null,null,void 0];if(ns(i,"a")&&ns(i,"H"))throw new Jl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function J0(n,e,t){return new K0(n,t).explainFromTokens(e)}function Y2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=J0(n,e,t);return[i,l,s,o]}function Z0(n,e){if(!n)return null;const i=hn.create(e,n).dtFormatter(B2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>j2(o,n,s))}const ea="Invalid DateTime",qf=864e13;function Os(n){return new ai("unsupported zone",`the zone "${n.name}" is not supported`)}function ta(n){return n.weekData===null&&(n.weekData=pr(n.c)),n.weekData}function na(n){return n.localWeekData===null&&(n.localWeekData=pr(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function hl(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function G0(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Mo(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function xo(n,e,t){return G0(Dr(n),e,t)}function Hf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,mr(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=St.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Dr(s);let[a,u]=G0(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,u=Xe.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return Xe.invalid(new ai("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Eo(n,e,t=!0){return n.isValid?hn.create(Et.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ia(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=en(n.c.year,t?6:4),e?(i+="-",i+=en(n.c.month),i+="-",i+=en(n.c.day)):(i+=en(n.c.month),i+=en(n.c.day)),i}function jf(n,e,t,i,l,s){let o=en(n.c.hour);return e?(o+=":",o+=en(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=en(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=en(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=en(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=en(Math.trunc(-n.o/60)),o+=":",o+=en(Math.trunc(-n.o%60))):(o+="+",o+=en(Math.trunc(n.o/60)),o+=":",o+=en(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const X0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},K2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},J2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Q0=["year","month","day","hour","minute","second","millisecond"],Z2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],G2=["year","ordinal","hour","minute","second","millisecond"];function X2(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new xb(n);return e}function zf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return X2(n)}}function Q2(n){return tr[n]||(er===void 0&&(er=Jt.now()),tr[n]=n.offset(er)),tr[n]}function Uf(n,e){const t=Gi(e.zone,Jt.defaultZone);if(!t.isValid)return Xe.invalid(Os(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Jt.now();else{for(const a of Q0)it(n[a])&&(n[a]=X0[a]);const o=S0(n)||T0(n);if(o)return Xe.invalid(o);const r=Q2(t);[l,s]=xo(n,r,t)}return new Xe({ts:l,zone:t,loc:i,o:s})}function Vf(n,e,t){const i=it(t.round)?!0:t.round,l=(o,r)=>(o=vu(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Bf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let er,tr={};class Xe{constructor(e){const t=e.zone||Jt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ai("invalid input"):null)||(t.isValid?null:Os(t));this.ts=it(e.ts)?Jt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=el(e.o)&&!e.old?e.o:t.offset(this.ts);l=Mo(this.ts,r),i=Number.isNaN(l.year)?new ai("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||Et.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return e.zone=Cn.utcInstance,Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Mv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Gi(t.zone,Jt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid(Os(l))}static fromMillis(e,t={}){if(el(e))return e<-qf||e>qf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(el(e))return new Xe({ts:e*1e3,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Gi(t.zone,Jt.defaultZone);if(!i.isValid)return Xe.invalid(Os(i));const l=Et.fromObject(t),s=hr(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Mf(s,l),a=Jt.now(),u=it(t.specificOffset)?i.offset(a):t.specificOffset,f=!it(s.ordinal),c=!it(s.year),d=!it(s.month)||!it(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||f)&&h)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new Jl("Can't mix ordinal dates with month/day");const g=h||s.weekday&&!m;let _,k,S=Mo(a,u);g?(_=Z2,k=K2,S=pr(S,o,r)):f?(_=G2,k=J2,S=Qr(S)):(_=Q0,k=X0);let $=!1;for(const P of _){const N=s[P];it(N)?$?s[P]=k[P]:s[P]=S[P]:$=!0}const T=g?$v(s,o,r):f?Cv(s):S0(s),M=T||T0(s);if(M)return Xe.invalid(M);const E=g?Cf(s,o,r):f?Of(s):s,[L,I]=xo(E,u,i),A=new Xe({ts:L,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==A.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${A.toISO()}`):A.isValid?A:Xe.invalid(A.invalid)}static fromISO(e,t={}){const[i,l]=g2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=b2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=k2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new pn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=Y2(o,e,t);return f?Xe.invalid(f):Vl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=C2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new pn("need to specify a reason the DateTime is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new Qy(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=Z0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return Y0(hn.parseFormat(e),Et.fromObject(t)).map(l=>l.val).join("")}static resetCache(){er=void 0,tr={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ta(this).weekYear:NaN}get weekNumber(){return this.isValid?ta(this).weekNumber:NaN}get weekday(){return this.isValid?ta(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?na(this).weekday:NaN}get localWeekNumber(){return this.isValid?na(this).weekNumber:NaN}get localWeekYear(){return this.isValid?na(this).weekYear:NaN}get ordinal(){return this.isValid?Qr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Co.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Co.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Co.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Co.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Dr(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Mo(a,o),c=Mo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[hl(this,{ts:a}),hl(this,{ts:u})]:[this]}get isInLeapYear(){return ao(this.year)}get daysInMonth(){return mr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ws(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ws(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=hn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(Cn.instance(e),t)}toLocal(){return this.setZone(Jt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Gi(e,Jt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=xo(o,s,e)}return hl(this,{ts:l,zone:e})}else return Xe.invalid(Os(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return hl(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=hr(e,zf),{minDaysInFirstWeek:i,startOfWeek:l}=Mf(t,this.loc),s=!it(t.weekYear)||!it(t.weekNumber)||!it(t.weekday),o=!it(t.ordinal),r=!it(t.year),a=!it(t.month)||!it(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new Jl("Can't mix ordinal dates with month/day");let c;s?c=Cf({...pr(this.c,i,l),...t},i,l):it(t.ordinal)?(c={...this.toObject(),...t},it(t.day)&&(c.day=Math.min(mr(c.year,c.month),c.day))):c=Of({...Qr(this.c),...t});const[d,m]=xo(c,this.o,this.zone);return hl(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return hl(this,Hf(this,t))}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e).negate();return hl(this,Hf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=St.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,u=A2(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Kt.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||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new pn("max requires all arguments be DateTimes");return Ef(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return J0(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=Et.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new K0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new pn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new pn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?Xe.invalid(f):Vl(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return dr}static get DATE_MED(){return e0}static get DATE_MED_WITH_WEEKDAY(){return tv}static get DATE_FULL(){return t0}static get DATE_HUGE(){return n0}static get TIME_SIMPLE(){return i0}static get TIME_WITH_SECONDS(){return l0}static get TIME_WITH_SHORT_OFFSET(){return s0}static get TIME_WITH_LONG_OFFSET(){return o0}static get TIME_24_SIMPLE(){return r0}static get TIME_24_WITH_SECONDS(){return a0}static get TIME_24_WITH_SHORT_OFFSET(){return u0}static get TIME_24_WITH_LONG_OFFSET(){return f0}static get DATETIME_SHORT(){return c0}static get DATETIME_SHORT_WITH_SECONDS(){return d0}static get DATETIME_MED(){return p0}static get DATETIME_MED_WITH_SECONDS(){return m0}static get DATETIME_MED_WITH_WEEKDAY(){return nv}static get DATETIME_FULL(){return h0}static get DATETIME_FULL_WITH_SECONDS(){return _0}static get DATETIME_HUGE(){return g0}static get DATETIME_HUGE_WITH_SECONDS(){return b0}}function ys(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&el(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new pn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const x2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],ew=[".mp4",".avi",".mov",".3gp",".wmv"],tw=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],nw=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],x0=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class V{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||V.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return V.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!V.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!V.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){V.inArray(e,t)||e.push(t)}static mergeUnique(e,t){for(let i of t)V.pushUnique(e,i);return e}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=V.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!V.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!V.isObject(s)&&!Array.isArray(s)||!V.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!V.isObject(l)&&!Array.isArray(l)||!V.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):V.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||V.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||V.isObject(e)&&Object.keys(e).length>0)&&V.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return V.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),V.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",V.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Xe.fromFormat(e,i,{zone:"UTC"})}return typeof e=="number"?Xe.fromMillis(e):Xe.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);V.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!x2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!ew.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!tw.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!nw.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return V.hasImageExtension(e)?"image":V.hasDocumentExtension(e)?"document":V.hasVideoExtension(e)?"video":V.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(V.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)V.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):V.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},V.dummyCollectionSchemaData(e))}static dummyCollectionSchemaData(e,t=!1){var s;const i=(e==null?void 0:e.fields)||[],l={};for(const o of i){if(o.hidden||t&&o.primaryKey&&o.autogeneratePattern||t&&o.type==="autodate")continue;let r=null;if(o.type==="number")r=123;else if(o.type==="date"||o.type==="autodate")r="2022-01-01 10:00:00.123Z";else if(o.type=="bool")r=!0;else if(o.type=="email")r="test@example.com";else if(o.type=="url")r="https://example.com";else if(o.type=="json")r="JSON";else if(o.type=="file"){if(t)continue;r="filename.jpg",o.maxSelect!=1&&(r=[r])}else o.type=="select"?(r=(s=o==null?void 0:o.values)==null?void 0:s[0],(o==null?void 0:o.maxSelect)!=1&&(r=[r])):o.type=="relation"?(r="RELATION_RECORD_ID",(o==null?void 0:o.maxSelect)!=1&&(r=[r])):r="test";l[o.name]=r}return l}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"password":return"ri-lock-password-line";case"autodate":return"ri-calendar-check-line";default:return"ri-star-s-line"}}static getFieldValueType(e){switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&(e==null?void 0:e.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="fields"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const l=Array.isArray(e.fields)?e.fields:[],s=Array.isArray(t.fields)?t.fields:[],o=l.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=V.isObject(u)&&V.findByKey(l,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name0){const r=V.getExpandPresentableRelField(o,t,i-1);r&&(s+="."+r)}return s}return""}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],h=d.create(c,u,m);d.add(h),l(h.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=V.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=V.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(V.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?V.plainText(e):e,V.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return V.truncate(e.join(","),i);if(typeof e=="object")try{return V.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of V.extractColumnsFromQuery(e.viewQuery))V.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)V.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){let s=e.find(r=>r.name==t||r.id==t);if(!s||l>=4)return[];s.fields=s.fields||[];let o=V.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=V.getCollectionAutocompleteKeys(e,r.collectionId,a+".",l+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&["select","file","relation"].includes(r.type)&&(o.push(a+":each"),o.push(a+":length"))}for(const r of e){r.fields=r.fields||[];for(const a of r.fields)if(a.type=="relation"&&a.collectionId==s.id){const u=i+r.name+"_via_"+a.name,f=V.getCollectionAutocompleteKeys(e,r.id,u+".",l+2);f.length&&(o=o.concat(f))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];let i,l;for(const s of e)if(!s.system){i="@collection."+s.name+".",l=V.getCollectionAutocompleteKeys(e,s.name,i);for(const o of l)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.body."),i.push("@request.headers."),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName");const l=e.filter(s=>s.type==="auth");for(const s of l){if(s.system)continue;const o=V.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)V.pushUnique(i,r)}if(t){const s=V.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const o of s){i.push(o);const r=o.split(".");r.length===3&&r[2].indexOf(":")===-1&&i.push(o+":isset")}}return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!V.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const _=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");_&&t.columns.push({name:_,collate:g[2]||"",sort:((d=g[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+V.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` +}`,c=`__svelte_${jy(f)}_${r}`,d=Kb(n),{stylesheet:m,rules:h}=fr.get(d)||zy(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${l}ms 1 both`,cr+=1,c}function Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),cr-=l,cr||Uy())}function Uy(){du(()=>{cr||(fr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&y(e)}),fr.clear())})}function Vy(n,e,t,i){if(!e)return te;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return te;const{delay:s=0,duration:o=300,easing:r=lo,start:a=Cr()+s,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function g(){c&&(h=Us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Vs(n,h),d=!1}return Or(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),g(),f(0,1),_}function By(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Zb(n,l)}}function Zb(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function Fi(n){Bs=n}function so(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function Xt(n){so().$$.on_mount.push(n)}function Wy(n){so().$$.after_update.push(n)}function oo(n){so().$$.on_destroy.push(n)}function kt(){const n=so();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Jb(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Yl=[],ie=[];let Gl=[];const Na=[],Gb=Promise.resolve();let Ra=!1;function Xb(){Ra||(Ra=!0,Gb.then(pu))}function dn(){return Xb(),Gb}function tt(n){Gl.push(n)}function $e(n){Na.push(n)}const Zr=new Set;let jl=0;function pu(){if(jl!==0)return;const n=Bs;do{try{for(;jln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let ks;function mu(){return ks||(ks=Promise.resolve(),ks.then(()=>{ks=null})),ks}function Cl(n,e,t){n.dispatchEvent(Jb(`${e?"intro":"outro"}${t}`))}const Xo=new Set;let wi;function re(){wi={r:0,c:[],p:wi}}function ae(){wi.r||Ie(wi.c),wi=wi.p}function M(n,e){n&&n.i&&(Xo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Xo.has(n))return;Xo.add(n),wi.c.push(()=>{Xo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const hu={duration:0};function Qb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=lo,tick:g=te,css:_}=l||hu;_&&(o=Us(n,0,1,m,d,h,_,a++)),g(0,1);const k=Cr()+d,S=k+m;r&&r.abort(),s=!0,tt(()=>Cl(n,!0,"start")),r=Or($=>{if(s){if($>=S)return g(1,0),Cl(n,!0,"end"),u(),s=!1;if($>=k){const T=h(($-k)/m);g(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),It(l)?(l=l(i),mu().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function _u(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=wi;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=lo,tick:m=te,css:h}=l||hu;h&&(o=Us(n,1,0,c,f,d,h));const g=Cr()+f,_=g+c;tt(()=>Cl(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Or(k=>{if(s){if(k>=_)return m(0,1),Cl(n,!1,"end"),--r.r||Ie(r.c),!1;if(k>=g){const S=d((k-g)/c);m(1-S,S)}}return s})}return It(l)?mu().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&Vs(n,o),s=!1)}}}function He(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Vs(n,u)}function d(h,g){const _=h.b-o;return g*=Math.abs(_),{a:o,b:h.b,d:_,duration:g,start:h.start,end:h.start+g,group:h.group}}function m(h){const{delay:g=0,duration:_=300,easing:k=lo,tick:S=te,css:$}=s||hu,T={start:Cr()+g,b:h};h||(T.group=wi,wi.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=Us(n,o,h,_,g,k,$)),h&&S(0,1),r=d(T,_),tt(()=>Cl(n,h,"start")),Or(O=>{if(a&&O>a.start&&(r=d(a,_),a=null,Cl(n,r.b,"start"),$&&(c(),u=Us(n,o,r.b,r.duration,0,k,s.css))),r){if(O>=r.end)S(o=r.b,1-o),Cl(n,r.b,"end"),a||(r.b?c():--r.group.r||Ie(r.group.c)),r=null;else if(O>=r.start){const E=O-r.start;o=r.a+r.d*k(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){It(s)?mu().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function mf(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(re(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),M(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&pu()}if(Ly(n)){const l=so();if(n.then(s=>{Fi(l),i(e.then,1,e.value,s),Fi(null)},s=>{if(Fi(l),i(e.catch,2,e.error,s),Fi(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function Jy(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function de(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function di(n,e){n.d(1),e.delete(n.key)}function Bt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Zy(n,e){n.f(),Bt(n,e)}function vt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,h=d;const g={};for(;h--;)g[n[h].key]=h;const _=[],k=new Map,S=new Map,$=[];for(h=m;h--;){const L=c(l,s,h),I=t(L);let A=o.get(I);A?$.push(()=>A.p(L,e)):(A=u(I,L),A.c()),k.set(I,_[h]=A),I in g&&S.set(I,Math.abs(h-g[I]))}const T=new Set,O=new Set;function E(L){M(L,1),L.m(r,f),o.set(L.key,L),f=L.first,m--}for(;d&&m;){const L=_[m-1],I=n[d-1],A=L.key,P=I.key;L===I?(f=L.first,d--,m--):k.has(P)?!o.has(A)||T.has(A)?E(L):O.has(P)?d--:S.get(A)>S.get(P)?(O.add(A),E(L)):(T.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];k.has(L.key)||a(L,o)}for(;m;)E(_[m-1]);return Ie($),_}function wt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Rt(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function j(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),tt(()=>{const s=n.$$.on_mount.map(Ub).filter(It);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ie(s),n.$$.on_mount=[]}),l.forEach(tt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Ky(t.after_update),Ie(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Gy(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),Xb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&Gy(n,c)),d}):[],u.update(),f=!0,Ie(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=qy(e.target);u.fragment&&u.fragment.l(c),c.forEach(y)}else u.fragment&&u.fragment.c();e.intro&&M(n.$$.fragment),q(n,e.target,e.anchor),pu()}Fi(a)}class Se{constructor(){pt(this,"$$");pt(this,"$$set")}$destroy(){H(this,1),this.$destroy=te}$on(e,t){if(!It(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!Ay(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Xy="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Xy);class Al extends Error{}class Qy extends Al{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class xy extends Al{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ev extends Al{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Al{}class xb extends Al{constructor(e){super(`Invalid unit ${e}`)}}class pn extends Al{}class Wi extends Al{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ci="short",Wn="long",dr={year:Ue,month:Ue,day:Ue},e0={year:Ue,month:ci,day:Ue},tv={year:Ue,month:ci,day:Ue,weekday:ci},t0={year:Ue,month:Wn,day:Ue},n0={year:Ue,month:Wn,day:Ue,weekday:Wn},i0={hour:Ue,minute:Ue},l0={hour:Ue,minute:Ue,second:Ue},s0={hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},o0={hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn},r0={hour:Ue,minute:Ue,hourCycle:"h23"},a0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},u0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ci},f0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Wn},c0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},d0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},p0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue},m0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue,second:Ue},nv={year:Ue,month:ci,day:Ue,weekday:ci,hour:Ue,minute:Ue},h0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ci},_0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},g0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,timeZoneName:Wn},b0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn};class ro{get type(){throw new Wi}get name(){throw new Wi}get ianaName(){return this.name}get isUniversal(){throw new Wi}offsetName(e,t){throw new Wi}formatOffset(e,t){throw new Wi}offset(e){throw new Wi}equals(e){throw new Wi}get isValid(){throw new Wi}}let Gr=null;class Mr extends ro{static get instance(){return Gr===null&&(Gr=new Mr),Gr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return O0(e,t,i)}formatOffset(e,t){return Is(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Qo={};function iv(n){return Qo[n]||(Qo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Qo[n]}const lv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function sv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function ov(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let hf={};function rv(n,e={}){const t=JSON.stringify([n,e]);let i=hf[t];return i||(i=new Intl.ListFormat(n,e),hf[t]=i),i}let Fa={};function qa(n,e={}){const t=JSON.stringify([n,e]);let i=Fa[t];return i||(i=new Intl.DateTimeFormat(n,e),Fa[t]=i),i}let Ha={};function av(n,e={}){const t=JSON.stringify([n,e]);let i=Ha[t];return i||(i=new Intl.NumberFormat(n,e),Ha[t]=i),i}let ja={};function uv(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=ja[l];return s||(s=new Intl.RelativeTimeFormat(n,e),ja[l]=s),s}let Cs=null;function fv(){return Cs||(Cs=new Intl.DateTimeFormat().resolvedOptions().locale,Cs)}let _f={};function cv(n){let e=_f[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,_f[n]=e}return e}function dv(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=qa(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=qa(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function pv(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function mv(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function hv(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function $o(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function _v(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class gv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=av(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):vu(e,3);return en(t,this.padTo)}}}class bv{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Hi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=qa(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class kv{constructor(e,t,i){this.opts={style:"long",...i},!t&&$0()&&(this.rtf=uv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Uv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const yv={firstDay:1,minimalDays:4,weekend:[6,7]};class Et{static fromOpts(e){return Et.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||Jt.defaultLocale,r=o||(s?"en-US":fv()),a=t||Jt.defaultNumberingSystem,u=i||Jt.defaultOutputCalendar,f=za(l)||Jt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){Cs=null,Fa={},Ha={},ja={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return Et.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=dv(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=pv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=_v(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Et.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,za(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return $o(this,e,D0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=mv(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return $o(this,e,A0,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=hv(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return $o(this,void 0,()=>P0,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return $o(this,e,N0,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Xe.utc(-40,1,1),Xe.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new gv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new bv(e,this.intl,t)}relFormatter(e={}){return new kv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return rv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:C0()?cv(this.locale):yv}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Xr=null;class Cn extends ro{static get utcInstance(){return Xr===null&&(Xr=new Cn(0)),Xr}static instance(e){return e===0?Cn.utcInstance:new Cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Cn(Ir(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Is(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Is(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Is(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class vv extends ro{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gi(n,e){if(it(n)||n===null)return e;if(n instanceof ro)return n;if(Ov(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?Cn.utcInstance:Cn.parseSpecifier(t)||Hi.create(n)}else return el(n)?Cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new vv(n)}const gu={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},gf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},wv=gu.hanidec.replace(/[\[|\]]/g,"").split("");function Sv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let Kl={};function Tv(){Kl={}}function oi({numberingSystem:n},e=""){const t=n||"latn";return Kl[t]||(Kl[t]={}),Kl[t][e]||(Kl[t][e]=new RegExp(`${gu[t]}${e}`)),Kl[t][e]}let bf=()=>Date.now(),kf="system",yf=null,vf=null,wf=null,Sf=60,Tf,$f=null;class Jt{static get now(){return bf}static set now(e){bf=e}static set defaultZone(e){kf=e}static get defaultZone(){return Gi(kf,Mr.instance)}static get defaultLocale(){return yf}static set defaultLocale(e){yf=e}static get defaultNumberingSystem(){return vf}static set defaultNumberingSystem(e){vf=e}static get defaultOutputCalendar(){return wf}static set defaultOutputCalendar(e){wf=e}static get defaultWeekSettings(){return $f}static set defaultWeekSettings(e){$f=za(e)}static get twoDigitCutoffYear(){return Sf}static set twoDigitCutoffYear(e){Sf=e%100}static get throwOnInvalid(){return Tf}static set throwOnInvalid(e){Tf=e}static resetCaches(){Et.resetCache(),Hi.resetCache(),Xe.resetCache(),Tv()}}class ai{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const k0=[0,31,59,90,120,151,181,212,243,273,304,334],y0=[0,31,60,91,121,152,182,213,244,274,305,335];function Qn(n,e){return new ai("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function bu(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function v0(n,e,t){return t+(ao(n)?y0:k0)[e-1]}function w0(n,e){const t=ao(n)?y0:k0,i=t.findIndex(s=>sWs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Lr(n)}}function Cf(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ku(bu(i,1,e),t),r=Xl(i);let a=l*7+s-o-7+e,u;a<1?(u=i-1,a+=Xl(u)):a>r?(u=i+1,a-=Xl(i)):u=i;const{month:f,day:c}=w0(u,a);return{year:u,month:f,day:c,...Lr(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=v0(e,t,i);return{year:e,ordinal:l,...Lr(n)}}function Of(n){const{year:e,ordinal:t}=n,{month:i,day:l}=w0(e,t);return{year:e,month:i,day:l,...Lr(n)}}function Mf(n,e){if(!it(n.localWeekday)||!it(n.localWeekNumber)||!it(n.localWeekYear)){if(!it(n.weekday)||!it(n.weekNumber)||!it(n.weekYear))throw new Jl("Cannot mix locale-based week fields with ISO-based week fields");return it(n.localWeekday)||(n.weekday=n.localWeekday),it(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),it(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function $v(n,e=4,t=1){const i=Er(n.weekYear),l=xn(n.weekNumber,1,Ws(n.weekYear,e,t)),s=xn(n.weekday,1,7);return i?l?s?!1:Qn("weekday",n.weekday):Qn("week",n.weekNumber):Qn("weekYear",n.weekYear)}function Cv(n){const e=Er(n.year),t=xn(n.ordinal,1,Xl(n.year));return e?t?!1:Qn("ordinal",n.ordinal):Qn("year",n.year)}function S0(n){const e=Er(n.year),t=xn(n.month,1,12),i=xn(n.day,1,mr(n.year,n.month));return e?t?i?!1:Qn("day",n.day):Qn("month",n.month):Qn("year",n.year)}function T0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=xn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=xn(t,0,59),r=xn(i,0,59),a=xn(l,0,999);return s?o?r?a?!1:Qn("millisecond",l):Qn("second",i):Qn("minute",t):Qn("hour",e)}function it(n){return typeof n>"u"}function el(n){return typeof n=="number"}function Er(n){return typeof n=="number"&&n%1===0}function Ov(n){return typeof n=="string"}function Mv(n){return Object.prototype.toString.call(n)==="[object Date]"}function $0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function C0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ev(n){return Array.isArray(n)?n:[n]}function Ef(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Dv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ns(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function za(n){if(n==null)return null;if(typeof n!="object")throw new pn("Week settings must be an object");if(!xn(n.firstDay,1,7)||!xn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!xn(e,1,7)))throw new pn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function xn(n,e,t){return Er(n)&&n>=e&&n<=t}function Iv(n,e){return n-e*Math.floor(n/e)}function en(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ji(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function ml(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function yu(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function vu(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ao(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return ao(n)?366:365}function mr(n,e){const t=Iv(e-1,12)+1,i=n+(e-t)/12;return t===2?ao(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Dr(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Df(n,e,t){return-ku(bu(n,1,e),t)+e-1}function Ws(n,e=4,t=1){const i=Df(n,e,t),l=Df(n+1,e,t);return(Xl(n)-i+l)/7}function Ua(n){return n>99?n:n>Jt.twoDigitCutoffYear?1900+n:2e3+n}function O0(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ir(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function M0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new pn(`Invalid unit value ${n}`);return e}function hr(n,e){const t={};for(const i in n)if(ns(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=M0(l)}return t}function Is(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${en(t,2)}:${en(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${en(t,2)}${en(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Lr(n){return Dv(n,["hour","minute","second","millisecond"])}const Lv=["January","February","March","April","May","June","July","August","September","October","November","December"],E0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Av=["J","F","M","A","M","J","J","A","S","O","N","D"];function D0(n){switch(n){case"narrow":return[...Av];case"short":return[...E0];case"long":return[...Lv];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const I0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],L0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Pv=["M","T","W","T","F","S","S"];function A0(n){switch(n){case"narrow":return[...Pv];case"short":return[...L0];case"long":return[...I0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const P0=["AM","PM"],Nv=["Before Christ","Anno Domini"],Rv=["BC","AD"],Fv=["B","A"];function N0(n){switch(n){case"narrow":return[...Fv];case"short":return[...Rv];case"long":return[...Nv];default:return null}}function qv(n){return P0[n.hour<12?0:1]}function Hv(n,e){return A0(e)[n.weekday-1]}function jv(n,e){return D0(e)[n.month-1]}function zv(n,e){return N0(e)[n.year<0?0:1]}function Uv(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function If(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Vv={D:dr,DD:e0,DDD:t0,DDDD:n0,t:i0,tt:l0,ttt:s0,tttt:o0,T:r0,TT:a0,TTT:u0,TTTT:f0,f:c0,ff:p0,fff:h0,ffff:g0,F:d0,FF:m0,FFF:_0,FFFF:b0};class hn{static create(e,t={}){return new hn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l||/^\s+$/.test(i),val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return Vv[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return en(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?qv(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?jv(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Hv(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=hn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?zv(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return If(hn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=hn.parseFormat(t),o=s.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return If(s,l(r))}}const R0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function as(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function us(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function F0(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(h||m&&f)?-m:m;return[{years:d(ml(t)),months:d(ml(i)),weeks:d(ml(l)),days:d(ml(s)),hours:d(ml(o)),minutes:d(ml(r)),seconds:d(ml(a),a==="-0"),milliseconds:d(yu(u),c)}]}const n2={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Tu(n,e,t,i,l,s,o){const r={year:e.length===2?Ua(Ji(e)):Ji(e),month:E0.indexOf(t)+1,day:Ji(i),hour:Ji(l),minute:Ji(s)};return o&&(r.second=Ji(o)),n&&(r.weekday=n.length>3?I0.indexOf(n)+1:L0.indexOf(n)+1),r}const i2=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function l2(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Tu(e,l,i,t,s,o,r);let m;return a?m=n2[a]:u?m=0:m=Ir(f,c),[d,new Cn(m)]}function s2(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const o2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,r2=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,a2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Lf(n){const[,e,t,i,l,s,o,r]=n;return[Tu(e,l,i,t,s,o,r),Cn.utcInstance]}function u2(n){const[,e,t,i,l,s,o,r]=n;return[Tu(e,r,t,i,l,s,o),Cn.utcInstance]}const f2=as(Wv,Su),c2=as(Yv,Su),d2=as(Kv,Su),p2=as(H0),z0=us(Qv,cs,uo,fo),m2=us(Jv,cs,uo,fo),h2=us(Zv,cs,uo,fo),_2=us(cs,uo,fo);function g2(n){return fs(n,[f2,z0],[c2,m2],[d2,h2],[p2,_2])}function b2(n){return fs(s2(n),[i2,l2])}function k2(n){return fs(n,[o2,Lf],[r2,Lf],[a2,u2])}function y2(n){return fs(n,[e2,t2])}const v2=us(cs);function w2(n){return fs(n,[xv,v2])}const S2=as(Gv,Xv),T2=as(j0),$2=us(cs,uo,fo);function C2(n){return fs(n,[S2,z0],[T2,$2])}const Af="Invalid Duration",U0={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},O2={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...U0},Jn=146097/400,zl=146097/4800,M2={years:{quarters:4,months:12,weeks:Jn/7,days:Jn,hours:Jn*24,minutes:Jn*24*60,seconds:Jn*24*60*60,milliseconds:Jn*24*60*60*1e3},quarters:{months:3,weeks:Jn/28,days:Jn/4,hours:Jn*24/4,minutes:Jn*24*60/4,seconds:Jn*24*60*60/4,milliseconds:Jn*24*60*60*1e3/4},months:{weeks:zl/7,days:zl,hours:zl*24,minutes:zl*24*60,seconds:zl*24*60*60,milliseconds:zl*24*60*60*1e3},...U0},Sl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],E2=Sl.slice(0).reverse();function Yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function V0(n,e){let t=e.milliseconds??0;for(const i of E2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Pf(n,e){const t=V0(n,e)<0?-1:1;Sl.reduceRight((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Sl.reduce((i,l)=>{if(it(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function D2(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class St{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?M2:O2;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Et.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return St.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new pn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new St({values:hr(e,St.normalizeUnit),loc:Et.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(el(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new pn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=y2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=w2(e);return i?St.fromObject(i,t):St.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new pn("need to specify a reason the Duration is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new ev(i);return new St({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new xb(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?hn.create(this.loc,i).formatDurationFromString(this,e):Af}toHuman(e={}){if(!this.isValid)return Af;const t=Sl.map(i=>{const l=this.values[i];return it(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=vu(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Xe.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?V0(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e),i={};for(const l of Sl)(ns(t.values,l)||ns(this.values,l))&&(i[l]=t.get(l)+this.get(l));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=M0(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...hr(e,St.normalizeUnit)};return Yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return Yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Pf(this.matrix,e),Yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=D2(this.normalize().shiftToAll().toObject());return Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>St.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Sl)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;el(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else el(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Pf(this.matrix,t),Yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Sl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Ul="Invalid Interval";function I2(n,e){return!n||!n.isValid?Kt.invalid("missing or invalid start"):!e||!e.isValid?Kt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Kt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ys).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Kt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=St.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Kt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Kt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Kt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Kt.fromDateTimes(t,a.time)),t=null);return Kt.merge(l)}difference(...e){return Kt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ul}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=dr,t={}){return this.isValid?hn.create(this.s.loc.clone(t),e).formatInterval(this):Ul}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ul}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ul}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ul}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ul}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):St.invalid(this.invalidReason)}mapEndpoints(e){return Kt.fromDateTimes(e(this.s),e(this.e))}}class Co{static hasDST(e=Jt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Hi.isValidZone(e)}static normalizeZone(e){return Gi(e,Jt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Et.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||Et.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||Et.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Et.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Et.create(t,null,"gregory").eras(e)}static features(){return{relative:$0(),localeWeek:C0()}}}function Nf(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(St.fromMillis(i).as("days"))}function L2(n,e,t){const i=[["years",(a,u)=>u.year-a.year],["quarters",(a,u)=>u.quarter-a.quarter+(u.year-a.year)*4],["months",(a,u)=>u.month-a.month+(u.year-a.year)*12],["weeks",(a,u)=>{const f=Nf(a,u);return(f-f%7)/7}],["days",Nf]],l={},s=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,l[a]=u(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function A2(n,e,t,i){let[l,s,o,r]=L2(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?St.fromMillis(a,i).shiftTo(...u).plus(f):f}const P2="missing Intl.DateTimeFormat.formatToParts support";function Ct(n,e=t=>t){return{regex:n,deser:([t])=>e(Sv(t))}}const N2=" ",B0=`[ ${N2}]`,W0=new RegExp(B0,"g");function R2(n){return n.replace(/\./g,"\\.?").replace(W0,B0)}function Rf(n){return n.replace(/\./g,"").replace(W0," ").toLowerCase()}function ri(n,e){return n===null?null:{regex:RegExp(n.map(R2).join("|")),deser:([t])=>n.findIndex(i=>Rf(t)===Rf(i))+e}}function Ff(n,e){return{regex:n,deser:([,t,i])=>Ir(t,i),groups:e}}function Oo(n){return{regex:n,deser:([e])=>e}}function F2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function q2(n,e){const t=oi(e),i=oi(e,"{2}"),l=oi(e,"{3}"),s=oi(e,"{4}"),o=oi(e,"{6}"),r=oi(e,"{1,2}"),a=oi(e,"{1,3}"),u=oi(e,"{1,6}"),f=oi(e,"{1,9}"),c=oi(e,"{2,4}"),d=oi(e,"{4,6}"),m=_=>({regex:RegExp(F2(_.val)),deser:([k])=>k,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return ri(e.eras("short"),0);case"GG":return ri(e.eras("long"),0);case"y":return Ct(u);case"yy":return Ct(c,Ua);case"yyyy":return Ct(s);case"yyyyy":return Ct(d);case"yyyyyy":return Ct(o);case"M":return Ct(r);case"MM":return Ct(i);case"MMM":return ri(e.months("short",!0),1);case"MMMM":return ri(e.months("long",!0),1);case"L":return Ct(r);case"LL":return Ct(i);case"LLL":return ri(e.months("short",!1),1);case"LLLL":return ri(e.months("long",!1),1);case"d":return Ct(r);case"dd":return Ct(i);case"o":return Ct(a);case"ooo":return Ct(l);case"HH":return Ct(i);case"H":return Ct(r);case"hh":return Ct(i);case"h":return Ct(r);case"mm":return Ct(i);case"m":return Ct(r);case"q":return Ct(r);case"qq":return Ct(i);case"s":return Ct(r);case"ss":return Ct(i);case"S":return Ct(a);case"SSS":return Ct(l);case"u":return Oo(f);case"uu":return Oo(r);case"uuu":return Ct(t);case"a":return ri(e.meridiems(),0);case"kkkk":return Ct(s);case"kk":return Ct(c,Ua);case"W":return Ct(r);case"WW":return Ct(i);case"E":case"c":return Ct(t);case"EEE":return ri(e.weekdays("short",!1),1);case"EEEE":return ri(e.weekdays("long",!1),1);case"ccc":return ri(e.weekdays("short",!0),1);case"cccc":return ri(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ff(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ff(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Oo(/[a-z_+-/]{1,256}?/i);case" ":return Oo(/[^\S\n\r]/);default:return m(_)}})(n)||{invalidReason:P2};return g.token=n,g}const H2={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function j2(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=H2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function z2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function U2(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(ns(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function V2(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return it(n.z)||(t=Hi.create(n.z)),it(n.Z)||(t||(t=new Cn(n.Z)),i=n.Z),it(n.q)||(n.M=(n.q-1)*3+1),it(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),it(n.u)||(n.S=yu(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let xr=null;function B2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function W2(n,e){if(n.literal)return n;const t=hn.macroTokenToFormatOpts(n.val),i=Z0(t,e);return i==null||i.includes(void 0)?n:i}function Y0(n,e){return Array.prototype.concat(...n.map(t=>W2(t,e)))}class K0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Y0(hn.parseFormat(t),e),this.units=this.tokens.map(i=>q2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=z2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=U2(e,this.regex,this.handlers),[l,s,o]=i?V2(i):[null,null,void 0];if(ns(i,"a")&&ns(i,"H"))throw new Jl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function J0(n,e,t){return new K0(n,t).explainFromTokens(e)}function Y2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=J0(n,e,t);return[i,l,s,o]}function Z0(n,e){if(!n)return null;const i=hn.create(e,n).dtFormatter(B2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>j2(o,n,s))}const ea="Invalid DateTime",qf=864e13;function Os(n){return new ai("unsupported zone",`the zone "${n.name}" is not supported`)}function ta(n){return n.weekData===null&&(n.weekData=pr(n.c)),n.weekData}function na(n){return n.localWeekData===null&&(n.localWeekData=pr(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function hl(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function G0(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Mo(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function xo(n,e,t){return G0(Dr(n),e,t)}function Hf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,mr(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=St.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Dr(s);let[a,u]=G0(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,u=Xe.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return Xe.invalid(new ai("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Eo(n,e,t=!0){return n.isValid?hn.create(Et.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ia(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=en(n.c.year,t?6:4),e?(i+="-",i+=en(n.c.month),i+="-",i+=en(n.c.day)):(i+=en(n.c.month),i+=en(n.c.day)),i}function jf(n,e,t,i,l,s){let o=en(n.c.hour);return e?(o+=":",o+=en(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=en(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=en(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=en(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=en(Math.trunc(-n.o/60)),o+=":",o+=en(Math.trunc(-n.o%60))):(o+="+",o+=en(Math.trunc(n.o/60)),o+=":",o+=en(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const X0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},K2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},J2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Q0=["year","month","day","hour","minute","second","millisecond"],Z2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],G2=["year","ordinal","hour","minute","second","millisecond"];function X2(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new xb(n);return e}function zf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return X2(n)}}function Q2(n){return tr[n]||(er===void 0&&(er=Jt.now()),tr[n]=n.offset(er)),tr[n]}function Uf(n,e){const t=Gi(e.zone,Jt.defaultZone);if(!t.isValid)return Xe.invalid(Os(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Jt.now();else{for(const a of Q0)it(n[a])&&(n[a]=X0[a]);const o=S0(n)||T0(n);if(o)return Xe.invalid(o);const r=Q2(t);[l,s]=xo(n,r,t)}return new Xe({ts:l,zone:t,loc:i,o:s})}function Vf(n,e,t){const i=it(t.round)?!0:t.round,l=(o,r)=>(o=vu(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function Bf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let er,tr={};class Xe{constructor(e){const t=e.zone||Jt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ai("invalid input"):null)||(t.isValid?null:Os(t));this.ts=it(e.ts)?Jt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=el(e.o)&&!e.old?e.o:t.offset(this.ts);l=Mo(this.ts,r),i=Number.isNaN(l.year)?new ai("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||Et.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Bf(arguments),[i,l,s,o,r,a,u]=t;return e.zone=Cn.utcInstance,Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Mv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Gi(t.zone,Jt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid(Os(l))}static fromMillis(e,t={}){if(el(e))return e<-qf||e>qf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(el(e))return new Xe({ts:e*1e3,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Gi(t.zone,Jt.defaultZone);if(!i.isValid)return Xe.invalid(Os(i));const l=Et.fromObject(t),s=hr(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Mf(s,l),a=Jt.now(),u=it(t.specificOffset)?i.offset(a):t.specificOffset,f=!it(s.ordinal),c=!it(s.year),d=!it(s.month)||!it(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||f)&&h)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new Jl("Can't mix ordinal dates with month/day");const g=h||s.weekday&&!m;let _,k,S=Mo(a,u);g?(_=Z2,k=K2,S=pr(S,o,r)):f?(_=G2,k=J2,S=Qr(S)):(_=Q0,k=X0);let $=!1;for(const P of _){const N=s[P];it(N)?$?s[P]=k[P]:s[P]=S[P]:$=!0}const T=g?$v(s,o,r):f?Cv(s):S0(s),O=T||T0(s);if(O)return Xe.invalid(O);const E=g?Cf(s,o,r):f?Of(s):s,[L,I]=xo(E,u,i),A=new Xe({ts:L,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==A.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${A.toISO()}`):A.isValid?A:Xe.invalid(A.invalid)}static fromISO(e,t={}){const[i,l]=g2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=b2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=k2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new pn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=Y2(o,e,t);return f?Xe.invalid(f):Vl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=C2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new pn("need to specify a reason the DateTime is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new Qy(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=Z0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return Y0(hn.parseFormat(e),Et.fromObject(t)).map(l=>l.val).join("")}static resetCache(){er=void 0,tr={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ta(this).weekYear:NaN}get weekNumber(){return this.isValid?ta(this).weekNumber:NaN}get weekday(){return this.isValid?ta(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?na(this).weekday:NaN}get localWeekNumber(){return this.isValid?na(this).weekNumber:NaN}get localWeekYear(){return this.isValid?na(this).weekYear:NaN}get ordinal(){return this.isValid?Qr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Co.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Co.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Co.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Co.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Dr(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Mo(a,o),c=Mo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[hl(this,{ts:a}),hl(this,{ts:u})]:[this]}get isInLeapYear(){return ao(this.year)}get daysInMonth(){return mr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ws(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ws(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=hn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(Cn.instance(e),t)}toLocal(){return this.setZone(Jt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Gi(e,Jt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=xo(o,s,e)}return hl(this,{ts:l,zone:e})}else return Xe.invalid(Os(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return hl(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=hr(e,zf),{minDaysInFirstWeek:i,startOfWeek:l}=Mf(t,this.loc),s=!it(t.weekYear)||!it(t.weekNumber)||!it(t.weekday),o=!it(t.ordinal),r=!it(t.year),a=!it(t.month)||!it(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new Jl("Can't mix ordinal dates with month/day");let c;s?c=Cf({...pr(this.c,i,l),...t},i,l):it(t.ordinal)?(c={...this.toObject(),...t},it(t.day)&&(c.day=Math.min(mr(c.year,c.month),c.day))):c=Of({...Qr(this.c),...t});const[d,m]=xo(c,this.o,this.zone);return hl(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return hl(this,Hf(this,t))}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e).negate();return hl(this,Hf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=St.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,u=A2(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Kt.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||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new pn("max requires all arguments be DateTimes");return Ef(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return J0(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=Et.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new K0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new pn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=Et.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new pn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?Xe.invalid(f):Vl(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return dr}static get DATE_MED(){return e0}static get DATE_MED_WITH_WEEKDAY(){return tv}static get DATE_FULL(){return t0}static get DATE_HUGE(){return n0}static get TIME_SIMPLE(){return i0}static get TIME_WITH_SECONDS(){return l0}static get TIME_WITH_SHORT_OFFSET(){return s0}static get TIME_WITH_LONG_OFFSET(){return o0}static get TIME_24_SIMPLE(){return r0}static get TIME_24_WITH_SECONDS(){return a0}static get TIME_24_WITH_SHORT_OFFSET(){return u0}static get TIME_24_WITH_LONG_OFFSET(){return f0}static get DATETIME_SHORT(){return c0}static get DATETIME_SHORT_WITH_SECONDS(){return d0}static get DATETIME_MED(){return p0}static get DATETIME_MED_WITH_SECONDS(){return m0}static get DATETIME_MED_WITH_WEEKDAY(){return nv}static get DATETIME_FULL(){return h0}static get DATETIME_FULL_WITH_SECONDS(){return _0}static get DATETIME_HUGE(){return g0}static get DATETIME_HUGE_WITH_SECONDS(){return b0}}function ys(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&el(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new pn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const x2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],ew=[".mp4",".avi",".mov",".3gp",".wmv"],tw=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],nw=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],x0=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class V{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||V.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return V.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!V.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!V.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){V.inArray(e,t)||e.push(t)}static mergeUnique(e,t){for(let i of t)V.pushUnique(e,i);return e}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=V.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!V.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!V.isObject(s)&&!Array.isArray(s)||!V.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!V.isObject(l)&&!Array.isArray(l)||!V.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):V.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||V.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||V.isObject(e)&&Object.keys(e).length>0)&&V.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return V.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),V.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",V.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Xe.fromFormat(e,i,{zone:"UTC"})}return typeof e=="number"?Xe.fromMillis(e):Xe.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);V.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!x2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!ew.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!tw.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!nw.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return V.hasImageExtension(e)?"image":V.hasDocumentExtension(e)?"document":V.hasVideoExtension(e)?"video":V.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(V.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)V.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):V.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},V.dummyCollectionSchemaData(e))}static dummyCollectionSchemaData(e,t=!1){var s;const i=(e==null?void 0:e.fields)||[],l={};for(const o of i){if(o.hidden||t&&o.primaryKey&&o.autogeneratePattern||t&&o.type==="autodate")continue;let r=null;if(o.type==="number")r=123;else if(o.type==="date"||o.type==="autodate")r="2022-01-01 10:00:00.123Z";else if(o.type=="bool")r=!0;else if(o.type=="email")r="test@example.com";else if(o.type=="url")r="https://example.com";else if(o.type=="json")r="JSON";else if(o.type=="file"){if(t)continue;r="filename.jpg",o.maxSelect!=1&&(r=[r])}else o.type=="select"?(r=(s=o==null?void 0:o.values)==null?void 0:s[0],(o==null?void 0:o.maxSelect)!=1&&(r=[r])):o.type=="relation"?(r="RELATION_RECORD_ID",(o==null?void 0:o.maxSelect)!=1&&(r=[r])):r="test";l[o.name]=r}return l}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"password":return"ri-lock-password-line";case"autodate":return"ri-calendar-check-line";default:return"ri-star-s-line"}}static getFieldValueType(e){switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&(e==null?void 0:e.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="fields"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const l=Array.isArray(e.fields)?e.fields:[],s=Array.isArray(t.fields)?t.fields:[],o=l.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=V.isObject(u)&&V.findByKey(l,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name0){const r=V.getExpandPresentableRelField(o,t,i-1);r&&(s+="."+r)}return s}return""}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],h=d.create(c,u,m);d.add(h),l(h.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=V.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=V.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(V.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?V.plainText(e):e,V.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return V.truncate(e.join(","),i);if(typeof e=="object")try{return V.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of V.extractColumnsFromQuery(e.viewQuery))V.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)V.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){let s=e.find(r=>r.name==t||r.id==t);if(!s||l>=4)return[];s.fields=s.fields||[];let o=V.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=V.getCollectionAutocompleteKeys(e,r.collectionId,a+".",l+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&["select","file","relation"].includes(r.type)&&(o.push(a+":each"),o.push(a+":length"))}for(const r of e){r.fields=r.fields||[];for(const a of r.fields)if(a.type=="relation"&&a.collectionId==s.id){const u=i+r.name+"_via_"+a.name,f=V.getCollectionAutocompleteKeys(e,r.id,u+".",l+2);f.length&&(o=o.concat(f))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];let i,l;for(const s of e)if(!s.system){i="@collection."+s.name+".",l=V.getCollectionAutocompleteKeys(e,s.name,i);for(const o of l)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.body."),i.push("@request.headers."),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName");const l=e.filter(s=>s.type==="auth");for(const s of l){if(s.system)continue;const o=V.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)V.pushUnique(i,r)}if(t){const s=V.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const o of s){i.push(o);const r=o.split(".");r.length===3&&r[2].indexOf(":")===-1&&i.push(o+":isset")}}return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!V.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const _=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");_&&t.columns.push({name:_,collate:g[2]||"",sort:((d=g[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+V.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, `),i.length>1&&(t+=` `),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=V.parseIndex(e);return i.tableName=t,V.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=V.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?V.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return V.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,hidden:!1,required:!1},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}let Va,_l;const Ba="app-tooltip";function Wf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function tl(){return _l=_l||document.querySelector("."+Ba),_l||(_l=document.createElement("div"),_l.classList.add(Ba),document.body.appendChild(_l)),_l}function ek(n,e){let t=tl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Wa();return}t.textContent=e.text,t.className=Ba+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Wa(){clearTimeout(Va),tl().classList.remove("active"),tl().activeNode=void 0}function iw(n,e){tl().activeNode=n,clearTimeout(Va),Va=setTimeout(()=>{tl().classList.add("active"),ek(n,e)},isNaN(e.delay)?0:e.delay)}function qe(n,e){let t=Wf(e);function i(){iw(n,t)}function l(){Wa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&V.isFocusable(n))&&n.addEventListener("click",l),tl(),{update(s){var o,r;t=Wf(s),(r=(o=tl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&ek(n,t)},destroy(){var s,o;(o=(s=tl())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Wa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Ar(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=lo}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Ar,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=pf(l),[m,h]=pf(s);return{delay:e,duration:t,easing:i,css:(g,_)=>` @@ -10,9 +10,9 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config opacity: ${a-f*_}`}}function mt(n,{delay:e=0,duration:t=400,easing:i=Ar,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),h=parseFloat(s[`margin${f[1]}`]),g=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*h}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*_}px;`}}function $t(n,{delay:e=0,duration:t=400,easing:i=Ar,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} - `}}const lw=n=>({}),Yf=n=>({}),sw=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[4]&&!n[2]&&Zf(n);const T=n[19].header,M=Lt(T,n,n[18],Kf);let E=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=Lt(L,n,n[18],null),A=n[19].footer,P=Lt(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),$&&$.c(),r=C(),M&&M.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),ee(s,"popup",n[2]),p(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(N,R){v(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),$&&$.m(o,null),w(o,r),M&&M.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),_=!0,k||(S=[W(t,"click",nt(n[20])),W(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&O($,1)):($=Zf(n),$.c(),O($,1),$.m(o,r)):$&&(re(),D($,1,1,()=>{$=null}),ae()),M&&M.p&&(!_||R[0]&262144)&&Pt(M,T,n,n[18],_?At(T,n[18],R,sw):Nt(n[18]),Kf),n[4]&&n[2]?E?E.p(n,R):(E=Gf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],R,null):Nt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],R,lw):Nt(n[18]),Yf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&ee(s,"popup",n[2]),(!_||R[0]&4)&&ee(e,"padded",n[2]),(!_||R[0]&1)&&ee(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),O($),O(M,N),O(I,N),O(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=Qb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D($),D(M,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=_u(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),_=!1},d(N){N&&y(e),N&&i&&i.end(),$&&$.d(),M&&M.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),k=!1,Ie(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",nt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ys,{duration:Zi},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[5])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ow(n){let e,t,i,l,s=n[0]&&Jf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){v(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[W(window,"resize",n[10]),W(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&O(s,1)):(s=Jf(o),s.c(),O(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(O(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let gl,la=[];function tk(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Zi=150;function Xf(){return 1e3+tk().querySelectorAll(".overlay-panel-container.active").length}function rw(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=kt(),h="op_"+V.randomString(10);let g,_,k,S,$="",T=o;function M(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await dn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){V.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){V.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!V.isInput(G.target)&&g&&g.style.zIndex==Xf()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,pe){pe&&t(8,$=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Xt(()=>{tk().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const U=()=>a?E():!0;function J(G){ie[G?"unshift":"push"](()=>{_=G,t(7,_)})}const Y=G=>F(G.target);function Z(G){ie[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,s=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,l=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,E,g,_,$,R,z,F,f,c,d,M,L,T,l,i,U,J,Y,Z]}class Qt extends Se{constructor(e){super(),we(this,e,rw,ow,ke,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}const Bl=[];function nk(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(ke(n,r)&&(n=r,t)){const a=!Bl.length;for(const u of i)u[1](),Bl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function ik(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return nk(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);s?o(h):c=It(h)?h:te},m=l.map((h,g)=>cu(h,_=>{u[g]=_,f&=~(1<{f|=1<t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){ie[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await dn(),t(3,o=!1),lk()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class dw extends Se{constructor(e){super(),we(this,e,cw,fw,ke,{})}}function pw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Hy(e,"visibility","hidden")},m(t,i){v(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[15](null)}}}function mw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){v(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[14](null)}}}function hw(n){let e;function t(s,o){return s[1]?mw:pw}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){v(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:te,o:te,d(s){s&&y(e),l.d(),n[16](null)}}}function _w(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let gw=_w();function sa(){return window&&window.tinymce?window.tinymce:null}function bw(n,e,t){let{id:i="tinymce_svelte"+V.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,k=u,S=s;const $=kt();function T(){const I={...r,target:g,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}Xt(()=>(sa()!==null?T():gw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function M(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function L(I){ie[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,u=I.value),"text"in I&&t(6,f=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,g,u,f,s,o,r,a,_,k,S,M,E,L]}class Cu extends Se{constructor(e){super(),we(this,e,bw,hw,ke,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function kw(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Ar}=i;return{delay:f,duration:It(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${g}px, ${_}px) scale(${k}, ${S});`}}}const Pr=Hn([]);function Ks(n,e=4e3){return Nr(n,"info",e)}function nn(n,e=3e3){return Nr(n,"success",e)}function Ci(n,e=4500){return Nr(n,"error",e)}function yw(n,e=4500){return Nr(n,"warning",e)}function Nr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{sk(i)},t)};Pr.update(l=>(Ou(l,i.message),V.pushOrReplaceByKey(l,i,"message"),l))}function sk(n){Pr.update(e=>(Ou(e,n),e))}function Ls(){Pr.update(n=>{for(let e of n)Ou(n,e);return[]})}function Ou(n,e){let t;typeof e=="string"?t=V.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),V.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function vw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function ww(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Sw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,k;function S(E,L){return E[2].type==="info"?Tw:E[2].type==="success"?Sw:E[2].type==="warning"?ww:vw}let $=S(e),T=$(e);function M(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=C(),s=b("div"),r=B(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),ee(t,"alert-info",e[2].type=="info"),ee(t,"alert-success",e[2].type=="success"),ee(t,"alert-danger",e[2].type=="error"),ee(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){v(E,t,L),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(k=W(u,"click",nt(M)),_=!0)},p(E,L){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!g||L&1)&&ee(t,"alert-info",e[2].type=="info"),(!g||L&1)&&ee(t,"alert-success",e[2].type=="success"),(!g||L&1)&&ee(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&ee(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){By(t),h(),Zb(t,m)},a(){h(),h=Vy(t,m,kw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=Qb(t,mt,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=_u(t,Ys,{duration:150})),g=!1},d(E){E&&y(t),T.d(),E&&d&&d.end(),_=!1,k()}}}function $w(n){let e,t=[],i=new Map,l,s=de(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>sk(s)]}class Ow extends Se{constructor(e){super(),we(this,e,Cw,$w,ke,{})}}function ec(n){let e,t,i;const l=n[18].default,s=Lt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),ee(e,"active",n[0])},m(o,r){v(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Pt(s,l,o,o[17],i?At(l,o[17],r,null):Nt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&ee(e,"active",o[0])},i(o){i||(O(s,o),o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,qn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function Mw(n){let e,t,i,l,s=n[0]&&ec(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){v(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[W(window,"click",n[7]),W(window,"mousedown",n[6]),W(window,"keydown",n[5]),W(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&O(s,1)):(s=ec(o),s.c(),O(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(O(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function Ew(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,g,_=!1;const k=kt();function S(G=0){o&&(clearTimeout(g),g=setTimeout($,G))}function $(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function T(){clearTimeout(g),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function M(){o?$():T()}function E(G){return!c||G.classList.contains(u)||c.contains(G)&&G.closest&&G.closest("."+u)}function L(G){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=G||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(G){G.stopPropagation(),E(G.target)&&$()}function P(G){(G.code==="Enter"||G.code==="Space")&&(G.stopPropagation(),E(G.target)&&S(150))}function N(G){G.preventDefault(),G.stopPropagation(),M()}function R(G){(G.code==="Enter"||G.code==="Space")&&(G.preventDefault(),G.stopPropagation(),M())}function z(G){o&&!(m!=null&&m.contains(G.target))&&!(c!=null&&c.contains(G.target))&&M()}function F(G){o&&r&&G.code==="Escape"&&(G.preventDefault(),$())}function U(G){o&&(_=!(c!=null&&c.contains(G.target)))}function J(G){var pe;o&&_&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((pe=G.target)!=null&&pe.closest(".flatpickr-calendar"))&&$()}Xt(()=>(L(),()=>I()));function Y(G){ie[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ie[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,s=G.trigger),"active"in G&&t(0,o=G.active),"escClose"in G&&t(9,r=G.escClose),"autoScroll"in G&&t(10,a=G.autoScroll),"closableClass"in G&&t(11,u=G.closableClass),"class"in G&&t(1,f=G.class),"$$scope"in G&&t(17,l=G.$$scope)},n.$$.update=()=>{var G,pe;n.$$.dirty[0]&260&&c&&L(s),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((pe=m==null?void 0:m.classList)==null||pe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,U,J,s,r,a,u,S,$,T,M,m,l,i,Y,Z]}class jn extends Se{constructor(e){super(),we(this,e,Ew,Mw,ke,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}const un=Hn(""),_r=Hn(""),Dl=Hn(!1),yn=Hn({});function Ut(n){yn.set(n||{})}function Yn(n){yn.update(e=>(V.deleteByPath(e,n),e))}const Rr=Hn({});function tc(n){Rr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Dw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||Iw;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}ok=typeof atob!="function"||Aw?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const ic="pb_auth";class Mu{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Fr(this.token)}get isSuperuser(){var t,i;let e=xl(this.token);return e.type=="auth"&&(((t=this.record)==null?void 0:t.collectionName)=="_superusers"||!((i=this.record)!=null&&i.collectionName)&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),xl(this.token).type=="auth"&&!this.isSuperuser}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ic){const i=Dw(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.record||l.model||null)}exportToCookie(e,t=ic){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=xl(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=nc(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.record&&r>4096){s.record={id:(a=s.record)==null?void 0:a.id,email:(u=s.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(s.record[c]=this.record[c]);o=nc(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.record)}}class rk extends Mu{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class Pw extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Nw=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Eu(n){if(n){n.query=n.query||{};for(let e in n)Nw.includes(e)||(n.query[e]=n[e],delete n[e])}}function ak(n){const e=[];for(const t in n){if(n[t]===null)continue;const i=n[t],l=encodeURIComponent(t);if(Array.isArray(i))for(const s of i)e.push(l+"="+encodeURIComponent(s));else i instanceof Date?e.push(l+"="+encodeURIComponent(i.toISOString())):typeof i!==null&&typeof i=="object"?e.push(l+"="+encodeURIComponent(JSON.stringify(i))):e.push(l+"="+encodeURIComponent(i))}return e.join("&")}class uk extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Eu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class fk extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Rw extends fk{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;if(((s=this.client.authStore.record)==null?void 0:s.id)===(l==null?void 0:l.id)&&(((o=this.client.authStore.record)==null?void 0:o.collectionId)===this.collectionIdOrName||((r=this.client.authStore.record)==null?void 0:r.collectionName)===this.collectionIdOrName)){let a=Object.assign({},this.client.authStore.record.expand),u=Object.assign({},this.client.authStore.record,l);a&&(u.expand=Object.assign(a,l.expand)),this.client.authStore.save(this.client.authStore.token,u)}return l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.record)==null?void 0:l.id)!==e||((s=this.client.authStore.record)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.record)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,i){let l;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(l=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||oa(this.client));let s=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return s=this.authResponse(s),l&&this.isSuperusers&&function(r,a,u,f){oa(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((h,g)=>{(!h||(g==null?void 0:g.id)!=(d==null?void 0:d.id)||(g!=null&&g.collectionId||d!=null&&d.collectionId)&&(g==null?void 0:g.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var $;const _=r.authStore.token;if(($=g.query)!=null&&$.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let k=r.authStore.isValid;if(k&&Fr(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&_==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return g.headers=S,c?c(h,g):{url:h,sendOptions:g}}}(this.client,l,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),s}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:l,createData:s}};return a=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const l=new uk(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var g;try{await l.subscribe("@oauth2",async $=>{var M;const T=l.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(M=c==null?void 0:c.signal)!=null&&M.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new Fn(E))}s()});const _={state:l.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function($){i?i.location.href=$:i=lc($)})(k)}catch(_){s(),h(new Fn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new co(this.client.baseURL,new Mu,this.client.lang),s=await l.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return l.authStore.save(s==null?void 0:s.token,this.decode((s==null?void 0:s.record)||{})),l}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class Fw extends fk{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}}class qw extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class Hw extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class jw extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class zw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Ya(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function sc(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function oc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(Ya(i))return!0}return!1}class Uw extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Vw(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l0&&s.length==l.length){e.files[i]=e.files[i]||[];for(let r of s)e.files[i].push(r)}else if(e.json[i]=o,s.length>0){let r=i;i.startsWith("+")||i.endsWith("+")||(r+="+"),e.files[r]=e.files[r]||[];for(let a of s)e.files[r].push(a)}}else e.json[i]=l}}}class co{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Mu:this.authStore=new rk,this.collections=new Fw(this),this.files=new jw(this),this.logs=new qw(this),this.settings=new Pw(this),this.realtime=new uk(this),this.health=new Hw(this),this.backups=new zw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Uw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Rw(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,i)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){var i;let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildURL(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=ak(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||sc(l)||!oc(l))return l;const s=new FormData;for(const o in l){const r=l[o];if(typeof r!="object"||oc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)s.append(o,u)}else{let a={};a[o]=r,s.append("@jsonPayload",JSON.stringify(a))}}return s}(t.body),Eu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||sc(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const Mn=Hn([]),ti=Hn({}),Js=Hn(!1),ck=Hn({}),Du=Hn({});let As;typeof BroadcastChannel<"u"&&(As=new BroadcastChannel("collections"),As.onmessage=()=>{var n;Iu((n=Vb(ti))==null?void 0:n.id)});function dk(){As==null||As.postMessage("reload")}function Bw(n){Mn.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),e})}function Ww(n){ti.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Mn.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Lu(),dk(),V.sortCollections(e)))}function Yw(n){Mn.update(e=>(V.removeByKey(e,"id",n.id),ti.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Lu(),dk(),e))}async function Iu(n=null){Js.set(!0);try{let e=await _e.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),Mn.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),Lu(),Du.set(await _e.collections.getScaffolds())}catch(e){_e.error(e)}Js.set(!1)}function Lu(){ck.update(n=>(Mn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(l=>l.type=="file"&&l.protected));return e}),n))}function pk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function Kw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),O(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Jw(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),O(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Zw(n){let e,t,i,l;const s=[Jw,Kw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function rc(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qr=nk(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ik(qr,n=>n.location);const Au=ik(qr,n=>n.querystring),ac=Hn(void 0);async function is(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await dn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function Bn(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function Gw(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uc(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||Xw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Xw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Qw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(M,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=pk(M);this.path=M,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(M){if(l){if(typeof l=="string")if(M.startsWith(l))M=M.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=M.match(l);if(A&&A[0])M=M.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(M);if(E===null)return null;if(this._keys===!1)return E;const L={};let I=0;for(;I{r.push(new o(M,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=kt();async function d(T,M){await dn(),c(T,M)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Wy(()=>{Gw(m)}));let g=null,_=null;const k=qr.subscribe(async T=>{g=T;let M=0;for(;M{ac.set(u)});return}t(0,a=null),_=null,ac.set(void 0)});oo(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class xw extends Se{constructor(e){super(),we(this,e,Qw,Zw,ke,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";co.prototype.logout=function(n=!0){this.authStore.clear(),n&&is("/login")};co.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&Ci(s),V.isEmpty(l.data)||Ut(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),is("/")};co.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Vb(ck);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Fr(t,10))&&(t&&localStorage.removeItem(ra),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(ra,t),this._superuserFileTokenRequest=null),t};class e3 extends rk{constructor(e="__pb_superuser_auth__"){super(e),this.save(this.token,this.record)}save(e,t){super.save(e,t),(t==null?void 0:t.collectionName)=="_superusers"&&tc(t)}clear(){super.clear(),tc(null)}}const _e=new co("../",new e3);_e.authStore.isValid&&_e.collection(_e.authStore.record.collectionName).authRefresh().catch(n=>{console.warn("Failed to refresh the existing auth token:",n);const e=(n==null?void 0:n.status)<<0;(e==401||e==403)&&_e.authStore.clear()});const nr=[];let mk;function hk(n){const e=n.pattern.test(mk);cc(n,n.className,e),cc(n,n.inactiveClassName,!e)}function cc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qr.subscribe(n=>{mk=n.location+(n.querystring?"?"+n.querystring:""),nr.map(hk)});function qi(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?pk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),hk(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const t3="modulepreload",n3=function(n,e){return new URL(n,e).href},dc={},Tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(u=>{if(u=n3(u,i),u in dc)return;dc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const g=o[h];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":t3,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function i3(n){e();function e(){_e.authStore.isValid?is("/collections"):_e.logout()}return[]}class l3 extends Se{constructor(e){super(),we(this,e,i3,null,ke,{})}}function pc(n,e,t){const i=n.slice();return i[12]=e[t],i}const s3=n=>({}),mc=n=>({uniqueId:n[4]});function o3(n){let e,t,i=de(n[3]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o({}),Yf=n=>({}),sw=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[4]&&!n[2]&&Zf(n);const T=n[19].header,O=Lt(T,n,n[18],Kf);let E=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=Lt(L,n,n[18],null),A=n[19].footer,P=Lt(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),ee(s,"popup",n[2]),p(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(N,R){v(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),$&&$.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),_=!0,k||(S=[W(t,"click",nt(n[20])),W(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=Zf(n),$.c(),M($,1),$.m(o,r)):$&&(re(),D($,1,1,()=>{$=null}),ae()),O&&O.p&&(!_||R[0]&262144)&&Pt(O,T,n,n[18],_?At(T,n[18],R,sw):Nt(n[18]),Kf),n[4]&&n[2]?E?E.p(n,R):(E=Gf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],R,null):Nt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],R,lw):Nt(n[18]),Yf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&ee(s,"popup",n[2]),(!_||R[0]&4)&&ee(e,"padded",n[2]),(!_||R[0]&1)&&ee(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),M($),M(O,N),M(I,N),M(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=Qb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=_u(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),_=!1},d(N){N&&y(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),k=!1,Ie(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",nt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ys,{duration:Zi},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[5])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ow(n){let e,t,i,l,s=n[0]&&Jf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){v(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[W(window,"resize",n[10]),W(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Jf(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let gl,la=[];function tk(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Zi=150;function Xf(){return 1e3+tk().querySelectorAll(".overlay-panel-container.active").length}function rw(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=kt(),h="op_"+V.randomString(10);let g,_,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await dn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){V.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){V.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!V.isInput(G.target)&&g&&g.style.zIndex==Xf()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,pe){pe&&t(8,$=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Xt(()=>{tk().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const U=()=>a?E():!0;function J(G){ie[G?"unshift":"push"](()=>{_=G,t(7,_)})}const Y=G=>F(G.target);function Z(G){ie[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,s=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,l=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,E,g,_,$,R,z,F,f,c,d,O,L,T,l,i,U,J,Y,Z]}class Qt extends Se{constructor(e){super(),we(this,e,rw,ow,ke,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}const Bl=[];function nk(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(ke(n,r)&&(n=r,t)){const a=!Bl.length;for(const u of i)u[1](),Bl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function ik(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return nk(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);s?o(h):c=It(h)?h:te},m=l.map((h,g)=>cu(h,_=>{u[g]=_,f&=~(1<{f|=1<t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){ie[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await dn(),t(3,o=!1),lk()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class dw extends Se{constructor(e){super(),we(this,e,cw,fw,ke,{})}}function pw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Hy(e,"visibility","hidden")},m(t,i){v(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[15](null)}}}function mw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){v(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[14](null)}}}function hw(n){let e;function t(s,o){return s[1]?mw:pw}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){v(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:te,o:te,d(s){s&&y(e),l.d(),n[16](null)}}}function _w(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let gw=_w();function sa(){return window&&window.tinymce?window.tinymce:null}function bw(n,e,t){let{id:i="tinymce_svelte"+V.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,k=u,S=s;const $=kt();function T(){const I={...r,target:g,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}Xt(()=>(sa()!==null?T():gw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function O(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function L(I){ie[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,u=I.value),"text"in I&&t(6,f=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,g,u,f,s,o,r,a,_,k,S,O,E,L]}class Cu extends Se{constructor(e){super(),we(this,e,bw,hw,ke,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function kw(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Ar}=i;return{delay:f,duration:It(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${g}px, ${_}px) scale(${k}, ${S});`}}}const Pr=Hn([]);function Ks(n,e=4e3){return Nr(n,"info",e)}function nn(n,e=3e3){return Nr(n,"success",e)}function Ci(n,e=4500){return Nr(n,"error",e)}function yw(n,e=4500){return Nr(n,"warning",e)}function Nr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{sk(i)},t)};Pr.update(l=>(Ou(l,i.message),V.pushOrReplaceByKey(l,i,"message"),l))}function sk(n){Pr.update(e=>(Ou(e,n),e))}function Ls(){Pr.update(n=>{for(let e of n)Ou(n,e);return[]})}function Ou(n,e){let t;typeof e=="string"?t=V.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),V.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function vw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function ww(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Sw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,k;function S(E,L){return E[2].type==="info"?Tw:E[2].type==="success"?Sw:E[2].type==="warning"?ww:vw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=C(),s=b("div"),r=B(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),ee(t,"alert-info",e[2].type=="info"),ee(t,"alert-success",e[2].type=="success"),ee(t,"alert-danger",e[2].type=="error"),ee(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){v(E,t,L),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(k=W(u,"click",nt(O)),_=!0)},p(E,L){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!g||L&1)&&ee(t,"alert-info",e[2].type=="info"),(!g||L&1)&&ee(t,"alert-success",e[2].type=="success"),(!g||L&1)&&ee(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&ee(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){By(t),h(),Zb(t,m)},a(){h(),h=Vy(t,m,kw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=Qb(t,mt,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=_u(t,Ys,{duration:150})),g=!1},d(E){E&&y(t),T.d(),E&&d&&d.end(),_=!1,k()}}}function $w(n){let e,t=[],i=new Map,l,s=de(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>sk(s)]}class Ow extends Se{constructor(e){super(),we(this,e,Cw,$w,ke,{})}}function ec(n){let e,t,i;const l=n[18].default,s=Lt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),ee(e,"active",n[0])},m(o,r){v(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Pt(s,l,o,o[17],i?At(l,o[17],r,null):Nt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&ee(e,"active",o[0])},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,qn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function Mw(n){let e,t,i,l,s=n[0]&&ec(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){v(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[W(window,"click",n[7]),W(window,"mousedown",n[6]),W(window,"keydown",n[5]),W(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=ec(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function Ew(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,g,_=!1;const k=kt();function S(G=0){o&&(clearTimeout(g),g=setTimeout($,G))}function $(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function T(){clearTimeout(g),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function O(){o?$():T()}function E(G){return!c||G.classList.contains(u)||c.contains(G)&&G.closest&&G.closest("."+u)}function L(G){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=G||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(G){G.stopPropagation(),E(G.target)&&$()}function P(G){(G.code==="Enter"||G.code==="Space")&&(G.stopPropagation(),E(G.target)&&S(150))}function N(G){G.preventDefault(),G.stopPropagation(),O()}function R(G){(G.code==="Enter"||G.code==="Space")&&(G.preventDefault(),G.stopPropagation(),O())}function z(G){o&&!(m!=null&&m.contains(G.target))&&!(c!=null&&c.contains(G.target))&&O()}function F(G){o&&r&&G.code==="Escape"&&(G.preventDefault(),$())}function U(G){o&&(_=!(c!=null&&c.contains(G.target)))}function J(G){var pe;o&&_&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((pe=G.target)!=null&&pe.closest(".flatpickr-calendar"))&&$()}Xt(()=>(L(),()=>I()));function Y(G){ie[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ie[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,s=G.trigger),"active"in G&&t(0,o=G.active),"escClose"in G&&t(9,r=G.escClose),"autoScroll"in G&&t(10,a=G.autoScroll),"closableClass"in G&&t(11,u=G.closableClass),"class"in G&&t(1,f=G.class),"$$scope"in G&&t(17,l=G.$$scope)},n.$$.update=()=>{var G,pe;n.$$.dirty[0]&260&&c&&L(s),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((pe=m==null?void 0:m.classList)==null||pe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,U,J,s,r,a,u,S,$,T,O,m,l,i,Y,Z]}class jn extends Se{constructor(e){super(),we(this,e,Ew,Mw,ke,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}const un=Hn(""),_r=Hn(""),Dl=Hn(!1),yn=Hn({});function Ut(n){yn.set(n||{})}function Yn(n){yn.update(e=>(V.deleteByPath(e,n),e))}const Rr=Hn({});function tc(n){Rr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Dw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||Iw;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}ok=typeof atob!="function"||Aw?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const ic="pb_auth";class Mu{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Fr(this.token)}get isSuperuser(){var t,i;let e=xl(this.token);return e.type=="auth"&&(((t=this.record)==null?void 0:t.collectionName)=="_superusers"||!((i=this.record)!=null&&i.collectionName)&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),xl(this.token).type=="auth"&&!this.isSuperuser}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ic){const i=Dw(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.record||l.model||null)}exportToCookie(e,t=ic){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=xl(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=nc(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.record&&r>4096){s.record={id:(a=s.record)==null?void 0:a.id,email:(u=s.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(s.record[c]=this.record[c]);o=nc(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.record)}}class rk extends Mu{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class Pw extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Nw=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Eu(n){if(n){n.query=n.query||{};for(let e in n)Nw.includes(e)||(n.query[e]=n[e],delete n[e])}}function ak(n){const e=[];for(const t in n){if(n[t]===null)continue;const i=n[t],l=encodeURIComponent(t);if(Array.isArray(i))for(const s of i)e.push(l+"="+encodeURIComponent(s));else i instanceof Date?e.push(l+"="+encodeURIComponent(i.toISOString())):typeof i!==null&&typeof i=="object"?e.push(l+"="+encodeURIComponent(JSON.stringify(i))):e.push(l+"="+encodeURIComponent(i))}return e.join("&")}class uk extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Eu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class fk extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Rw extends fk{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;if(((s=this.client.authStore.record)==null?void 0:s.id)===(l==null?void 0:l.id)&&(((o=this.client.authStore.record)==null?void 0:o.collectionId)===this.collectionIdOrName||((r=this.client.authStore.record)==null?void 0:r.collectionName)===this.collectionIdOrName)){let a=Object.assign({},this.client.authStore.record.expand),u=Object.assign({},this.client.authStore.record,l);a&&(u.expand=Object.assign(a,l.expand)),this.client.authStore.save(this.client.authStore.token,u)}return l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.record)==null?void 0:l.id)!==e||((s=this.client.authStore.record)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.record)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,i){let l;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(l=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||oa(this.client));let s=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return s=this.authResponse(s),l&&this.isSuperusers&&function(r,a,u,f){oa(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((h,g)=>{(!h||(g==null?void 0:g.id)!=(d==null?void 0:d.id)||(g!=null&&g.collectionId||d!=null&&d.collectionId)&&(g==null?void 0:g.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var $;const _=r.authStore.token;if(($=g.query)!=null&&$.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let k=r.authStore.isValid;if(k&&Fr(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&_==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return g.headers=S,c?c(h,g):{url:h,sendOptions:g}}}(this.client,l,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),s}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:l,createData:s}};return a=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const l=new uk(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var g;try{await l.subscribe("@oauth2",async $=>{var O;const T=l.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new Fn(E))}s()});const _={state:l.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function($){i?i.location.href=$:i=lc($)})(k)}catch(_){s(),h(new Fn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new co(this.client.baseURL,new Mu,this.client.lang),s=await l.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return l.authStore.save(s==null?void 0:s.token,this.decode((s==null?void 0:s.record)||{})),l}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class Fw extends fk{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}}class qw extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class Hw extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class jw extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class zw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Ya(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function sc(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function oc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(Ya(i))return!0}return!1}class Uw extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Vw(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l0&&s.length==l.length){e.files[i]=e.files[i]||[];for(let r of s)e.files[i].push(r)}else if(e.json[i]=o,s.length>0){let r=i;i.startsWith("+")||i.endsWith("+")||(r+="+"),e.files[r]=e.files[r]||[];for(let a of s)e.files[r].push(a)}}else e.json[i]=l}}}class co{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Mu:this.authStore=new rk,this.collections=new Fw(this),this.files=new jw(this),this.logs=new qw(this),this.settings=new Pw(this),this.realtime=new uk(this),this.health=new Hw(this),this.backups=new zw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Uw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Rw(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,i)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){var i;let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildURL(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=ak(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||sc(l)||!oc(l))return l;const s=new FormData;for(const o in l){const r=l[o];if(typeof r!="object"||oc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)s.append(o,u)}else{let a={};a[o]=r,s.append("@jsonPayload",JSON.stringify(a))}}return s}(t.body),Eu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||sc(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const Mn=Hn([]),ti=Hn({}),Js=Hn(!1),ck=Hn({}),Du=Hn({});let As;typeof BroadcastChannel<"u"&&(As=new BroadcastChannel("collections"),As.onmessage=()=>{var n;Iu((n=Vb(ti))==null?void 0:n.id)});function dk(){As==null||As.postMessage("reload")}function Bw(n){Mn.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),e})}function Ww(n){ti.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Mn.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Lu(),dk(),V.sortCollections(e)))}function Yw(n){Mn.update(e=>(V.removeByKey(e,"id",n.id),ti.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Lu(),dk(),e))}async function Iu(n=null){Js.set(!0);try{let e=await _e.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),Mn.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),Lu(),Du.set(await _e.collections.getScaffolds())}catch(e){_e.error(e)}Js.set(!1)}function Lu(){ck.update(n=>(Mn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(l=>l.type=="file"&&l.protected));return e}),n))}function pk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function Kw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Jw(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Zw(n){let e,t,i,l;const s=[Jw,Kw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function rc(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qr=nk(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ik(qr,n=>n.location);const Au=ik(qr,n=>n.querystring),ac=Hn(void 0);async function is(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await dn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function Bn(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function Gw(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uc(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||Xw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Xw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Qw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(O,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=pk(O);this.path=O,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(O){if(l){if(typeof l=="string")if(O.startsWith(l))O=O.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=O.match(l);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(O);if(E===null)return null;if(this._keys===!1)return E;const L={};let I=0;for(;I{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=kt();async function d(T,O){await dn(),c(T,O)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Wy(()=>{Gw(m)}));let g=null,_=null;const k=qr.subscribe(async T=>{g=T;let O=0;for(;O{ac.set(u)});return}t(0,a=null),_=null,ac.set(void 0)});oo(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class xw extends Se{constructor(e){super(),we(this,e,Qw,Zw,ke,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";co.prototype.logout=function(n=!0){this.authStore.clear(),n&&is("/login")};co.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&Ci(s),V.isEmpty(l.data)||Ut(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),is("/")};co.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Vb(ck);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Fr(t,10))&&(t&&localStorage.removeItem(ra),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(ra,t),this._superuserFileTokenRequest=null),t};class e3 extends rk{constructor(e="__pb_superuser_auth__"){super(e),this.save(this.token,this.record)}save(e,t){super.save(e,t),(t==null?void 0:t.collectionName)=="_superusers"&&tc(t)}clear(){super.clear(),tc(null)}}const _e=new co("../",new e3);_e.authStore.isValid&&_e.collection(_e.authStore.record.collectionName).authRefresh().catch(n=>{console.warn("Failed to refresh the existing auth token:",n);const e=(n==null?void 0:n.status)<<0;(e==401||e==403)&&_e.authStore.clear()});const nr=[];let mk;function hk(n){const e=n.pattern.test(mk);cc(n,n.className,e),cc(n,n.inactiveClassName,!e)}function cc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qr.subscribe(n=>{mk=n.location+(n.querystring?"?"+n.querystring:""),nr.map(hk)});function qi(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?pk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),hk(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const t3="modulepreload",n3=function(n,e){return new URL(n,e).href},dc={},Tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(u=>{if(u=n3(u,i),u in dc)return;dc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const g=o[h];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":t3,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function i3(n){e();function e(){_e.authStore.isValid?is("/collections"):_e.logout()}return[]}class l3 extends Se{constructor(e){super(),we(this,e,i3,null,ke,{})}}function pc(n,e,t){const i=n.slice();return i[12]=e[t],i}const s3=n=>({}),mc=n=>({uniqueId:n[4]});function o3(n){let e,t,i=de(n[3]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=He(t,$t,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=He(t,$t,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&y(e),a&&l&&l.end(),o=!1,r()}}}function hc(n){let e,t,i=gr(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=B(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){v(a,e,u),w(e,t),w(t,l),w(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=gr(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=He(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&y(e),a&&o&&o.end()}}}function a3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],mc),f=[r3,o3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),l.c(),p(e,"class",n[1]),ee(e,"error",n[3].length)},m(m,h){v(m,e,h),u&&u.m(e,null),w(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=W(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&Pt(u,a,m,m[8],s?At(a,m[8],h,s3):Nt(m[8]),mc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),O(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&ee(e,"error",m[3].length)},i(m){s||(O(u,m),O(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&y(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const _c="Invalid value";function gr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||_c:n||_c}function u3(n,e,t){let i;Qe(n,yn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Yn(r)}Xt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Pe.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends Se{constructor(e){super(),we(this,e,u3,a3,ke,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const f3=n=>({}),gc=n=>({});function bc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.5",p(e,"href","https://pocketbase.io/docs/"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),v(r,s,a),w(s,o)},d(r){r&&(y(e),y(t),y(i),y(l),y(s))}}}function c3(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=Lt(a,n,n[3],null),f=n[4].footer,c=Lt(f,n,n[3],gc);let d=((m=n[2])==null?void 0:m.id)&&bc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),l=b("footer"),c&&c.c(),s=C(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),ee(e,"center-content",n[0])},m(h,g){v(h,e,g),w(e,t),u&&u.m(t,null),w(e,i),w(e,l),c&&c.m(l,null),w(l,s),d&&d.m(l,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?At(a,h[3],g,null):Nt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?At(f,h[3],g,f3):Nt(h[3]),gc),(_=h[2])!=null&&_.id?d||(d=bc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&ee(e,"center-content",h[0])},i(h){r||(O(u,h),O(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&y(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function d3(n,e,t){let i;Qe(n,Rr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class pi extends Se{constructor(e){super(),we(this,e,d3,c3,ke,{center:0,class:1})}}function p3(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){v(s,e,o),n[13](e),he(e,n[7]),i||(l=W(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]&&he(e,s[7])},i:te,o:te,d(s){s&&y(e),n[13](null),i=!1,l()}}}function m3(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={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&&(f.value=a[7]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),O(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function kc(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){v(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&y(e),l&&t&&t.end()}}}function yc(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){v(o,e,r),i=!0,l||(s=W(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function h3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[m3,p3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}s=h(n),o=m[s]=d[s](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&kc(),_=(n[0].length||n[7].length)&&yc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=C(),o.c(),r=C(),g&&g.c(),a=C(),_&&_.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(k,S){v(k,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),g&&g.m(e,null),w(e,a),_&&_.m(e,null),u=!0,f||(c=[W(e,"click",On(n[11])),W(e,"submit",nt(n[10]))],f=!0)},p(k,[S]){let $=s;s=h(k),s===$?m[s].p(k,S):(re(),D(m[$],1,1,()=>{m[$]=null}),ae(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),O(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?S&129&&O(g,1):(g=kc(),g.c(),O(g,1),g.m(e,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&O(_,1)):(_=yc(k),_.c(),O(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(k){u||(O(o),O(g),O(_),u=!0)},o(k){D(o),D(g),D(_),u=!1},d(k){k&&y(e),m[s].d(),g&&g.d(),_&&_.d(),f=!1,Ie(c)}}}function _3(n,e,t){const i=kt(),l="search_"+V.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function g(){u||f||(t(5,f=!0),t(4,u=(await Tt(async()=>{const{default:M}=await import("./FilterAutocompleteInput-RpihTcvl.js");return{default:M}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Xt(()=>{g()});function _(M){Pe.call(this,n,M)}function k(M){d=M,t(7,d),t(0,s)}function S(M){ie[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=M=>{"value"in M&&t(0,s=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,_,k,S,$,T]}class Hr extends Se{constructor(e){super(),we(this,e,_3,h3,ke,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function g3(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){v(r,e,a),w(e,t),s||(o=[Oe(l=qe.call(null,e,n[0])),W(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&&It(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&ee(e,"refreshing",r[2])},i:te,o:te,d(r){r&&y(e),s=!1,Ie(o)}}}function b3(n,e,t){const i=kt();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 Xt(()=>()=>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 Pu extends Se{constructor(e){super(),we(this,e,b3,g3,ke,{tooltip:0,class:1})}}const k3=n=>({}),vc=n=>({}),y3=n=>({}),wc=n=>({});function v3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],wc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(m,n,n[10],vc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),s=C(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,_){v(g,e,_),f&&f.m(e,null),w(e,t),w(e,i),d&&d.m(i,null),n[12](i),w(e,s),h&&h.m(e,null),o=!0,r||(a=[W(window,"resize",n[1]),W(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,y3):Nt(g[10]),wc),d&&d.p&&(!o||_&1024)&&Pt(d,c,g,g[10],o?At(c,g[10],_,null):Nt(g[10]),null),(!o||_&9&&l!==(l="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||_&1024)&&Pt(h,m,g,g[10],o?At(m,g[10],_,k3):Nt(g[10]),vc)},i(g){o||(O(f,g),O(d,g),O(h,g),o=!0)},o(g){D(f,g),D(d,g),D(h,g),o=!1},d(g){g&&y(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,Ie(a)}}}function w3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-g,h=f.scrollHeight-_,h>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function M(){d||(d=setTimeout(()=>{T(),d=null},150))}Xt(()=>(M(),k=new MutationObserver(M),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(L){ie[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,l=L.$$scope)},[o,M,f,c,r,a,u,S,$,T,l,i,E]}class Nu extends Se{constructor(e){super(),we(this,e,w3,v3,ke,{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 S3(n){let e,t,i,l,s;const o=n[6].default,r=Lt(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,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"click",n[7]),W(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Pt(r,o,a,a[5],i?At(o,a[5],u,null):Nt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&ee(e,"col-sort-disabled",a[3]),(!i||u&7)&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&ee(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(O(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function T3(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};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,u,l,i,f,c]}class ir extends Se{constructor(e){super(),we(this,e,T3,S3,ke,{class:1,name:2,sort:0,disable:3})}}function $3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Oe(qe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:te,o:te,d(o){o&&y(e),l=!1,s()}}}function C3(n,e,t){let{date:i}=e;const l={get text(){return V.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 _k extends Se{constructor(e){super(),we(this,e,C3,$3,ke,{date:0})}}function O3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=B(i),s=B(" ("),o=B(n[0]),r=B(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){v(u,e,f),w(e,t),w(t,l),w(t,s),w(t,o),w(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&oe(l,i),f&1&&oe(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:te,o:te,d(u){u&&y(e)}}}function M3(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=x0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class gk extends Se{constructor(e){super(),we(this,e,M3,O3,ke,{level:0})}}function Sc(n,e,t){var o;const i=n.slice();i[32]=e[t];const l=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=l;const s=j3(i[32]);return i[34]=s,i}function Tc(n,e,t){const i=n.slice();return i[37]=e[t],i}function E3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),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,u){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[19]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&y(e),o=!1,r()}}}function D3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function I3(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function L3(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function A3(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function $c(n){let e;function t(s,o){return s[7]?N3:P3}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function P3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Cc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=C(),o&&o.c(),s=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(t,l),o&&o.m(t,null),w(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Cc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function N3(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Cc(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){v(l,e,s),t||(i=W(e,"click",n[26]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Oc(n){let e,t=de(n[34]),i=[];for(let l=0;l',P=C(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[32].id),s.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(_,"class","flex flex-gap-10"),p(g,"class","col-type-text col-field-message svelte-91v05h"),p(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,G){v(Z,t,G),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,g),w(g,_),w(_,k),w(k,$),w(g,T),U&&U.m(g,null),w(t,M),w(t,E),q(L,E,null),w(t,I),w(t,A),w(t,P),N=!0,R||(z=[W(s,"change",F),W(l,"click",On(e[18])),W(t,"click",J),W(t,"keydown",Y)],R=!0)},p(Z,G){e=Z,(!N||G[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||G[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const pe={};G[0]&8&&(pe.level=e[32].level),m.$set(pe),(!N||G[0]&8)&&S!==(S=e[32].message+"")&&oe($,S),e[34].length?U?U.p(e,G):(U=Oc(e),U.c(),U.m(g,null)):U&&(U.d(1),U=null);const ce={};G[0]&8&&(ce.date=e[32].created),L.$set(ce)},i(Z){N||(O(m.$$.fragment,Z),O(L.$$.fragment,Z),N=!0)},o(Z){D(m.$$.fragment,Z),D(L.$$.fragment,Z),N=!1},d(Z){Z&&y(t),H(m),U&&U.d(),H(L),R=!1,Ie(z)}}}function q3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S=[],$=new Map,T;function M(Y,Z){return Y[7]?D3:E3}let E=M(n),L=E(n);function I(Y){n[20](Y)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[I3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>be(o,"sort",I));function P(Y){n[21](Y)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[L3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new ir({props:N}),ie.push(()=>be(u,"sort",P));function R(Y){n[22](Y)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[A3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new ir({props:z}),ie.push(()=>be(d,"sort",R));let F=de(n[3]);const U=Y=>Y[32].id;for(let Y=0;Yr=!1)),o.$set(G);const pe={};Z[1]&512&&(pe.$$scope={dirty:Z,ctx:Y}),!f&&Z[0]&2&&(f=!0,pe.sort=Y[1],$e(()=>f=!1)),u.$set(pe);const ce={};Z[1]&512&&(ce.$$scope={dirty:Z,ctx:Y}),!m&&Z[0]&2&&(m=!0,ce.sort=Y[1],$e(()=>m=!1)),d.$set(ce),Z[0]&9369&&(F=de(Y[3]),re(),S=vt(S,Z,U,1,Y,F,$,k,Bt,Ec,null,Sc),ae(),!F.length&&J?J.p(Y,Z):F.length?J&&(J.d(1),J=null):(J=$c(Y),J.c(),J.m(k,null))),(!T||Z[0]&128)&&ee(e,"table-loading",Y[7])},i(Y){if(!T){O(o.$$.fragment,Y),O(u.$$.fragment,Y),O(d.$$.fragment,Y);for(let Z=0;ZLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[7]),ee(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&ee(t,"btn-loading",s[7]),o[0]&128&&ee(t,"btn-disabled",s[7])},d(s){s&&y(e),i=!1,l()}}}function Ic(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[5]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){v($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,k||(S=[W(f,"click",n[28]),W(h,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&oe(s,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&oe(a,r)},i($){_||($&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ie(S)}}}function H3(n){let e,t,i,l,s;e=new Nu({props:{class:"table-wrapper",$$slots:{default:[q3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Dc(n),r=n[5]&&Ic(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ye()},m(a,u){q(e,a,u),v(a,t,u),o&&o.m(a,u),v(a,i,u),r&&r.m(a,u),v(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&512&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=Dc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&O(r,1)):(r=Ic(a),r.c(),O(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(O(e.$$.fragment,a),O(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(y(t),y(i),y(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Lc=50,aa=/[-:\. ]/gi;function j3(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function z3(n,e,t){let i,l,s;const o=kt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,g=0,_={};async function k(G=1,pe=!0){t(7,h=!0);const ce=[a,V.normalizeLogsFilter(r)];return u.min&&u.max&&ce.push(`created >= "${u.min}" && created <= "${u.max}"`),_e.logs.getList(G,Lc,{sort:f,skipTotal:1,filter:ce.filter(Boolean).map(ue=>"("+ue+")").join("&&")}).then(async ue=>{var Ke;G<=1&&S();const Te=V.toArray(ue.items);if(t(7,h=!1),t(6,d=ue.page),t(17,m=((Ke=ue.items)==null?void 0:Ke.length)||0),o("load",c.concat(Te)),pe){const Je=++g;for(;Te.length&&g==Je;){const ft=Te.splice(0,10);for(let et of ft)V.pushOrReplaceByKey(c,et);t(3,c),await V.yieldToMain()}}else{for(let Je of Te)V.pushOrReplaceByKey(c,Je);t(3,c)}}).catch(ue=>{ue!=null&&ue.isAbort||(t(7,h=!1),console.warn(ue),S(),_e.error(ue,!ce||(ue==null?void 0:ue.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function $(){s?T():M()}function T(){t(4,_={})}function M(){for(const G of c)t(4,_[G.id]=G,_);t(4,_)}function E(G){_[G.id]?delete _[G.id]:t(4,_[G.id]=G,_),t(4,_)}function L(){const G=Object.values(_).sort((ue,Te)=>ue.createdTe.created?-1:0);if(!G.length)return;if(G.length==1)return V.downloadJson(G[0],"log_"+G[0].created.replaceAll(aa,"")+".json");const pe=G[0].created.replaceAll(aa,""),ce=G[G.length-1].created.replaceAll(aa,"");return V.downloadJson(G,`${G.length}_logs_${ce}_to_${pe}.json`)}function I(G){Pe.call(this,n,G)}const A=()=>$();function P(G){f=G,t(1,f)}function N(G){f=G,t(1,f)}function R(G){f=G,t(1,f)}const z=G=>E(G),F=G=>o("select",G),U=(G,pe)=>{pe.code==="Enter"&&(pe.preventDefault(),o("select",G))},J=()=>t(0,r=""),Y=()=>k(d+1),Z=()=>T();return n.$$set=G=>{"filter"in G&&t(0,r=G.filter),"presets"in G&&t(15,a=G.presets),"zoom"in G&&t(16,u=G.zoom),"sort"in G&&t(1,f=G.sort)},n.$$.update=()=>{n.$$.dirty[0]&98307&&(typeof f<"u"||typeof r<"u"||typeof a<"u"||typeof u<"u")&&(S(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Lc),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,k,c,_,l,d,h,s,i,o,$,T,E,L,a,u,m,I,A,P,N,R,z,F,U,J,Y,Z]}class U3 extends Se{constructor(e){super(),we(this,e,z3,H3,ke,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! +`)})},i(a){s||(a&&tt(()=>{s&&(l||(l=He(t,$t,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=He(t,$t,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&y(e),a&&l&&l.end(),o=!1,r()}}}function hc(n){let e,t,i=gr(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=B(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){v(a,e,u),w(e,t),w(t,l),w(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=gr(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=He(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&y(e),a&&o&&o.end()}}}function a3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],mc),f=[r3,o3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),l.c(),p(e,"class",n[1]),ee(e,"error",n[3].length)},m(m,h){v(m,e,h),u&&u.m(e,null),w(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=W(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&Pt(u,a,m,m[8],s?At(a,m[8],h,s3):Nt(m[8]),mc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&ee(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&y(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const _c="Invalid value";function gr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||_c:n||_c}function u3(n,e,t){let i;Qe(n,yn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Yn(r)}Xt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Pe.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends Se{constructor(e){super(),we(this,e,u3,a3,ke,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const f3=n=>({}),gc=n=>({});function bc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.5",p(e,"href","https://pocketbase.io/docs/"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),v(r,s,a),w(s,o)},d(r){r&&(y(e),y(t),y(i),y(l),y(s))}}}function c3(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=Lt(a,n,n[3],null),f=n[4].footer,c=Lt(f,n,n[3],gc);let d=((m=n[2])==null?void 0:m.id)&&bc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),l=b("footer"),c&&c.c(),s=C(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),ee(e,"center-content",n[0])},m(h,g){v(h,e,g),w(e,t),u&&u.m(t,null),w(e,i),w(e,l),c&&c.m(l,null),w(l,s),d&&d.m(l,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?At(a,h[3],g,null):Nt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?At(f,h[3],g,f3):Nt(h[3]),gc),(_=h[2])!=null&&_.id?d||(d=bc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&ee(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&y(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function d3(n,e,t){let i;Qe(n,Rr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class pi extends Se{constructor(e){super(),we(this,e,d3,c3,ke,{center:0,class:1})}}function p3(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){v(s,e,o),n[13](e),he(e,n[7]),i||(l=W(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]&&he(e,s[7])},i:te,o:te,d(s){s&&y(e),n[13](null),i=!1,l()}}}function m3(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={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&&(f.value=a[7]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function kc(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){v(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&y(e),l&&t&&t.end()}}}function yc(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){v(o,e,r),i=!0,l||(s=W(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function h3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[m3,p3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}s=h(n),o=m[s]=d[s](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&kc(),_=(n[0].length||n[7].length)&&yc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=C(),o.c(),r=C(),g&&g.c(),a=C(),_&&_.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(k,S){v(k,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),g&&g.m(e,null),w(e,a),_&&_.m(e,null),u=!0,f||(c=[W(e,"click",On(n[11])),W(e,"submit",nt(n[10]))],f=!0)},p(k,[S]){let $=s;s=h(k),s===$?m[s].p(k,S):(re(),D(m[$],1,1,()=>{m[$]=null}),ae(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),M(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?S&129&&M(g,1):(g=kc(),g.c(),M(g,1),g.m(e,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&M(_,1)):(_=yc(k),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(k){u||(M(o),M(g),M(_),u=!0)},o(k){D(o),D(g),D(_),u=!1},d(k){k&&y(e),m[s].d(),g&&g.d(),_&&_.d(),f=!1,Ie(c)}}}function _3(n,e,t){const i=kt(),l="search_"+V.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!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 g(){u||f||(t(5,f=!0),t(4,u=(await Tt(async()=>{const{default:O}=await import("./FilterAutocompleteInput-fHLXb8ZI.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Xt(()=>{g()});function _(O){Pe.call(this,n,O)}function k(O){d=O,t(7,d),t(0,s)}function S(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){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,u,f,c,d,l,m,h,_,k,S,$,T]}class Hr extends Se{constructor(e){super(),we(this,e,_3,h3,ke,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function g3(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){v(r,e,a),w(e,t),s||(o=[Oe(l=qe.call(null,e,n[0])),W(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&&It(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&ee(e,"refreshing",r[2])},i:te,o:te,d(r){r&&y(e),s=!1,Ie(o)}}}function b3(n,e,t){const i=kt();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 Xt(()=>()=>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 Pu extends Se{constructor(e){super(),we(this,e,b3,g3,ke,{tooltip:0,class:1})}}const k3=n=>({}),vc=n=>({}),y3=n=>({}),wc=n=>({});function v3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],wc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(m,n,n[10],vc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),s=C(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,_){v(g,e,_),f&&f.m(e,null),w(e,t),w(e,i),d&&d.m(i,null),n[12](i),w(e,s),h&&h.m(e,null),o=!0,r||(a=[W(window,"resize",n[1]),W(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,y3):Nt(g[10]),wc),d&&d.p&&(!o||_&1024)&&Pt(d,c,g,g[10],o?At(c,g[10],_,null):Nt(g[10]),null),(!o||_&9&&l!==(l="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||_&1024)&&Pt(h,m,g,g[10],o?At(m,g[10],_,k3):Nt(g[10]),vc)},i(g){o||(M(f,g),M(d,g),M(h,g),o=!0)},o(g){D(f,g),D(d,g),D(h,g),o=!1},d(g){g&&y(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,Ie(a)}}}function w3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-g,h=f.scrollHeight-_,h>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}Xt(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(L){ie[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,l=L.$$scope)},[o,O,f,c,r,a,u,S,$,T,l,i,E]}class Nu extends Se{constructor(e){super(),we(this,e,w3,v3,ke,{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 S3(n){let e,t,i,l,s;const o=n[6].default,r=Lt(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,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"click",n[7]),W(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Pt(r,o,a,a[5],i?At(o,a[5],u,null):Nt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&ee(e,"col-sort-disabled",a[3]),(!i||u&7)&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&ee(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function T3(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};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,u,l,i,f,c]}class ir extends Se{constructor(e){super(),we(this,e,T3,S3,ke,{class:1,name:2,sort:0,disable:3})}}function $3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Oe(qe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:te,o:te,d(o){o&&y(e),l=!1,s()}}}function C3(n,e,t){let{date:i}=e;const l={get text(){return V.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 _k extends Se{constructor(e){super(),we(this,e,C3,$3,ke,{date:0})}}function O3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=B(i),s=B(" ("),o=B(n[0]),r=B(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){v(u,e,f),w(e,t),w(t,l),w(t,s),w(t,o),w(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&oe(l,i),f&1&&oe(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:te,o:te,d(u){u&&y(e)}}}function M3(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=x0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class gk extends Se{constructor(e){super(),we(this,e,M3,O3,ke,{level:0})}}function Sc(n,e,t){var o;const i=n.slice();i[32]=e[t];const l=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=l;const s=j3(i[32]);return i[34]=s,i}function Tc(n,e,t){const i=n.slice();return i[37]=e[t],i}function E3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),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,u){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[19]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&y(e),o=!1,r()}}}function D3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function I3(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function L3(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function A3(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function $c(n){let e;function t(s,o){return s[7]?N3:P3}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function P3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Cc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=C(),o&&o.c(),s=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(t,l),o&&o.m(t,null),w(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Cc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function N3(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Cc(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){v(l,e,s),t||(i=W(e,"click",n[26]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Oc(n){let e,t=de(n[34]),i=[];for(let l=0;l',P=C(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[32].id),s.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(_,"class","flex flex-gap-10"),p(g,"class","col-type-text col-field-message svelte-91v05h"),p(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,G){v(Z,t,G),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,g),w(g,_),w(_,k),w(k,$),w(g,T),U&&U.m(g,null),w(t,O),w(t,E),q(L,E,null),w(t,I),w(t,A),w(t,P),N=!0,R||(z=[W(s,"change",F),W(l,"click",On(e[18])),W(t,"click",J),W(t,"keydown",Y)],R=!0)},p(Z,G){e=Z,(!N||G[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||G[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const pe={};G[0]&8&&(pe.level=e[32].level),m.$set(pe),(!N||G[0]&8)&&S!==(S=e[32].message+"")&&oe($,S),e[34].length?U?U.p(e,G):(U=Oc(e),U.c(),U.m(g,null)):U&&(U.d(1),U=null);const ce={};G[0]&8&&(ce.date=e[32].created),L.$set(ce)},i(Z){N||(M(m.$$.fragment,Z),M(L.$$.fragment,Z),N=!0)},o(Z){D(m.$$.fragment,Z),D(L.$$.fragment,Z),N=!1},d(Z){Z&&y(t),H(m),U&&U.d(),H(L),R=!1,Ie(z)}}}function q3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S=[],$=new Map,T;function O(Y,Z){return Y[7]?D3:E3}let E=O(n),L=E(n);function I(Y){n[20](Y)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[I3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>be(o,"sort",I));function P(Y){n[21](Y)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[L3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new ir({props:N}),ie.push(()=>be(u,"sort",P));function R(Y){n[22](Y)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[A3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new ir({props:z}),ie.push(()=>be(d,"sort",R));let F=de(n[3]);const U=Y=>Y[32].id;for(let Y=0;Yr=!1)),o.$set(G);const pe={};Z[1]&512&&(pe.$$scope={dirty:Z,ctx:Y}),!f&&Z[0]&2&&(f=!0,pe.sort=Y[1],$e(()=>f=!1)),u.$set(pe);const ce={};Z[1]&512&&(ce.$$scope={dirty:Z,ctx:Y}),!m&&Z[0]&2&&(m=!0,ce.sort=Y[1],$e(()=>m=!1)),d.$set(ce),Z[0]&9369&&(F=de(Y[3]),re(),S=vt(S,Z,U,1,Y,F,$,k,Bt,Ec,null,Sc),ae(),!F.length&&J?J.p(Y,Z):F.length?J&&(J.d(1),J=null):(J=$c(Y),J.c(),J.m(k,null))),(!T||Z[0]&128)&&ee(e,"table-loading",Y[7])},i(Y){if(!T){M(o.$$.fragment,Y),M(u.$$.fragment,Y),M(d.$$.fragment,Y);for(let Z=0;ZLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[7]),ee(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&ee(t,"btn-loading",s[7]),o[0]&128&&ee(t,"btn-disabled",s[7])},d(s){s&&y(e),i=!1,l()}}}function Ic(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[5]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){v($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,k||(S=[W(f,"click",n[28]),W(h,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&oe(s,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&oe(a,r)},i($){_||($&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ie(S)}}}function H3(n){let e,t,i,l,s;e=new Nu({props:{class:"table-wrapper",$$slots:{default:[q3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Dc(n),r=n[5]&&Ic(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ye()},m(a,u){q(e,a,u),v(a,t,u),o&&o.m(a,u),v(a,i,u),r&&r.m(a,u),v(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&512&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=Dc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&M(r,1)):(r=Ic(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(M(e.$$.fragment,a),M(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(y(t),y(i),y(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Lc=50,aa=/[-:\. ]/gi;function j3(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function z3(n,e,t){let i,l,s;const o=kt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,g=0,_={};async function k(G=1,pe=!0){t(7,h=!0);const ce=[a,V.normalizeLogsFilter(r)];return u.min&&u.max&&ce.push(`created >= "${u.min}" && created <= "${u.max}"`),_e.logs.getList(G,Lc,{sort:f,skipTotal:1,filter:ce.filter(Boolean).map(ue=>"("+ue+")").join("&&")}).then(async ue=>{var Ke;G<=1&&S();const Te=V.toArray(ue.items);if(t(7,h=!1),t(6,d=ue.page),t(17,m=((Ke=ue.items)==null?void 0:Ke.length)||0),o("load",c.concat(Te)),pe){const Je=++g;for(;Te.length&&g==Je;){const ft=Te.splice(0,10);for(let et of ft)V.pushOrReplaceByKey(c,et);t(3,c),await V.yieldToMain()}}else{for(let Je of Te)V.pushOrReplaceByKey(c,Je);t(3,c)}}).catch(ue=>{ue!=null&&ue.isAbort||(t(7,h=!1),console.warn(ue),S(),_e.error(ue,!ce||(ue==null?void 0:ue.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function $(){s?T():O()}function T(){t(4,_={})}function O(){for(const G of c)t(4,_[G.id]=G,_);t(4,_)}function E(G){_[G.id]?delete _[G.id]:t(4,_[G.id]=G,_),t(4,_)}function L(){const G=Object.values(_).sort((ue,Te)=>ue.createdTe.created?-1:0);if(!G.length)return;if(G.length==1)return V.downloadJson(G[0],"log_"+G[0].created.replaceAll(aa,"")+".json");const pe=G[0].created.replaceAll(aa,""),ce=G[G.length-1].created.replaceAll(aa,"");return V.downloadJson(G,`${G.length}_logs_${ce}_to_${pe}.json`)}function I(G){Pe.call(this,n,G)}const A=()=>$();function P(G){f=G,t(1,f)}function N(G){f=G,t(1,f)}function R(G){f=G,t(1,f)}const z=G=>E(G),F=G=>o("select",G),U=(G,pe)=>{pe.code==="Enter"&&(pe.preventDefault(),o("select",G))},J=()=>t(0,r=""),Y=()=>k(d+1),Z=()=>T();return n.$$set=G=>{"filter"in G&&t(0,r=G.filter),"presets"in G&&t(15,a=G.presets),"zoom"in G&&t(16,u=G.zoom),"sort"in G&&t(1,f=G.sort)},n.$$.update=()=>{n.$$.dirty[0]&98307&&(typeof f<"u"||typeof r<"u"||typeof a<"u"||typeof u<"u")&&(S(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Lc),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,k,c,_,l,d,h,s,i,o,$,T,E,L,a,u,m,I,A,P,N,R,z,F,U,J,Y,Z]}class U3 extends Se{constructor(e){super(),we(this,e,z3,H3,ke,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme * (c) 2024 Jukka Kurkela @@ -22,14 +22,14 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */function Ai(){}const c4=(()=>{let n=0;return()=>n++})();function Gt(n){return n==null}function an(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function yt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function kn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return kn(n)?n:e}function Mt(n,e){return typeof n>"u"?e:n}const d4=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ut(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function _t(n,e,t,i){let l,s,o;if(an(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function h4(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 _4(n){const e=h4(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function yr(n,e){return(Fc[e]||(Fc[e]=_4(e)))(n)}function Hu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const vr=n=>typeof n<"u",ll=n=>typeof n=="function",qc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function g4(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const gn=Math.PI,Ti=2*gn,b4=Ti+gn,wr=Number.POSITIVE_INFINITY,k4=gn/180,ui=gn/2,bl=gn/4,Hc=gn*2/3,Ja=Math.log10,sl=Math.sign;function Ol(n,e,t){return Math.abs(n-e)l-s).pop(),e}function Xs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function v4(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function w4(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ju(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const $l=(n,e,t,i)=>ju(n,t,i?l=>{const s=n[l][e];return sn[l][e]ju(n,t,i=>n[i][e]>=t);function M4(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Hu(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function Uc(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(Tk.forEach(s=>{delete n[s]}),delete n._chartjs)}function D4(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const $k=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ck(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,$k.call(window,()=>{i=!1,n.apply(e,t)}))}}function I4(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const L4=n=>n==="start"?"left":n==="end"?"right":"center",Vc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function A4(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=fi(Math.min($l(r,a,u).lo,t?i:$l(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=fi(Math.max($l(r,o.axis,f,!0).hi+1,t?0:$l(e,a,o.getPixelForValue(f),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function P4(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const Po=n=>n===0||n===1,Bc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ti/t)),Wc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ti/t)+1,Ns={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*ui)+1,easeOutSine:n=>Math.sin(n*ui),easeInOutSine:n=>-.5*(Math.cos(gn*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Po(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Po(n)?n:Bc(n,.075,.3),easeOutElastic:n=>Po(n)?n:Wc(n,.075,.3),easeInOutElastic(n){return Po(n)?n:n<.5?.5*Bc(n*2,.1125,.45):.5+.5*Wc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Ns.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ns.easeInBounce(n*2)*.5:Ns.easeOutBounce(n*2-1)*.5+.5};function zu(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Yc(n){return zu(n)?n:new Zs(n)}function fa(n){return zu(n)?n:new Zs(n).saturate(.5).darken(.1).hexString()}const N4=["x","y","borderWidth","radius","tension"],R4=["color","borderColor","backgroundColor"];function F4(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:R4},numbers:{type:"number",properties:N4}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function q4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Kc=new Map;function H4(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Kc.get(t);return i||(i=new Intl.NumberFormat(n,e),Kc.set(t,i)),i}function Ok(n,e,t){return H4(e,t).format(n)}const Mk={values(n){return an(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(l="scientific"),s=j4(n,t)}const o=Ja(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Ok(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ja(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?Mk.numeric.call(this,n,e,t):""}};function j4(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Ek={formatters:Mk};function z4(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ek.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Il=Object.create(null),Ga=Object.create(null);function Rs(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>fa(l.backgroundColor),this.hoverBorderColor=(i,l)=>fa(l.borderColor),this.hoverColor=(i,l)=>fa(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return ca(this,e,t)}get(e){return Rs(this,e)}describe(e,t){return ca(Ga,e,t)}override(e,t){return ca(Il,e,t)}route(e,t,i,l){const s=Rs(this,e),o=Rs(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return yt(a)?Object.assign({},u,a):Mt(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var ln=new U4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[F4,q4,z4]);function V4(n){return!n||Gt(n.size)||Gt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Jc(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function kl(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Zc(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Xa(n,e,t,i){B4(n,e,t,i)}function B4(n,e,t,i,l){let s,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,g=e.radius;let _=(h||0)*k4;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(_),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:n.arc(t,i,g,0,Ti),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Hc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Hc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+bl)*a,c=Math.cos(_+bl)*a,r=Math.sin(_+bl)*a,d=Math.sin(_+bl)*a,n.arc(t-c,i-r,u,_-gn,_-ui),n.arc(t+d,i-o,u,_-ui,_),n.arc(t+c,i+r,u,_,_+ui),n.arc(t-d,i+o,u,_+ui,_+gn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*g,f=a,n.rect(t-f,i-a,2*f,2*a);break}_+=bl;case"rectRot":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":_+=bl;case"cross":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),_+=bl,c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(_)*g,r=Math.sin(_)*g,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(_)*g,i+Math.sin(_)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ls(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,K4(n,s),a=0;a+n||0;function Dk(n,e){const t={},i=yt(e),l=i?Object.keys(e):e,s=yt(n)?i?o=>Mt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=x4(s(o));return t}function eS(n){return Dk(n,{top:"y",right:"x",bottom:"y",left:"x"})}function lr(n){return Dk(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ol(n){const e=eS(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Si(n,e){n=n||{},e=e||ln.font;let t=Mt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Mt(n.style,e.style);i&&!(""+i).match(X4)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Mt(n.family,e.family),lineHeight:Q4(Mt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Mt(n.weight,e.weight),string:""};return l.string=V4(l),l}function No(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Pl(n,e){return Object.assign(Object.create(n),e)}function Bu(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=Pk("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Bu([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return Lk(r,a,()=>uS(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return xc(r).includes(a)},ownKeys(r){return xc(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function ss(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Ik(n,i),setContext:s=>ss(n,s,t,i),override:s=>ss(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return Lk(s,o,()=>iS(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function Ik(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:ll(t)?t:()=>t,isIndexable:ll(i)?i:()=>i}}const nS=(n,e)=>n?n+Hu(e):e,Wu=(n,e)=>yt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Lk(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function iS(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return ll(r)&&o.isScriptable(e)&&(r=lS(e,r,n,t)),an(r)&&r.length&&(r=sS(e,r,n,o.isIndexable)),Wu(e,r)&&(r=ss(r,l,s&&s[e],o)),r}function lS(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Wu(n,a)&&(a=Yu(l._scopes,l,n,a)),a}function sS(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(yt(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Yu(u,l,n,f);e.push(ss(c,s,o&&o[n],r))}}return e}function Ak(n,e,t){return ll(n)?n(e,t):n}const oS=(n,e)=>n===!0?e:typeof n=="string"?yr(e,n):void 0;function rS(n,e,t,i,l){for(const s of e){const o=oS(t,s);if(o){n.add(o);const r=Ak(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Yu(n,e,t,i){const l=e._rootScopes,s=Ak(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Qc(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Qc(r,o,s,a,i),a===null)?!1:Bu(Array.from(r),[""],l,s,()=>aS(e,t,i))}function Qc(n,e,t,i,l){for(;t;)t=rS(n,e,t,i,l);return t}function aS(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return an(l)&&yt(t)?t:l||{}}function uS(n,e,t,i){let l;for(const s of e)if(l=Pk(nS(s,n),t),typeof l<"u")return Wu(n,l)?Yu(t,i,n,l):l}function Pk(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function xc(n){let e=n._keys;return e||(e=n._keys=fS(n._scopes)),e}function fS(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const cS=Number.EPSILON||1e-14,os=(n,e)=>en==="x"?"y":"x";function dS(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Za(s,l),a=Za(o,s);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function pS(n,e,t){const i=n.length;let l,s,o,r,a,u=os(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")hS(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function bS(n,e){return jr(n).getPropertyValue(e)}const kS=["top","right","bottom","left"];function Ml(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=kS[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const yS=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function vS(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(yS(l,s,n.target))r=l,a=s;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function yi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=jr(t),s=l.boxSizing==="border-box",o=Ml(l,"padding"),r=Ml(l,"border","width"),{x:a,y:u,box:f}=vS(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function wS(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&Ju(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=jr(s),a=Ml(r,"border","width"),u=Ml(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Sr(r.maxWidth,s,"clientWidth"),l=Sr(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||wr,maxHeight:l||wr}}const Fo=n=>Math.round(n*10)/10;function SS(n,e,t,i){const l=jr(n),s=Ml(l,"margin"),o=Sr(l.maxWidth,n,"clientWidth")||wr,r=Sr(l.maxHeight,n,"clientHeight")||wr,a=wS(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=Ml(l,"border","width"),m=Ml(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=Fo(Math.min(u,o,a.maxWidth)),f=Fo(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Fo(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Fo(Math.floor(f*i))),{width:u,height:f}}function ed(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const TS=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ku()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function td(n,e){const t=bS(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function $S(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function CS(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=vl(n,l,t),r=vl(l,s,t),a=vl(s,e,t),u=vl(o,r,t),f=vl(r,a,t);return vl(u,f,t)}const OS=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},MS=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function da(n,e,t){return n?OS(e,t):MS()}function ES(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function DS(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Rk(n){return n==="angle"?{between:wk,compare:$4,normalize:ki}:{between:Sk,compare:(e,t)=>e-t,normalize:e=>e}}function nd({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function IS(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=Rk(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(l,$,k)&&r(l,$)!==0,M=()=>r(s,k)===0||a(s,$,k),E=()=>g||T(),L=()=>!g||M();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(k=u(S[i]),k!==$&&(g=a(k,l,s),_===null&&E()&&(_=r(k,l)===0?I:A),_!==null&&L()&&(h.push(nd({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,$=k));return _!==null&&h.push(nd({start:_,end:c,loop:d,count:o,style:m})),h}function qk(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function AS(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function PS(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=LS(t,l,s,i);if(i===!0)return id(n,[{start:o,end:r,loop:s}],t,e);const a=r{let n=0;return()=>n++})();function Gt(n){return n==null}function an(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function yt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function kn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return kn(n)?n:e}function Mt(n,e){return typeof n>"u"?e:n}const d4=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ut(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function _t(n,e,t,i){let l,s,o;if(an(n))for(s=n.length,l=0;ln,x:n=>n.x,y:n=>n.y};function h4(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 _4(n){const e=h4(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function yr(n,e){return(Fc[e]||(Fc[e]=_4(e)))(n)}function Hu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const vr=n=>typeof n<"u",ll=n=>typeof n=="function",qc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function g4(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const gn=Math.PI,Ti=2*gn,b4=Ti+gn,wr=Number.POSITIVE_INFINITY,k4=gn/180,ui=gn/2,bl=gn/4,Hc=gn*2/3,Ja=Math.log10,sl=Math.sign;function Ol(n,e,t){return Math.abs(n-e)l-s).pop(),e}function Xs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function v4(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function w4(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ju(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const $l=(n,e,t,i)=>ju(n,t,i?l=>{const s=n[l][e];return sn[l][e]ju(n,t,i=>n[i][e]>=t);function M4(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Hu(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function Uc(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(Tk.forEach(s=>{delete n[s]}),delete n._chartjs)}function D4(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const $k=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ck(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,$k.call(window,()=>{i=!1,n.apply(e,t)}))}}function I4(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const L4=n=>n==="start"?"left":n==="end"?"right":"center",Vc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function A4(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(l=fi(Math.min($l(r,a,u).lo,t?i:$l(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=fi(Math.max($l(r,o.axis,f,!0).hi+1,t?0:$l(e,a,o.getPixelForValue(f),!0).hi+1),l,i)-l:s=i-l}return{start:l,count:s}}function P4(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const Po=n=>n===0||n===1,Bc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ti/t)),Wc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ti/t)+1,Ns={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*ui)+1,easeOutSine:n=>Math.sin(n*ui),easeInOutSine:n=>-.5*(Math.cos(gn*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Po(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Po(n)?n:Bc(n,.075,.3),easeOutElastic:n=>Po(n)?n:Wc(n,.075,.3),easeInOutElastic(n){return Po(n)?n:n<.5?.5*Bc(n*2,.1125,.45):.5+.5*Wc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Ns.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ns.easeInBounce(n*2)*.5:Ns.easeOutBounce(n*2-1)*.5+.5};function zu(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Yc(n){return zu(n)?n:new Zs(n)}function fa(n){return zu(n)?n:new Zs(n).saturate(.5).darken(.1).hexString()}const N4=["x","y","borderWidth","radius","tension"],R4=["color","borderColor","backgroundColor"];function F4(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:R4},numbers:{type:"number",properties:N4}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function q4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Kc=new Map;function H4(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Kc.get(t);return i||(i=new Intl.NumberFormat(n,e),Kc.set(t,i)),i}function Ok(n,e,t){return H4(e,t).format(n)}const Mk={values(n){return an(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(l="scientific"),s=j4(n,t)}const o=Ja(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Ok(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ja(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?Mk.numeric.call(this,n,e,t):""}};function j4(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Ek={formatters:Mk};function z4(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ek.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Il=Object.create(null),Ga=Object.create(null);function Rs(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>fa(l.backgroundColor),this.hoverBorderColor=(i,l)=>fa(l.borderColor),this.hoverColor=(i,l)=>fa(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return ca(this,e,t)}get(e){return Rs(this,e)}describe(e,t){return ca(Ga,e,t)}override(e,t){return ca(Il,e,t)}route(e,t,i,l){const s=Rs(this,e),o=Rs(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return yt(a)?Object.assign({},u,a):Mt(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var ln=new U4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[F4,q4,z4]);function V4(n){return!n||Gt(n.size)||Gt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Jc(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function kl(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Zc(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Xa(n,e,t,i){B4(n,e,t,i)}function B4(n,e,t,i,l){let s,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,g=e.radius;let _=(h||0)*k4;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(_),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:n.arc(t,i,g,0,Ti),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Hc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Hc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+bl)*a,c=Math.cos(_+bl)*a,r=Math.sin(_+bl)*a,d=Math.sin(_+bl)*a,n.arc(t-c,i-r,u,_-gn,_-ui),n.arc(t+d,i-o,u,_-ui,_),n.arc(t+c,i+r,u,_,_+ui),n.arc(t-d,i+o,u,_+ui,_+gn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*g,f=a,n.rect(t-f,i-a,2*f,2*a);break}_+=bl;case"rectRot":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":_+=bl;case"cross":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),_+=bl,c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(_)*g,r=Math.sin(_)*g,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(_)*g,i+Math.sin(_)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ls(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,K4(n,s),a=0;a+n||0;function Dk(n,e){const t={},i=yt(e),l=i?Object.keys(e):e,s=yt(n)?i?o=>Mt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=x4(s(o));return t}function eS(n){return Dk(n,{top:"y",right:"x",bottom:"y",left:"x"})}function lr(n){return Dk(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ol(n){const e=eS(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Si(n,e){n=n||{},e=e||ln.font;let t=Mt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Mt(n.style,e.style);i&&!(""+i).match(X4)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Mt(n.family,e.family),lineHeight:Q4(Mt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Mt(n.weight,e.weight),string:""};return l.string=V4(l),l}function No(n,e,t,i){let l,s,o;for(l=0,s=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Pl(n,e){return Object.assign(Object.create(n),e)}function Bu(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=Pk("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Bu([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return Lk(r,a,()=>uS(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return xc(r).includes(a)},ownKeys(r){return xc(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function ss(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Ik(n,i),setContext:s=>ss(n,s,t,i),override:s=>ss(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return Lk(s,o,()=>iS(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function Ik(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:ll(t)?t:()=>t,isIndexable:ll(i)?i:()=>i}}const nS=(n,e)=>n?n+Hu(e):e,Wu=(n,e)=>yt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Lk(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function iS(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return ll(r)&&o.isScriptable(e)&&(r=lS(e,r,n,t)),an(r)&&r.length&&(r=sS(e,r,n,o.isIndexable)),Wu(e,r)&&(r=ss(r,l,s&&s[e],o)),r}function lS(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Wu(n,a)&&(a=Yu(l._scopes,l,n,a)),a}function sS(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(yt(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Yu(u,l,n,f);e.push(ss(c,s,o&&o[n],r))}}return e}function Ak(n,e,t){return ll(n)?n(e,t):n}const oS=(n,e)=>n===!0?e:typeof n=="string"?yr(e,n):void 0;function rS(n,e,t,i,l){for(const s of e){const o=oS(t,s);if(o){n.add(o);const r=Ak(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Yu(n,e,t,i){const l=e._rootScopes,s=Ak(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Qc(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Qc(r,o,s,a,i),a===null)?!1:Bu(Array.from(r),[""],l,s,()=>aS(e,t,i))}function Qc(n,e,t,i,l){for(;t;)t=rS(n,e,t,i,l);return t}function aS(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return an(l)&&yt(t)?t:l||{}}function uS(n,e,t,i){let l;for(const s of e)if(l=Pk(nS(s,n),t),typeof l<"u")return Wu(n,l)?Yu(t,i,n,l):l}function Pk(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function xc(n){let e=n._keys;return e||(e=n._keys=fS(n._scopes)),e}function fS(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const cS=Number.EPSILON||1e-14,os=(n,e)=>en==="x"?"y":"x";function dS(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Za(s,l),a=Za(o,s);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function pS(n,e,t){const i=n.length;let l,s,o,r,a,u=os(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")hS(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function bS(n,e){return jr(n).getPropertyValue(e)}const kS=["top","right","bottom","left"];function Ml(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=kS[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const yS=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function vS(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(yS(l,s,n.target))r=l,a=s;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function yi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=jr(t),s=l.boxSizing==="border-box",o=Ml(l,"padding"),r=Ml(l,"border","width"),{x:a,y:u,box:f}=vS(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function wS(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&Ju(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=jr(s),a=Ml(r,"border","width"),u=Ml(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Sr(r.maxWidth,s,"clientWidth"),l=Sr(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||wr,maxHeight:l||wr}}const Fo=n=>Math.round(n*10)/10;function SS(n,e,t,i){const l=jr(n),s=Ml(l,"margin"),o=Sr(l.maxWidth,n,"clientWidth")||wr,r=Sr(l.maxHeight,n,"clientHeight")||wr,a=wS(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=Ml(l,"border","width"),m=Ml(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=Fo(Math.min(u,o,a.maxWidth)),f=Fo(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Fo(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Fo(Math.floor(f*i))),{width:u,height:f}}function ed(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const TS=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ku()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function td(n,e){const t=bS(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function $S(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function CS(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=vl(n,l,t),r=vl(l,s,t),a=vl(s,e,t),u=vl(o,r,t),f=vl(r,a,t);return vl(u,f,t)}const OS=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},MS=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function da(n,e,t){return n?OS(e,t):MS()}function ES(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function DS(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Rk(n){return n==="angle"?{between:wk,compare:$4,normalize:ki}:{between:Sk,compare:(e,t)=>e-t,normalize:e=>e}}function nd({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function IS(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=Rk(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(l,$,k)&&r(l,$)!==0,O=()=>r(s,k)===0||a(s,$,k),E=()=>g||T(),L=()=>!g||O();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(k=u(S[i]),k!==$&&(g=a(k,l,s),_===null&&E()&&(_=r(k,l)===0?I:A),_!==null&&L()&&(h.push(nd({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,$=k));return _!==null&&h.push(nd({start:_,end:c,loop:d,count:o,style:m})),h}function qk(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function AS(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function PS(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=LS(t,l,s,i);if(i===!0)return id(n,[{start:o,end:r,loop:s}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=$k.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Pi=new FS;const sd="transparent",qS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Yc(n||sd),l=i.valid&&Yc(e||sd);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class HS{constructor(e,t,i,l){const s=t[i];l=No([e.to,l,s,e.from]);const o=No([e.from,s,l]);this._active=!0,this._fn=e.fn||qS[e.type||typeof o],this._easing=Ns[e.easing]||Ns.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=No([e.to,t,l,e.from]),this._from=No([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!yt(s))return;const o={};for(const r of t)o[r]=s[r];(an(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=zS(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&jS(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}s[u]=c=new HS(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Pi.add(this._chart,i),!0}}function jS(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function ud(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=WS(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function JS(n,e){return Pl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ZS(n,e,t){return Pl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const ha=n=>n==="reset"||n==="none",fd=(n,e)=>e?n:Object.assign({},n),GS=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:jk(t,!0),values:null};class Fs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=pa(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&vs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=Mt(i.xAxisID,ma(e,"x")),o=t.yAxisID=Mt(i.yAxisID,ma(e,"y")),r=t.rAxisID=Mt(i.rAxisID,ma(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Uc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(yt(t)){const l=this._cachedMeta;this._data=BS(t,l)}else if(i!==t){if(i){Uc(i,this);const l=this._cachedMeta;vs(l),l._parsed=[]}t&&Object.isExtensible(t)&&E4(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=pa(t.vScale,t),t.stack!==i.stack&&(l=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(ud(this,t._parsed),t._stacked=pa(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{an(l[e])?d=this.parseArrayData(i,l,e,t):yt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]g||c=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),g=u.resolveNamedOptions(d,m,h,c);return g.$shared&&(g.$shared=a,s[o]=Object.freeze(fd(g,a))),g}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new Hk(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||ha(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){ha(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!ha(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let M=0;M<$;++M){const E=e[M],L=k?E:{};if(M=S){L.skip=!0;continue}const I=this.getParsed(M),A=Gt(I[m]),P=L[d]=o.getPixelForValue(I[d],M),N=L[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],M);L.skip=isNaN(P)||isNaN(N)||A,L.stop=M>0&&Math.abs(I[d]-T[d])>_,g&&(L.parsed=I,L.raw=u.data[M]),c&&(L.options=f||this.resolveDataElementOptions(M,E.active?"active":l)),k||this.updateElement(E,M,L,l),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}pt(sr,"id","line"),pt(sr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(sr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function yl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zu{constructor(e){pt(this,"options");this.options=e||{}}static override(e){Object.assign(Zu.prototype,e)}init(){}formats(){return yl()}parse(){return yl()}format(){return yl()}add(){return yl()}diff(){return yl()}startOf(){return yl()}endOf(){return yl()}}var zk={_date:Zu};function XS(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?O4:$l;if(i){if(l._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(s,e,t-f),d=a(s,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function mo(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var tT={evaluateInteractionItems:mo,modes:{index(n,e,t,i){const l=yi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?_a(n,l,s,i,o):ga(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const l=yi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?_a(n,l,s,i,o):ga(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function dd(n,e){return n.filter(t=>Uk.indexOf(t.pos)===-1&&t.box.axis===e)}function Ss(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function nT(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Ss(ws(e,"left"),!0),l=Ss(ws(e,"right")),s=Ss(ws(e,"top"),!0),o=Ss(ws(e,"bottom")),r=dd(e,"x"),a=dd(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:ws(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function pd(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Vk(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function oT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!yt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Vk(o,s.getPadding());const r=Math.max(0,e.outerWidth-pd(o,n,"left","right")),a=Math.max(0,e.outerHeight-pd(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function rT(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function aT(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Es(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,_)=>_.box.options&&_.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Vk(d,ol(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=lT(a.concat(u),c);Es(r.fullSize,m,c,h),Es(a,m,c,h),Es(u,m,c,h)&&Es(a,m,c,h),rT(m),md(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,md(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},_t(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Bk{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class uT extends Bk{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const or="$chartjs",fT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hd=n=>n===null||n==="";function cT(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[or]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",hd(l)){const s=td(n,"width");s!==void 0&&(n.width=s)}if(hd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=td(n,"height");s!==void 0&&(n.height=s)}return n}const Wk=TS?{passive:!0}:!1;function dT(n,e,t){n&&n.addEventListener(e,t,Wk)}function pT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Wk)}function mT(n,e){const t=fT[n.type]||n.type,{x:i,y:l}=yi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Tr(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function hT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.addedNodes,i),o=o&&!Tr(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function _T(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.removedNodes,i),o=o&&!Tr(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const Qs=new Map;let _d=0;function Yk(){const n=window.devicePixelRatio;n!==_d&&(_d=n,Qs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function gT(n,e){Qs.size||window.addEventListener("resize",Yk),Qs.set(n,e)}function bT(n){Qs.delete(n),Qs.size||window.removeEventListener("resize",Yk)}function kT(n,e,t){const i=n.canvas,l=i&&Ju(i);if(!l)return;const s=Ck((r,a)=>{const u=l.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),gT(n,s),o}function ba(n,e,t){t&&t.disconnect(),e==="resize"&&bT(n)}function yT(n,e,t){const i=n.canvas,l=Ck(s=>{n.ctx!==null&&t(mT(s,n))},n);return dT(i,e,l),l}class vT extends Bk{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(cT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[or])return!1;const i=t[or].initial;["height","width"].forEach(s=>{const o=i[s];Gt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[or],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:hT,detach:_T,resize:kT}[t]||yT;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:ba,detach:ba,resize:ba}[t]||pT)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return SS(e,t,i,l)}isAttached(e){const t=e&&Ju(e);return!!(t&&t.isConnected)}}function wT(n){return!Ku()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?uT:vT}class Ll{constructor(){pt(this,"x");pt(this,"y");pt(this,"active",!1);pt(this,"options");pt(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Xs(this.x)&&Xs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}pt(Ll,"defaults",{}),pt(Ll,"defaultRoutes");function ST(n,e){const t=n.options.ticks,i=TT(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?CT(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return OT(e,u,s,o/l),u;const f=$T(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(jo(e,u,f,Gt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function CT(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,gd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,bd=(n,e)=>Math.min(e||n,n);function kd(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function IT(n,e){_t(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:_i(t,_i(i,t)),max:_i(i,_i(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ut(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tS(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=fi(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ts(e.grid)-t.padding-yd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=S4(Math.min(Math.asin(fi((f.highest.height+6)/r,-1,1)),Math.asin(fi(a/u,-1,1))-Math.asin(fi(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ut(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ut(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=yd(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ts(s)+a):(e.height=this.maxHeight,e.width=Ts(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Tl(this.labelRotation),g=Math.cos(h),_=Math.sin(h);if(r){const k=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,_,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;s==="start"?(f=0,c=e.height):s==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ut(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[A]||0,height:r[A]||0});return{first:I(0),last:I(t-1),widest:I(E),highest:I(L),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return C4(this._alignToPixels?kl(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ts(s),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,k=function(J){return kl(i,J,g)};let S,$,T,M,E,L,I,A,P,N,R,z;if(o==="top")S=k(this.bottom),L=this.bottom-d,A=S-_,N=k(e.top)+_,z=e.bottom;else if(o==="bottom")S=k(this.top),N=e.top,z=k(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=k(this.right),E=this.right-d,I=S-_,P=k(e.left)+_,R=e.right;else if(o==="right")S=k(this.left),P=e.left,R=k(e.right)-_,E=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(yt(o)){const J=Object.keys(o)[0],Y=o[J];S=k(this.chart.scales[J].getPixelForValue(Y))}N=e.top,z=e.bottom,L=S+_,A=L+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(yt(o)){const J=Object.keys(o)[0],Y=o[J];S=k(this.chart.scales[J].getPixelForValue(Y))}E=S-_,I=E-d,P=e.left,R=e.right}const F=Mt(l.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/F));for($=0;$0&&(ft-=Ke/2);break}ce={left:ft,top:Je,width:Ke+ue.width,height:Te+ue.height,color:U.backdropColor}}_.push({label:T,font:A,textOffset:R,options:{rotation:g,color:Y,strokeColor:Z,strokeWidth:G,textAlign:pe,textBaseline:z,translation:[M,E],backdrop:ce}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Tl(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let u,f;return t==="left"?l?(f=this.right+s,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?l?(f=this.left+s,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");ln.route(s,l,a,r)})}function qT(n){return"id"in n&&"defaults"in n}class HT{constructor(){this.controllers=new zo(Fs,"datasets",!0),this.elements=new zo(Ll,"elements"),this.plugins=new zo(Object,"plugins"),this.scales=new zo(ho,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):_t(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Hu(e);ut(i["before"+l],[],i),t[e](i),ut(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function zT(n){const e={},t=[],i=Object.keys(bi.plugins.items);for(let s=0;s1&&vd(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function wd(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function JT(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return wd(n,"x",t[0])||wd(n,"y",t[0])}return{}}function ZT(n,e){const t=Il[n.type]||{scales:{}},i=e.scales||{},l=Qa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!yt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=xa(o,r,JT(o,n),ln.scales[r.type]),u=YT(a,l),f=t.scales||{};s[o]=Ps(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||Qa(r,e),f=(Il[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=WT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Ps(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Ps(r,[ln.scales[r.type],ln.scale])}),s}function Kk(n){const e=n.options||(n.options={});e.plugins=Mt(e.plugins,{}),e.scales=ZT(n,e)}function Jk(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function GT(n){return n=n||{},n.data=Jk(n.data),Kk(n),n}const Sd=new Map,Zk=new Set;function Uo(n,e){let t=Sd.get(n);return t||(t=e(),Sd.set(n,t),Zk.add(t)),t}const $s=(n,e,t)=>{const i=yr(e,t);i!==void 0&&n.add(i)};class XT{constructor(e){this._config=GT(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Jk(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Kk(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Uo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Uo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Uo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Uo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>$s(a,e,c))),f.forEach(c=>$s(a,l,c)),f.forEach(c=>$s(a,Il[s]||{},c)),f.forEach(c=>$s(a,ln,c)),f.forEach(c=>$s(a,Ga,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Zk.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Il[t]||{},ln.datasets[t]||{},{type:t},ln,Ga]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Td(this._resolverCache,e,l);let a=o;if(xT(o,t)){s.$shared=!1,i=ll(i)?i():i;const u=this.createResolver(e,i,r);a=ss(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Td(this._resolverCache,e,i);return yt(t)?ss(s,t,void 0,l):s}}function Td(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Bu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const QT=n=>yt(n)&&Object.getOwnPropertyNames(n).some(e=>ll(n[e]));function xT(n,e){const{isScriptable:t,isIndexable:i}=Ik(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(ll(r)||QT(r))||o&&an(r))return!0}return!1}var e$="4.4.7";const t$=["top","bottom","left","right","chartArea"];function $d(n,e){return n==="top"||n==="bottom"||t$.indexOf(n)===-1&&e==="x"}function Cd(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Od(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ut(t&&t.onComplete,[n],e)}function n$(n){const e=n.chart,t=e.options.animation;ut(t&&t.onProgress,[n],e)}function Gk(n){return Ku()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const rr={},Md=n=>{const e=Gk(n);return Object.values(rr).filter(t=>t.canvas===e).pop()};function i$(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function l$(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Vo(n,e,t){return n.options.clip?n[t]:e[t]}function s$(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Vo(t,e,"left"),right:Vo(t,e,"right"),top:Vo(i,e,"top"),bottom:Vo(i,e,"bottom")}:e}class vi{static register(...e){bi.add(...e),Ed()}static unregister(...e){bi.remove(...e),Ed()}constructor(e,t){const i=this.config=new XT(t),l=Gk(e),s=Md(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||wT(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=c4(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new jT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=I4(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],rr[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Pi.listen(this,"complete",Od),Pi.listen(this,"progress",n$),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Gt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ed(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zc(this.canvas,this.ctx),this}stop(){return Pi.stop(this),this}resize(e,t){Pi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ed(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ut(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};_t(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=xa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),_t(s,o=>{const r=o.options,a=r.id,u=xa(a,r),f=Mt(r.type,o.dtype);(r.position===void 0||$d(r.position,u)!==$d(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=bi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),_t(l,(o,r)=>{o||delete i[r]}),_t(i,o=>{Ho.configure(this,o,o.options),Ho.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Cd("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){_t(this.scales,e=>{Ho.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!qc(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;i$(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ho.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],_t(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=s$(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Uu(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Vu(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ls(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=tT.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=Pl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);vr(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};_t(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){_t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_t(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!br(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=g4(e),u=l$(e,this._lastEvent,i,a);i&&(this._lastEvent=null,ut(s.onHover,[e,r,this],this),a&&ut(s.onClick,[e,r,this],this));const f=!br(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}pt(vi,"defaults",ln),pt(vi,"instances",rr),pt(vi,"overrides",Il),pt(vi,"registry",bi),pt(vi,"version",e$),pt(vi,"getChart",Md);function Ed(){return _t(vi.instances,n=>n._plugins.invalidate())}function Xk(n,e,t=e){n.lineCap=Mt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Mt(t.borderDash,e.borderDash)),n.lineDashOffset=Mt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Mt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Mt(t.borderWidth,e.borderWidth),n.strokeStyle=Mt(t.borderColor,e.borderColor)}function o$(n,e,t){n.lineTo(t.x,t.y)}function r$(n){return n.stepped?W4:n.tension||n.cubicInterpolationMode==="monotone"?Y4:o$}function Qk(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%s,$=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const T=m.x,M=m.y,E=T|0;E===h?(M_&&(_=M),f=(c*f+T)/++c):($(),n.lineTo(T,M),h=E,c=0,g=_=M),k=M}$()}function eu(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?u$:a$}function f$(n){return n.stepped?$S:n.tension||n.cubicInterpolationMode==="monotone"?CS:vl}function c$(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Xk(n,e.options),n.stroke(l)}function d$(n,e,t,i){const{segments:l,options:s}=e,o=eu(e);for(const r of l)Xk(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const p$=typeof Path2D=="function";function m$(n,e,t,i){p$&&!e.options.segment?c$(n,e,t,i):d$(n,e,t,i)}class Qi extends Ll{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;gS(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=PS(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=qk(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=f$(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Dd(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Gu(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Gu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Id(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function xk(n,e){let t=[],i=!1;return an(n)?(i=!0,t=n):t=_$(n,e),t.length?new Qi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ld(n){return n&&n.fill!==!1}function g$(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!kn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function b$(n,e,t){const i=w$(n);if(yt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return kn(l)&&Math.floor(l)===l?k$(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function k$(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function y$(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:yt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function v$(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:yt(n)?i=n.value:i=e.getBaseValue(),i}function w$(n){const e=n.options,t=e.fill;let i=Mt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function S$(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=T$(e,t);r.push(xk({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&ka(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;Ld(s)&&ka(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Ld(i)||t.drawTime!=="beforeDatasetDraw"||ka(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ds={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;sr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=$k.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Pi=new FS;const sd="transparent",qS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Yc(n||sd),l=i.valid&&Yc(e||sd);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class HS{constructor(e,t,i,l){const s=t[i];l=No([e.to,l,s,e.from]);const o=No([e.from,s,l]);this._active=!0,this._fn=e.fn||qS[e.type||typeof o],this._easing=Ns[e.easing]||Ns.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=No([e.to,t,l,e.from]),this._from=No([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!yt(s))return;const o={};for(const r of t)o[r]=s[r];(an(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=zS(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&jS(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}s[u]=c=new HS(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Pi.add(this._chart,i),!0}}function jS(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function ud(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=WS(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function JS(n,e){return Pl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ZS(n,e,t){return Pl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const ha=n=>n==="reset"||n==="none",fd=(n,e)=>e?n:Object.assign({},n),GS=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:jk(t,!0),values:null};class Fs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=pa(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&vs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=Mt(i.xAxisID,ma(e,"x")),o=t.yAxisID=Mt(i.yAxisID,ma(e,"y")),r=t.rAxisID=Mt(i.rAxisID,ma(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Uc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(yt(t)){const l=this._cachedMeta;this._data=BS(t,l)}else if(i!==t){if(i){Uc(i,this);const l=this._cachedMeta;vs(l),l._parsed=[]}t&&Object.isExtensible(t)&&E4(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=pa(t.vScale,t),t.stack!==i.stack&&(l=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(ud(this,t._parsed),t._stacked=pa(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{an(l[e])?d=this.parseArrayData(i,l,e,t):yt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]g||c=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),g=u.resolveNamedOptions(d,m,h,c);return g.$shared&&(g.$shared=a,s[o]=Object.freeze(fd(g,a))),g}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new Hk(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||ha(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){ha(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!ha(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;r0&&this.getParsed(t-1);for(let O=0;O<$;++O){const E=e[O],L=k?E:{};if(O=S){L.skip=!0;continue}const I=this.getParsed(O),A=Gt(I[m]),P=L[d]=o.getPixelForValue(I[d],O),N=L[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],O);L.skip=isNaN(P)||isNaN(N)||A,L.stop=O>0&&Math.abs(I[d]-T[d])>_,g&&(L.parsed=I,L.raw=u.data[O]),c&&(L.options=f||this.resolveDataElementOptions(O,E.active?"active":l)),k||this.updateElement(E,O,L,l),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}pt(sr,"id","line"),pt(sr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(sr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function yl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zu{constructor(e){pt(this,"options");this.options=e||{}}static override(e){Object.assign(Zu.prototype,e)}init(){}formats(){return yl()}parse(){return yl()}format(){return yl()}add(){return yl()}diff(){return yl()}startOf(){return yl()}endOf(){return yl()}}var zk={_date:Zu};function XS(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const a=r._reversePixels?O4:$l;if(i){if(l._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(s,e,t-f),d=a(s,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(s,e,t)}return{lo:0,hi:s.length-1}}function mo(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var tT={evaluateInteractionItems:mo,modes:{index(n,e,t,i){const l=yi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?_a(n,l,s,i,o):ga(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const l=yi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?_a(n,l,s,i,o):ga(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function dd(n,e){return n.filter(t=>Uk.indexOf(t.pos)===-1&&t.box.axis===e)}function Ss(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function nT(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Ss(ws(e,"left"),!0),l=Ss(ws(e,"right")),s=Ss(ws(e,"top"),!0),o=Ss(ws(e,"bottom")),r=dd(e,"x"),a=dd(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:ws(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function pd(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Vk(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function oT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!yt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Vk(o,s.getPadding());const r=Math.max(0,e.outerWidth-pd(o,n,"left","right")),a=Math.max(0,e.outerHeight-pd(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function rT(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function aT(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Es(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,_)=>_.box.options&&_.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Vk(d,ol(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=lT(a.concat(u),c);Es(r.fullSize,m,c,h),Es(a,m,c,h),Es(u,m,c,h)&&Es(a,m,c,h),rT(m),md(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,md(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},_t(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Bk{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class uT extends Bk{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const or="$chartjs",fT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hd=n=>n===null||n==="";function cT(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[or]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",hd(l)){const s=td(n,"width");s!==void 0&&(n.width=s)}if(hd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=td(n,"height");s!==void 0&&(n.height=s)}return n}const Wk=TS?{passive:!0}:!1;function dT(n,e,t){n&&n.addEventListener(e,t,Wk)}function pT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Wk)}function mT(n,e){const t=fT[n.type]||n.type,{x:i,y:l}=yi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Tr(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function hT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.addedNodes,i),o=o&&!Tr(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function _T(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.removedNodes,i),o=o&&!Tr(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const Qs=new Map;let _d=0;function Yk(){const n=window.devicePixelRatio;n!==_d&&(_d=n,Qs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function gT(n,e){Qs.size||window.addEventListener("resize",Yk),Qs.set(n,e)}function bT(n){Qs.delete(n),Qs.size||window.removeEventListener("resize",Yk)}function kT(n,e,t){const i=n.canvas,l=i&&Ju(i);if(!l)return;const s=Ck((r,a)=>{const u=l.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),gT(n,s),o}function ba(n,e,t){t&&t.disconnect(),e==="resize"&&bT(n)}function yT(n,e,t){const i=n.canvas,l=Ck(s=>{n.ctx!==null&&t(mT(s,n))},n);return dT(i,e,l),l}class vT extends Bk{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(cT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[or])return!1;const i=t[or].initial;["height","width"].forEach(s=>{const o=i[s];Gt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[or],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:hT,detach:_T,resize:kT}[t]||yT;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:ba,detach:ba,resize:ba}[t]||pT)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return SS(e,t,i,l)}isAttached(e){const t=e&&Ju(e);return!!(t&&t.isConnected)}}function wT(n){return!Ku()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?uT:vT}class Ll{constructor(){pt(this,"x");pt(this,"y");pt(this,"active",!1);pt(this,"options");pt(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Xs(this.x)&&Xs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}pt(Ll,"defaults",{}),pt(Ll,"defaultRoutes");function ST(n,e){const t=n.options.ticks,i=TT(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?CT(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return OT(e,u,s,o/l),u;const f=$T(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(jo(e,u,f,Gt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function CT(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,gd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,bd=(n,e)=>Math.min(e||n,n);function kd(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function IT(n,e){_t(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:_i(t,_i(i,t)),max:_i(i,_i(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ut(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tS(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=fi(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ts(e.grid)-t.padding-yd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=S4(Math.min(Math.asin(fi((f.highest.height+6)/r,-1,1)),Math.asin(fi(a/u,-1,1))-Math.asin(fi(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ut(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ut(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=yd(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ts(s)+a):(e.height=this.maxHeight,e.width=Ts(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Tl(this.labelRotation),g=Math.cos(h),_=Math.sin(h);if(r){const k=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,_,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;s==="start"?(f=0,c=e.height):s==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ut(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[A]||0,height:r[A]||0});return{first:I(0),last:I(t-1),widest:I(E),highest:I(L),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return C4(this._alignToPixels?kl(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ts(s),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,k=function(J){return kl(i,J,g)};let S,$,T,O,E,L,I,A,P,N,R,z;if(o==="top")S=k(this.bottom),L=this.bottom-d,A=S-_,N=k(e.top)+_,z=e.bottom;else if(o==="bottom")S=k(this.top),N=e.top,z=k(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=k(this.right),E=this.right-d,I=S-_,P=k(e.left)+_,R=e.right;else if(o==="right")S=k(this.left),P=e.left,R=k(e.right)-_,E=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(yt(o)){const J=Object.keys(o)[0],Y=o[J];S=k(this.chart.scales[J].getPixelForValue(Y))}N=e.top,z=e.bottom,L=S+_,A=L+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(yt(o)){const J=Object.keys(o)[0],Y=o[J];S=k(this.chart.scales[J].getPixelForValue(Y))}E=S-_,I=E-d,P=e.left,R=e.right}const F=Mt(l.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/F));for($=0;$0&&(ft-=Ke/2);break}ce={left:ft,top:Je,width:Ke+ue.width,height:Te+ue.height,color:U.backdropColor}}_.push({label:T,font:A,textOffset:R,options:{rotation:g,color:Y,strokeColor:Z,strokeWidth:G,textAlign:pe,textBaseline:z,translation:[O,E],backdrop:ce}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Tl(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let u,f;return t==="left"?l?(f=this.right+s,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?l?(f=this.left+s,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");ln.route(s,l,a,r)})}function qT(n){return"id"in n&&"defaults"in n}class HT{constructor(){this.controllers=new zo(Fs,"datasets",!0),this.elements=new zo(Ll,"elements"),this.plugins=new zo(Object,"plugins"),this.scales=new zo(ho,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):_t(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Hu(e);ut(i["before"+l],[],i),t[e](i),ut(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function zT(n){const e={},t=[],i=Object.keys(bi.plugins.items);for(let s=0;s1&&vd(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function wd(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function JT(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return wd(n,"x",t[0])||wd(n,"y",t[0])}return{}}function ZT(n,e){const t=Il[n.type]||{scales:{}},i=e.scales||{},l=Qa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!yt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=xa(o,r,JT(o,n),ln.scales[r.type]),u=YT(a,l),f=t.scales||{};s[o]=Ps(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||Qa(r,e),f=(Il[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=WT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Ps(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Ps(r,[ln.scales[r.type],ln.scale])}),s}function Kk(n){const e=n.options||(n.options={});e.plugins=Mt(e.plugins,{}),e.scales=ZT(n,e)}function Jk(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function GT(n){return n=n||{},n.data=Jk(n.data),Kk(n),n}const Sd=new Map,Zk=new Set;function Uo(n,e){let t=Sd.get(n);return t||(t=e(),Sd.set(n,t),Zk.add(t)),t}const $s=(n,e,t)=>{const i=yr(e,t);i!==void 0&&n.add(i)};class XT{constructor(e){this._config=GT(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Jk(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Kk(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Uo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Uo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Uo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Uo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>$s(a,e,c))),f.forEach(c=>$s(a,l,c)),f.forEach(c=>$s(a,Il[s]||{},c)),f.forEach(c=>$s(a,ln,c)),f.forEach(c=>$s(a,Ga,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Zk.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Il[t]||{},ln.datasets[t]||{},{type:t},ln,Ga]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Td(this._resolverCache,e,l);let a=o;if(xT(o,t)){s.$shared=!1,i=ll(i)?i():i;const u=this.createResolver(e,i,r);a=ss(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Td(this._resolverCache,e,i);return yt(t)?ss(s,t,void 0,l):s}}function Td(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Bu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const QT=n=>yt(n)&&Object.getOwnPropertyNames(n).some(e=>ll(n[e]));function xT(n,e){const{isScriptable:t,isIndexable:i}=Ik(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(ll(r)||QT(r))||o&&an(r))return!0}return!1}var e$="4.4.7";const t$=["top","bottom","left","right","chartArea"];function $d(n,e){return n==="top"||n==="bottom"||t$.indexOf(n)===-1&&e==="x"}function Cd(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Od(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ut(t&&t.onComplete,[n],e)}function n$(n){const e=n.chart,t=e.options.animation;ut(t&&t.onProgress,[n],e)}function Gk(n){return Ku()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const rr={},Md=n=>{const e=Gk(n);return Object.values(rr).filter(t=>t.canvas===e).pop()};function i$(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function l$(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Vo(n,e,t){return n.options.clip?n[t]:e[t]}function s$(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Vo(t,e,"left"),right:Vo(t,e,"right"),top:Vo(i,e,"top"),bottom:Vo(i,e,"bottom")}:e}class vi{static register(...e){bi.add(...e),Ed()}static unregister(...e){bi.remove(...e),Ed()}constructor(e,t){const i=this.config=new XT(t),l=Gk(e),s=Md(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||wT(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=c4(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new jT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=I4(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],rr[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Pi.listen(this,"complete",Od),Pi.listen(this,"progress",n$),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Gt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ed(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zc(this.canvas,this.ctx),this}stop(){return Pi.stop(this),this}resize(e,t){Pi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ed(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ut(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};_t(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=xa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),_t(s,o=>{const r=o.options,a=r.id,u=xa(a,r),f=Mt(r.type,o.dtype);(r.position===void 0||$d(r.position,u)!==$d(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=bi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),_t(l,(o,r)=>{o||delete i[r]}),_t(i,o=>{Ho.configure(this,o,o.options),Ho.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Cd("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){_t(this.scales,e=>{Ho.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!qc(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;i$(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ho.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],_t(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=s$(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Uu(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Vu(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ls(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=tT.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=Pl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);vr(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};_t(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){_t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_t(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!br(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=g4(e),u=l$(e,this._lastEvent,i,a);i&&(this._lastEvent=null,ut(s.onHover,[e,r,this],this),a&&ut(s.onClick,[e,r,this],this));const f=!br(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}pt(vi,"defaults",ln),pt(vi,"instances",rr),pt(vi,"overrides",Il),pt(vi,"registry",bi),pt(vi,"version",e$),pt(vi,"getChart",Md);function Ed(){return _t(vi.instances,n=>n._plugins.invalidate())}function Xk(n,e,t=e){n.lineCap=Mt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Mt(t.borderDash,e.borderDash)),n.lineDashOffset=Mt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Mt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Mt(t.borderWidth,e.borderWidth),n.strokeStyle=Mt(t.borderColor,e.borderColor)}function o$(n,e,t){n.lineTo(t.x,t.y)}function r$(n){return n.stepped?W4:n.tension||n.cubicInterpolationMode==="monotone"?Y4:o$}function Qk(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%s,$=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const T=m.x,O=m.y,E=T|0;E===h?(O_&&(_=O),f=(c*f+T)/++c):($(),n.lineTo(T,O),h=E,c=0,g=_=O),k=O}$()}function eu(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?u$:a$}function f$(n){return n.stepped?$S:n.tension||n.cubicInterpolationMode==="monotone"?CS:vl}function c$(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Xk(n,e.options),n.stroke(l)}function d$(n,e,t,i){const{segments:l,options:s}=e,o=eu(e);for(const r of l)Xk(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const p$=typeof Path2D=="function";function m$(n,e,t,i){p$&&!e.options.segment?c$(n,e,t,i):d$(n,e,t,i)}class Qi extends Ll{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;gS(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=PS(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=qk(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=f$(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Dd(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s){r=Gu(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Gu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Id(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function xk(n,e){let t=[],i=!1;return an(n)?(i=!0,t=n):t=_$(n,e),t.length?new Qi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ld(n){return n&&n.fill!==!1}function g$(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!kn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function b$(n,e,t){const i=w$(n);if(yt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return kn(l)&&Math.floor(l)===l?k$(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function k$(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function y$(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:yt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function v$(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:yt(n)?i=n.value:i=e.getBaseValue(),i}function w$(n){const e=n.options,t=e.fill;let i=Mt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function S$(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=T$(e,t);r.push(xk({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&ka(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;Ld(s)&&ka(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Ld(i)||t.drawTime!=="beforeDatasetDraw"||ka(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ds={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;er+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;s-1?n.split(` -`):n}function N$(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function Rd(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Si(e.bodyFont),u=Si(e.titleFont),f=Si(e.footerFont),c=s.length,d=l.length,m=i.length,h=ol(e.padding);let g=h.height,_=0,k=i.reduce((T,M)=>T+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,_t(n.title,$),t.font=a.string,_t(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,_t(i,T=>{_t(T.before,$),_t(T.lines,$),_t(T.after,$)}),S=0,t.font=f.string,_t(n.footer,$),t.restore(),_+=h.width,{width:_,height:g}}function R$(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function F$(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function q$(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),F$(u,n,e,t)&&(u="center"),u}function Fd(n,e,t){const i=t.yAlign||e.yAlign||R$(n,t);return{xAlign:t.xAlign||e.xAlign||q$(n,e,t,i),yAlign:i}}function H$(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function j$(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function qd(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=lr(o);let h=H$(e,r);const g=j$(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:fi(h,0,i.width-e.width),y:fi(g,0,i.height-e.height)}}function Bo(n,e,t){const i=ol(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Hd(n){return gi([],Ni(n))}function z$(n,e,t){return Pl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function jd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const ty={beforeTitle:Ai,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?ty[e].call(t,i):l}class nu extends Ll{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new Hk(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=z$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=In(i,"beforeTitle",this,e),s=In(i,"title",this,e),o=In(i,"afterTitle",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}getBeforeBody(e,t){return Hd(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return _t(e,s=>{const o={before:[],lines:[],after:[]},r=jd(i,s);gi(o.before,Ni(In(r,"beforeLabel",this,s))),gi(o.lines,In(r,"label",this,s)),gi(o.after,Ni(In(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return Hd(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=In(i,"beforeFooter",this,e),s=In(i,"footer",this,e),o=In(i,"afterFooter",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),_t(r,f=>{const c=jd(e.callbacks,f);l.push(In(c,"labelColor",this,f)),s.push(In(c,"labelPointStyle",this,f)),o.push(In(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Ds[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Rd(this,i),u=Object.assign({},r,a),f=Fd(this.chart,i,u),c=qd(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=lr(r),{x:d,y:m}=e,{width:h,height:g}=t;let _,k,S,$,T,M;return s==="center"?(T=m+g/2,l==="left"?(_=d,k=_-o,$=T+o,M=T-o):(_=d+h,k=_+o,$=T-o,M=T+o),S=_):(l==="left"?k=d+Math.max(a,f)+o:l==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,s==="top"?($=m,T=$-o,_=k-o,S=k+o):($=m+g,T=$+o,_=k+o,S=k-o),M=$),{x1:_,x2:k,x3:S,y1:$,y2:T,y3:M}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=da(i.rtl,this.x,this.width);for(e.x=Bo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Si(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Xc(e,{x:g,y:h,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Xc(e,{x:_,y:h+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,h,u,a),e.strokeRect(g,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,h+1,u-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:u,boxPadding:f}=i,c=Si(i.bodyFont);let d=c.lineHeight,m=0;const h=da(i.rtl,this.x,this.width),g=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},_=h.textAlign(o);let k,S,$,T,M,E,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Bo(this,_,i),t.fillStyle=i.bodyColor,_t(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=l.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Ds[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Rd(this,e),a=Object.assign({},o,this._size),u=Fd(t,e,a),f=qd(e,a,u,t);(l._to!==f.x||s._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ol(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),ES(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),DS(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),s=!br(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!br(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Ds[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}pt(nu,"positioners",Ds);var U$={id:"tooltip",_element:nu,positioners:Ds,afterInit(n,e,t){t&&(n.tooltip=new nu({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ty},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function V$(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,h=f-1,{min:g,max:_}=e,k=!Gt(o),S=!Gt(r),$=!Gt(u),T=(_-g)/(c+1);let M=jc((_-g)/h/m)*m,E,L,I,A;if(M<1e-14&&!k&&!S)return[{value:g},{value:_}];A=Math.ceil(_/M)-Math.floor(g/M),A>h&&(M=jc(A*M/h/m)*m),Gt(a)||(E=Math.pow(10,a),M=Math.ceil(M*E)/E),l==="ticks"?(L=Math.floor(g/M)*M,I=Math.ceil(_/M)*M):(L=g,I=_),k&&S&&s&&v4((r-o)/s,M/1e3)?(A=Math.round(Math.min((r-o)/M,f)),M=(r-o)/A,L=o,I=r):$?(L=k?o:L,I=S?r:I,A=u-1,M=(I-L)/A):(A=(I-L)/M,Ol(A,Math.round(A),M/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(zc(M),zc(L));E=Math.pow(10,Gt(a)?P:a),L=Math.round(L*E)/E,I=Math.round(I*E)/E;let N=0;for(k&&(d&&L!==o?(t.push({value:o}),Lr)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ol(t[t.length-1].value,r,zd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function zd(n,e,{horizontal:t,minRotation:i}){const l=Tl(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class B$ extends ho{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Gt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=sl(l),u=sl(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=V$(l,s);return e.bounds==="ticks"&&w4(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Ok(e,this.chart.options.locale,this.options.ticks.format)}}class iu extends B${determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=kn(e)?e:0,this.max=kn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Tl(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}pt(iu,"id","linear"),pt(iu,"defaults",{ticks:{callback:Ek.formatters.numeric}});const zr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nn=Object.keys(zr);function Ud(n,e){return n-e}function Vd(n,e){if(Gt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),kn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Xs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Bd(n,e,t,i){const l=Nn.length;for(let s=Nn.indexOf(n);s=Nn.indexOf(t);s--){const o=Nn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Nn[t?Nn.indexOf(t):0]}function Y$(n){for(let e=Nn.indexOf(n)+1,t=Nn.length;e=e?t[i]:t[l];n[s]=!0}}function K$(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Yd(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+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=fi(t,0,o),i=fi(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||Bd(s.minUnit,t,i,this._getLabelCapacity(t)),r=Mt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Xs(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"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+g)}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 ut(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}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}=$l(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}=$l(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Kd extends xs{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=Wo(t,this.min),this._tableRange=Wo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Wo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Wo(this._table,i*this._tableRange+this._minPos,!0)}}pt(Kd,"id","timeseries"),pt(Kd,"defaults",xs.defaults);/*! +`):n}function N$(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function Rd(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Si(e.bodyFont),u=Si(e.titleFont),f=Si(e.footerFont),c=s.length,d=l.length,m=i.length,h=ol(e.padding);let g=h.height,_=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,_t(n.title,$),t.font=a.string,_t(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,_t(i,T=>{_t(T.before,$),_t(T.lines,$),_t(T.after,$)}),S=0,t.font=f.string,_t(n.footer,$),t.restore(),_+=h.width,{width:_,height:g}}function R$(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function F$(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function q$(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),F$(u,n,e,t)&&(u="center"),u}function Fd(n,e,t){const i=t.yAlign||e.yAlign||R$(n,t);return{xAlign:t.xAlign||e.xAlign||q$(n,e,t,i),yAlign:i}}function H$(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function j$(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function qd(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=lr(o);let h=H$(e,r);const g=j$(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:fi(h,0,i.width-e.width),y:fi(g,0,i.height-e.height)}}function Bo(n,e,t){const i=ol(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Hd(n){return gi([],Ni(n))}function z$(n,e,t){return Pl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function jd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const ty={beforeTitle:Ai,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?ty[e].call(t,i):l}class nu extends Ll{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new Hk(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=z$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=In(i,"beforeTitle",this,e),s=In(i,"title",this,e),o=In(i,"afterTitle",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}getBeforeBody(e,t){return Hd(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return _t(e,s=>{const o={before:[],lines:[],after:[]},r=jd(i,s);gi(o.before,Ni(In(r,"beforeLabel",this,s))),gi(o.lines,In(r,"label",this,s)),gi(o.after,Ni(In(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return Hd(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=In(i,"beforeFooter",this,e),s=In(i,"footer",this,e),o=In(i,"afterFooter",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),_t(r,f=>{const c=jd(e.callbacks,f);l.push(In(c,"labelColor",this,f)),s.push(In(c,"labelPointStyle",this,f)),o.push(In(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Ds[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Rd(this,i),u=Object.assign({},r,a),f=Fd(this.chart,i,u),c=qd(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=lr(r),{x:d,y:m}=e,{width:h,height:g}=t;let _,k,S,$,T,O;return s==="center"?(T=m+g/2,l==="left"?(_=d,k=_-o,$=T+o,O=T-o):(_=d+h,k=_+o,$=T-o,O=T+o),S=_):(l==="left"?k=d+Math.max(a,f)+o:l==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,s==="top"?($=m,T=$-o,_=k-o,S=k+o):($=m+g,T=$+o,_=k+o,S=k-o),O=$),{x1:_,x2:k,x3:S,y1:$,y2:T,y3:O}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=da(i.rtl,this.x,this.width);for(e.x=Bo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Si(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Xc(e,{x:g,y:h,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Xc(e,{x:_,y:h+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,h,u,a),e.strokeRect(g,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,h+1,u-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:u,boxPadding:f}=i,c=Si(i.bodyFont);let d=c.lineHeight,m=0;const h=da(i.rtl,this.x,this.width),g=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},_=h.textAlign(o);let k,S,$,T,O,E,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Bo(this,_,i),t.fillStyle=i.bodyColor,_t(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=l.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Ds[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Rd(this,e),a=Object.assign({},o,this._size),u=Fd(t,e,a),f=qd(e,a,u,t);(l._to!==f.x||s._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ol(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),ES(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),DS(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),s=!br(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!br(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Ds[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}pt(nu,"positioners",Ds);var U$={id:"tooltip",_element:nu,positioners:Ds,afterInit(n,e,t){t&&(n.tooltip=new nu({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ty},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function V$(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,h=f-1,{min:g,max:_}=e,k=!Gt(o),S=!Gt(r),$=!Gt(u),T=(_-g)/(c+1);let O=jc((_-g)/h/m)*m,E,L,I,A;if(O<1e-14&&!k&&!S)return[{value:g},{value:_}];A=Math.ceil(_/O)-Math.floor(g/O),A>h&&(O=jc(A*O/h/m)*m),Gt(a)||(E=Math.pow(10,a),O=Math.ceil(O*E)/E),l==="ticks"?(L=Math.floor(g/O)*O,I=Math.ceil(_/O)*O):(L=g,I=_),k&&S&&s&&v4((r-o)/s,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,L=o,I=r):$?(L=k?o:L,I=S?r:I,A=u-1,O=(I-L)/A):(A=(I-L)/O,Ol(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(zc(O),zc(L));E=Math.pow(10,Gt(a)?P:a),L=Math.round(L*E)/E,I=Math.round(I*E)/E;let N=0;for(k&&(d&&L!==o?(t.push({value:o}),Lr)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ol(t[t.length-1].value,r,zd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function zd(n,e,{horizontal:t,minRotation:i}){const l=Tl(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class B$ extends ho{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Gt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=sl(l),u=sl(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=V$(l,s);return e.bounds==="ticks"&&w4(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Ok(e,this.chart.options.locale,this.options.ticks.format)}}class iu extends B${determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=kn(e)?e:0,this.max=kn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Tl(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}pt(iu,"id","linear"),pt(iu,"defaults",{ticks:{callback:Ek.formatters.numeric}});const zr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nn=Object.keys(zr);function Ud(n,e){return n-e}function Vd(n,e){if(Gt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),kn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Xs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Bd(n,e,t,i){const l=Nn.length;for(let s=Nn.indexOf(n);s=Nn.indexOf(t);s--){const o=Nn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Nn[t?Nn.indexOf(t):0]}function Y$(n){for(let e=Nn.indexOf(n)+1,t=Nn.length;e=e?t[i]:t[l];n[s]=!0}}function K$(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Yd(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+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=fi(t,0,o),i=fi(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||Bd(s.minUnit,t,i,this._getLabelCapacity(t)),r=Mt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Xs(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"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+g)}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 ut(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}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}=$l(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}=$l(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Kd extends xs{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=Wo(t,this.min),this._tableRange=Wo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Wo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Wo(this._table,i*this._tableRange+this._minPos,!0)}}pt(Kd,"id","timeseries"),pt(Kd,"defaults",xs.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors @@ -40,79 +40,79 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */(function(n){(function(e,t,i,l){var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,u=Math.abs,f=Date.now;function c(K,Q,ne){return setTimeout($(K,ne),Q)}function d(K,Q,ne){return Array.isArray(K)?(m(K,ne[Q],ne),!0):!1}function m(K,Q,ne){var me;if(K)if(K.forEach)K.forEach(Q,ne);else if(K.length!==l)for(me=0;me\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ht=e.console&&(e.console.warn||e.console.log);return ht&&ht.call(e.console,me,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===l||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(Q),me=1;me-1}function P(K){return K.trim().split(/\s+/g)}function N(K,Q,ne){if(K.indexOf&&!ne)return K.indexOf(Q);for(var me=0;meTn[Q]}),me}function F(K,Q){for(var ne,me,Ae=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze1&&!ne.firstMultiple?ne.firstMultiple=Yt(Q):Ae===1&&(ne.firstMultiple=!1);var Ze=ne.firstInput,ht=ne.firstMultiple,rn=ht?ht.center:Ze.center,cn=Q.center=vn(me);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=bt(rn,cn),Q.distance=li(rn,cn),Re(ne,Q),Q.offsetDirection=Oi(Q.deltaX,Q.deltaY);var Tn=fn(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Tn.x,Q.overallVelocityY=Tn.y,Q.overallVelocity=u(Tn.x)>u(Tn.y)?Tn.x:Tn.y,Q.scale=ht?sn(ht.pointers,me):1,Q.rotation=ht?wn(ht.pointers,me):0,Q.maxPointers=ne.prevInput?Q.pointers.length>ne.prevInput.maxPointers?Q.pointers.length:ne.prevInput.maxPointers:Q.pointers.length,Ft(ne,Q);var hi=K.element;I(Q.srcEvent.target,hi)&&(hi=Q.srcEvent.target),Q.target=hi}function Re(K,Q){var ne=Q.center,me=K.offsetDelta||{},Ae=K.prevDelta||{},Ze=K.prevInput||{};(Q.eventType===et||Ze.eventType===We)&&(Ae=K.prevDelta={x:Ze.deltaX||0,y:Ze.deltaY||0},me=K.offsetDelta={x:ne.x,y:ne.y}),Q.deltaX=Ae.x+(ne.x-me.x),Q.deltaY=Ae.y+(ne.y-me.y)}function Ft(K,Q){var ne=K.lastInterval||Q,me=Q.timeStamp-ne.timeStamp,Ae,Ze,ht,rn;if(Q.eventType!=at&&(me>ft||ne.velocity===l)){var cn=Q.deltaX-ne.deltaX,Tn=Q.deltaY-ne.deltaY,hi=fn(me,cn,Tn);Ze=hi.x,ht=hi.y,Ae=u(hi.x)>u(hi.y)?hi.x:hi.y,rn=Oi(cn,Tn),K.lastInterval=Q}else Ae=ne.velocity,Ze=ne.velocityX,ht=ne.velocityY,rn=ne.direction;Q.velocity=Ae,Q.velocityX=Ze,Q.velocityY=ht,Q.direction=rn}function Yt(K){for(var Q=[],ne=0;ne=u(Q)?K<0?Ve:Ee:Q<0?st:De}function li(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.sqrt(me*me+Ae*Ae)}function bt(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.atan2(Ae,me)*180/Math.PI}function wn(K,Q){return bt(Q[1],Q[0],Ht)+bt(K[1],K[0],Ht)}function sn(K,Q){return li(Q[0],Q[1],Ht)/li(K[0],K[1],Ht)}var Dt={mousedown:et,mousemove:xe,mouseup:We},Mi="mousedown",ul="mousemove mouseup";function zi(){this.evEl=Mi,this.evWin=ul,this.pressed=!1,Le.apply(this,arguments)}S(zi,Le,{handler:function(Q){var ne=Dt[Q.type];ne&et&&Q.button===0&&(this.pressed=!0),ne&xe&&Q.which!==1&&(ne=We),this.pressed&&(ne&We&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[Q],changedPointers:[Q],pointerType:Ke,srcEvent:Q}))}});var Ui={pointerdown:et,pointermove:xe,pointerup:We,pointercancel:at,pointerout:at},fl={2:ue,3:Te,4:Ke,5:Je},Dn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Dn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Dn,this.evWin=Rl,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,Le,{handler:function(Q){var ne=this.store,me=!1,Ae=Q.type.toLowerCase().replace("ms",""),Ze=Ui[Ae],ht=fl[Q.pointerType]||Q.pointerType,rn=ht==ue,cn=N(ne,Q.pointerId,"pointerId");Ze&et&&(Q.button===0||rn)?cn<0&&(ne.push(Q),cn=ne.length-1):Ze&(We|at)&&(me=!0),!(cn<0)&&(ne[cn]=Q,this.callback(this.manager,Ze,{pointers:ne,changedPointers:[Q],pointerType:ht,srcEvent:Q}),me&&ne.splice(cn,1))}});var X={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},x="touchstart",le="touchstart touchmove touchend touchcancel";function ge(){this.evTarget=x,this.evWin=le,this.started=!1,Le.apply(this,arguments)}S(ge,Le,{handler:function(Q){var ne=X[Q.type];if(ne===et&&(this.started=!0),!!this.started){var me=Fe.call(this,Q,ne);ne&(We|at)&&me[0].length-me[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}}});function Fe(K,Q){var ne=R(K.touches),me=R(K.changedTouches);return Q&(We|at)&&(ne=z(ne.concat(me),"identifier")),[ne,me]}var Be={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},rt="touchstart touchmove touchend touchcancel";function se(){this.evTarget=rt,this.targetIds={},Le.apply(this,arguments)}S(se,Le,{handler:function(Q){var ne=Be[Q.type],me=Me.call(this,Q,ne);me&&this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}});function Me(K,Q){var ne=R(K.touches),me=this.targetIds;if(Q&(et|xe)&&ne.length===1)return me[ne[0].identifier]=!0,[ne,ne];var Ae,Ze,ht=R(K.changedTouches),rn=[],cn=this.target;if(Ze=ne.filter(function(Tn){return I(Tn.target,cn)}),Q===et)for(Ae=0;Ae-1&&me.splice(Ze,1)};setTimeout(Ae,Ne)}}function Sn(K){for(var Q=K.srcEvent.clientX,ne=K.srcEvent.clientY,me=0;me-1&&this.requireFail.splice(Q,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(K){return!!this.simultaneous[K.id]},emit:function(K){var Q=this,ne=this.state;function me(Ae){Q.manager.emit(Ae,K)}ne=Vi&&me(Q.options.event+af(ne))},tryEmit:function(K){if(this.canEmit())return this.emit(K);this.state=mi},canEmit:function(){for(var K=0;KQ.threshold&&Ae&Q.direction},attrTest:function(K){return si.prototype.attrTest.call(this,K)&&(this.state&Kn||!(this.state&Kn)&&this.directionTest(K))},emit:function(K){this.pX=K.deltaX,this.pY=K.deltaY;var Q=uf(K.direction);Q&&(K.additionalEvent=this.options.event+Q),this._super.emit.call(this,K)}});function Br(){si.apply(this,arguments)}S(Br,si,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.scale-1)>this.options.threshold||this.state&Kn)},emit:function(K){if(K.scale!==1){var Q=K.scale<1?"in":"out";K.additionalEvent=this.options.event+Q}this._super.emit.call(this,K)}});function Wr(){Li.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Li,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distanceQ.time;if(this._input=K,!me||!ne||K.eventType&(We|at)&&!Ae)this.reset();else if(K.eventType&et)this.reset(),this._timer=c(function(){this.state=Ii,this.tryEmit()},Q.time,this);else if(K.eventType&We)return Ii;return mi},reset:function(){clearTimeout(this._timer)},emit:function(K){this.state===Ii&&(K&&K.eventType&We?this.manager.emit(this.options.event+"up",K):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){si.apply(this,arguments)}S(Yr,si,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.rotation)>this.options.threshold||this.state&Kn)}});function Kr(){si.apply(this,arguments)}S(Kr,si,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ye|ve,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(K){var Q=this.options.direction,ne;return Q&(Ye|ve)?ne=K.overallVelocity:Q&Ye?ne=K.overallVelocityX:Q&ve&&(ne=K.overallVelocityY),this._super.attrTest.call(this,K)&&Q&K.offsetDirection&&K.distance>this.options.threshold&&K.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&K.eventType&We},emit:function(K){var Q=uf(K.offsetDirection);Q&&this.manager.emit(this.options.event+Q,K),this.manager.emit(this.options.event,K)}});function wo(){Li.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Li,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_s]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distance\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ht=e.console&&(e.console.warn||e.console.log);return ht&&ht.call(e.console,me,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===l||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(Q),me=1;me-1}function P(K){return K.trim().split(/\s+/g)}function N(K,Q,ne){if(K.indexOf&&!ne)return K.indexOf(Q);for(var me=0;meTn[Q]}),me}function F(K,Q){for(var ne,me,Ae=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze1&&!ne.firstMultiple?ne.firstMultiple=Yt(Q):Ae===1&&(ne.firstMultiple=!1);var Ze=ne.firstInput,ht=ne.firstMultiple,rn=ht?ht.center:Ze.center,cn=Q.center=vn(me);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=bt(rn,cn),Q.distance=li(rn,cn),Re(ne,Q),Q.offsetDirection=Oi(Q.deltaX,Q.deltaY);var Tn=fn(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Tn.x,Q.overallVelocityY=Tn.y,Q.overallVelocity=u(Tn.x)>u(Tn.y)?Tn.x:Tn.y,Q.scale=ht?sn(ht.pointers,me):1,Q.rotation=ht?wn(ht.pointers,me):0,Q.maxPointers=ne.prevInput?Q.pointers.length>ne.prevInput.maxPointers?Q.pointers.length:ne.prevInput.maxPointers:Q.pointers.length,Ft(ne,Q);var hi=K.element;I(Q.srcEvent.target,hi)&&(hi=Q.srcEvent.target),Q.target=hi}function Re(K,Q){var ne=Q.center,me=K.offsetDelta||{},Ae=K.prevDelta||{},Ze=K.prevInput||{};(Q.eventType===et||Ze.eventType===We)&&(Ae=K.prevDelta={x:Ze.deltaX||0,y:Ze.deltaY||0},me=K.offsetDelta={x:ne.x,y:ne.y}),Q.deltaX=Ae.x+(ne.x-me.x),Q.deltaY=Ae.y+(ne.y-me.y)}function Ft(K,Q){var ne=K.lastInterval||Q,me=Q.timeStamp-ne.timeStamp,Ae,Ze,ht,rn;if(Q.eventType!=at&&(me>ft||ne.velocity===l)){var cn=Q.deltaX-ne.deltaX,Tn=Q.deltaY-ne.deltaY,hi=fn(me,cn,Tn);Ze=hi.x,ht=hi.y,Ae=u(hi.x)>u(hi.y)?hi.x:hi.y,rn=Oi(cn,Tn),K.lastInterval=Q}else Ae=ne.velocity,Ze=ne.velocityX,ht=ne.velocityY,rn=ne.direction;Q.velocity=Ae,Q.velocityX=Ze,Q.velocityY=ht,Q.direction=rn}function Yt(K){for(var Q=[],ne=0;ne=u(Q)?K<0?Ve:Ee:Q<0?st:De}function li(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.sqrt(me*me+Ae*Ae)}function bt(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.atan2(Ae,me)*180/Math.PI}function wn(K,Q){return bt(Q[1],Q[0],Ht)+bt(K[1],K[0],Ht)}function sn(K,Q){return li(Q[0],Q[1],Ht)/li(K[0],K[1],Ht)}var Dt={mousedown:et,mousemove:xe,mouseup:We},Mi="mousedown",ul="mousemove mouseup";function zi(){this.evEl=Mi,this.evWin=ul,this.pressed=!1,Le.apply(this,arguments)}S(zi,Le,{handler:function(Q){var ne=Dt[Q.type];ne&et&&Q.button===0&&(this.pressed=!0),ne&xe&&Q.which!==1&&(ne=We),this.pressed&&(ne&We&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[Q],changedPointers:[Q],pointerType:Ke,srcEvent:Q}))}});var Ui={pointerdown:et,pointermove:xe,pointerup:We,pointercancel:at,pointerout:at},fl={2:ue,3:Te,4:Ke,5:Je},Dn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Dn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Dn,this.evWin=Rl,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,Le,{handler:function(Q){var ne=this.store,me=!1,Ae=Q.type.toLowerCase().replace("ms",""),Ze=Ui[Ae],ht=fl[Q.pointerType]||Q.pointerType,rn=ht==ue,cn=N(ne,Q.pointerId,"pointerId");Ze&et&&(Q.button===0||rn)?cn<0&&(ne.push(Q),cn=ne.length-1):Ze&(We|at)&&(me=!0),!(cn<0)&&(ne[cn]=Q,this.callback(this.manager,Ze,{pointers:ne,changedPointers:[Q],pointerType:ht,srcEvent:Q}),me&&ne.splice(cn,1))}});var X={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},x="touchstart",le="touchstart touchmove touchend touchcancel";function ge(){this.evTarget=x,this.evWin=le,this.started=!1,Le.apply(this,arguments)}S(ge,Le,{handler:function(Q){var ne=X[Q.type];if(ne===et&&(this.started=!0),!!this.started){var me=Fe.call(this,Q,ne);ne&(We|at)&&me[0].length-me[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}}});function Fe(K,Q){var ne=R(K.touches),me=R(K.changedTouches);return Q&(We|at)&&(ne=z(ne.concat(me),"identifier")),[ne,me]}var Be={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},rt="touchstart touchmove touchend touchcancel";function se(){this.evTarget=rt,this.targetIds={},Le.apply(this,arguments)}S(se,Le,{handler:function(Q){var ne=Be[Q.type],me=Me.call(this,Q,ne);me&&this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}});function Me(K,Q){var ne=R(K.touches),me=this.targetIds;if(Q&(et|xe)&&ne.length===1)return me[ne[0].identifier]=!0,[ne,ne];var Ae,Ze,ht=R(K.changedTouches),rn=[],cn=this.target;if(Ze=ne.filter(function(Tn){return I(Tn.target,cn)}),Q===et)for(Ae=0;Ae-1&&me.splice(Ze,1)};setTimeout(Ae,Ne)}}function Sn(K){for(var Q=K.srcEvent.clientX,ne=K.srcEvent.clientY,me=0;me-1&&this.requireFail.splice(Q,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(K){return!!this.simultaneous[K.id]},emit:function(K){var Q=this,ne=this.state;function me(Ae){Q.manager.emit(Ae,K)}ne=Vi&&me(Q.options.event+af(ne))},tryEmit:function(K){if(this.canEmit())return this.emit(K);this.state=mi},canEmit:function(){for(var K=0;KQ.threshold&&Ae&Q.direction},attrTest:function(K){return si.prototype.attrTest.call(this,K)&&(this.state&Kn||!(this.state&Kn)&&this.directionTest(K))},emit:function(K){this.pX=K.deltaX,this.pY=K.deltaY;var Q=uf(K.direction);Q&&(K.additionalEvent=this.options.event+Q),this._super.emit.call(this,K)}});function Br(){si.apply(this,arguments)}S(Br,si,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.scale-1)>this.options.threshold||this.state&Kn)},emit:function(K){if(K.scale!==1){var Q=K.scale<1?"in":"out";K.additionalEvent=this.options.event+Q}this._super.emit.call(this,K)}});function Wr(){Li.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Li,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distanceQ.time;if(this._input=K,!me||!ne||K.eventType&(We|at)&&!Ae)this.reset();else if(K.eventType&et)this.reset(),this._timer=c(function(){this.state=Ii,this.tryEmit()},Q.time,this);else if(K.eventType&We)return Ii;return mi},reset:function(){clearTimeout(this._timer)},emit:function(K){this.state===Ii&&(K&&K.eventType&We?this.manager.emit(this.options.event+"up",K):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){si.apply(this,arguments)}S(Yr,si,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.rotation)>this.options.threshold||this.state&Kn)}});function Kr(){si.apply(this,arguments)}S(Kr,si,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ye|ve,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(K){var Q=this.options.direction,ne;return Q&(Ye|ve)?ne=K.overallVelocity:Q&Ye?ne=K.overallVelocityX:Q&ve&&(ne=K.overallVelocityY),this._super.attrTest.call(this,K)&&Q&K.offsetDirection&&K.distance>this.options.threshold&&K.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&K.eventType&We},emit:function(K){var Q=uf(K.offsetDirection);Q&&this.manager.emit(this.options.event+Q,K),this.manager.emit(this.options.event,K)}});function wo(){Li.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Li,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_s]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distancen&&n.enabled&&n.modifierKey,iy=(n,e)=>n&&e[n+"Key"],Xu=(n,e)=>n&&!e[n+"Key"];function rl(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ya(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function X$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function Q$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function ly(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=Q$(e,t),r=ya(i,t),a=ya(l,t);if(s){const f=ya(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return _t(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const lu=new WeakMap;function Vt(n){let e=lu.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},lu.set(n,e)),e}function x$(n){lu.delete(n)}function sy(n,e,t,i){const l=Math.max(0,Math.min(1,(n-e)/t||0)),s=1-l;return{min:i*l,max:i*s}}function oy(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function ry(n,e,t){const i=n.max-n.min,l=i*(e-1),s=oy(n,t);return sy(s,n.min,i,l)}function eC(n,e,t){const i=oy(n,t);if(i===void 0)return{min:n.min,max:n.max};const l=Math.log10(n.min),s=Math.log10(n.max),o=Math.log10(i),r=s-l,a=r*(e-1),u=sy(o,l,r,a);return{min:Math.pow(10,l+u.min),max:Math.pow(10,s-u.max)}}function tC(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Jd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Mt(o.options,o.scale)}return Mt(s,l)}function nC(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function iC(n,{min:e,max:t,minLimit:i,maxLimit:l},s){const o=(n-t+e)/2;e-=o,t+=o;const r=s.min.options??s.min.scale,a=s.max.options??s.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),el&&(t=l,e=Math.max(l-n,i)),{min:e,max:t}}function Nl(n,{min:e,max:t},i,l=!1){const s=Vt(n.chart),{options:o}=n,r=tC(n,i),{minRange:a=0}=r,u=Jd(s,n,r,"min",-1/0),f=Jd(s,n,r,"max",1/0);if(l==="pan"&&(ef))return!0;const c=n.max-n.min,d=l?Math.max(t-e,a):c;if(l&&d===a&&c<=a)return!0;const m=iC(d,{min:e,max:t,minLimit:u,maxLimit:f},s.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,s.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function lC(n,e,t,i){const l=ry(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return Nl(n,s,i,!0)}function sC(n,e,t,i){const l=eC(n,e,t);return Nl(n,l,i,!0)}function oC(n,e,t,i){Nl(n,nC(n,e,t),i,!0)}const Zd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function rC(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),Nl(n,{min:s,max:o},t)||f}const cC={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function ay(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=cC[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e);return isNaN(u)||isNaN(f)?!0:Nl(n,{min:u,max:f},t,i?"pan":!1)}function Gd(n,e,t){return ay(n,e,t,!0)}const su={category:aC,default:lC,logarithmic:sC},ou={default:oC},ru={category:fC,default:ay,logarithmic:Gd,timeseries:Gd};function dC(n,e,t){const{id:i,options:{min:l,max:s}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==l||o.max!==s}function Xd(n,e){_t(n,(t,i)=>{e[i]||delete n[i]})}function ds(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return _t(t,function(s){dC(s,i,l)&&(i[s.id]={min:{scale:s.min,options:s.options.min},max:{scale:s.max,options:s.options.max}})}),Xd(i,t),Xd(l,t),i}function Qd(n,e,t,i){const l=su[n.type]||su.default;ut(l,[n,e,t,i])}function xd(n,e,t,i){const l=ou[n.type]||ou.default;ut(l,[n,e,t,i])}function pC(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Qu(n,e,t="none",i="api"){const{x:l=1,y:s=1,focalPoint:o=pC(n)}=typeof e=="number"?{x:e,y:e}:e,r=Vt(n),{options:{limits:a,zoom:u}}=r;ds(n,r);const f=l!==1,c=s!==1,d=ly(u,o,n);_t(d||n.scales,function(m){m.isHorizontal()&&f?Qd(m,l,o,a):!m.isHorizontal()&&c&&Qd(m,s,o,a)}),n.update(t),ut(u.onZoom,[{chart:n,trigger:i}])}function uy(n,e,t,i="none",l="api"){const s=Vt(n),{options:{limits:o,zoom:r}}=s,{mode:a="xy"}=r;ds(n,s);const u=rl(a,"x",n),f=rl(a,"y",n);_t(n.scales,function(c){c.isHorizontal()&&u?xd(c,e.x,t.x,o):!c.isHorizontal()&&f&&xd(c,e.y,t.y,o)}),n.update(i),ut(r.onZoom,[{chart:n,trigger:l}])}function mC(n,e,t,i="none",l="api"){var r;const s=Vt(n);ds(n,s);const o=n.scales[e];Nl(o,t,void 0,!0),n.update(i),ut((r=s.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:l}])}function hC(n,e="default"){const t=Vt(n),i=ds(n,t);_t(n.scales,function(l){const s=l.options;i[l.id]?(s.min=i[l.id].min.options,s.max=i[l.id].max.options):(delete s.min,delete s.max),delete t.updatedScaleLimits[l.id]}),n.update(e),ut(t.options.zoom.onZoomComplete,[{chart:n}])}function _C(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Mt(l.options,l.scale)-Mt(i.options,i.scale)}function gC(n){const e=Vt(n);let t=1,i=1;return _t(n.scales,function(l){const s=_C(e,l.id);if(s){const o=Math.round(s/(l.max-l.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function ep(n,e,t,i){const{panDelta:l}=i,s=l[n.id]||0;sl(s)===sl(e)&&(e+=s);const o=ru[n.type]||ru.default;ut(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function fy(n,e,t,i="none"){const{x:l=0,y:s=0}=typeof e=="number"?{x:e,y:e}:e,o=Vt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ds(n,o);const f=l!==0,c=s!==0;_t(t||n.scales,function(d){d.isHorizontal()&&f?ep(d,l,a,o):!d.isHorizontal()&&c&&ep(d,s,a,o)}),n.update(i),ut(u,[{chart:n}])}function cy(n){const e=Vt(n);ds(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:l,max:s}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:l.scale,max:s.scale}}return t}function bC(n){const e=Vt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function kC(n){const e=cy(n);for(const t of Object.keys(n.scales)){const{min:i,max:l}=e[t];if(i!==void 0&&n.scales[t].min!==i||l!==void 0&&n.scales[t].max!==l)return!0}return!1}function tp(n){const e=Vt(n);return e.panning||e.dragging}const np=(n,e,t)=>Math.min(t,Math.max(e,n));function An(n,e){const{handlers:t}=Vt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:l,options:s}=Vt(n),o=l[t];if(o&&o.target===e)return;An(n,t),l[t]=a=>i(n,a,s),l[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,l[t],{passive:r})}function yC(n,e){const t=Vt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function vC(n,e){const t=Vt(n);!t.dragStart||e.key!=="Escape"||(An(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function au(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return yi(n,e)}function dy(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=au(e,n);if(ut(i,[{chart:n,event:e,point:s}])===!1)return ut(l,[{chart:n,event:e}]),!1}}function wC(n,e){if(n.legend){const s=yi(e,n);if(ls(s,n.legend))return}const t=Vt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||iy(eo(i),e)||Xu(eo(l.drag),e))return ut(l.onZoomRejected,[{chart:n,event:e}]);dy(n,e,l)!==!1&&(t.dragStart=e,Hs(n,n.canvas.ownerDocument,"mousemove",yC),Hs(n,window.document,"keydown",vC))}function SC({begin:n,end:e},t){let i=e.x-n.x,l=e.y-n.y;const s=Math.abs(i/l);s>t?i=Math.sign(i)*Math.abs(l*t):s=0?2-1/(1-s):1+s,r={x:o,y:o,focalPoint:{x:e.clientX-l.left,y:e.clientY-l.top}};Qu(n,r,"zoom","wheel"),ut(t,[{chart:n}])}function MC(n,e,t,i){t&&(Vt(n).handlers[e]=X$(()=>ut(t,[{chart:n}]),i))}function EC(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(Hs(n,t,"wheel",OC),MC(n,"onZoomComplete",s,250)):An(n,"wheel"),l.enabled?(Hs(n,t,"mousedown",wC),Hs(n,t.ownerDocument,"mouseup",$C)):(An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"keydown"))}function DC(n){An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"wheel"),An(n,"click"),An(n,"keydown")}function IC(n,e){return function(t,i){const{pan:l,zoom:s={}}=e.options;if(!l||!l.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(Xu(eo(l),o)||iy(eo(s.drag),o))?(ut(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function LC(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),l=t/i;let s,o;return l>.3&&l<1.7?s=o=!0:t>i?s=!0:o=!0,{x:s,y:o}}function my(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=LC(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&rl(a,"x",n)?s:1,y:r.y&&rl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Qu(n,u,"zoom","pinch"),e.scale=t.scale}}function AC(n,e,t){if(e.options.zoom.pinch.enabled){const i=yi(t,n);ut(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ut(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function PC(n,e,t){e.scale&&(my(n,e,t),e.scale=null,ut(e.options.zoom.onZoomComplete,[{chart:n}]))}function hy(n,e,t){const i=e.delta;i&&(e.panning=!0,fy(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function NC(n,e,t){const{enabled:i,onPanStart:l,onPanRejected:s}=e.options.pan;if(!i)return;const o=t.target.getBoundingClientRect(),r={x:t.center.x-o.left,y:t.center.y-o.top};if(ut(l,[{chart:n,event:t,point:r}])===!1)return ut(s,[{chart:n,event:t}]);e.panScales=ly(e.options.pan,r,n),e.delta={x:0,y:0},hy(n,e,t)}function RC(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ut(e.options.pan.onPanComplete,[{chart:n}]))}const uu=new WeakMap;function lp(n,e){const t=Vt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new qs.Manager(i);s&&s.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",r=>AC(n,t,r)),o.on("pinch",r=>my(n,t,r)),o.on("pinchend",r=>PC(n,t,r))),l&&l.enabled&&(o.add(new qs.Pan({threshold:l.threshold,enable:IC(n,t)})),o.on("panstart",r=>NC(n,t,r)),o.on("panmove",r=>hy(n,t,r)),o.on("panend",()=>RC(n,t))),uu.set(n,o)}function sp(n){const e=uu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),uu.delete(n))}function FC(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:l,zoom:s}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=s==null?void 0:s.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(l==null?void 0:l.enabled)||(t==null?void 0:t.threshold)!==(l==null?void 0:l.threshold)}var qC="2.2.0";function Yo(n,e,t){const i=t.zoom.drag,{dragStart:l,dragEnd:s}=Vt(n);if(i.drawTime!==e||!s)return;const{left:o,top:r,width:a,height:u}=py(n,t.zoom.mode,{dragStart:l,dragEnd:s},i.maintainAspectRatio),f=n.ctx;f.save(),f.beginPath(),f.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",f.fillRect(o,r,a,u),i.borderWidth>0&&(f.lineWidth=i.borderWidth,f.strokeStyle=i.borderColor||"rgba(225,225,225)",f.strokeRect(o,r,a,u)),f.restore()}var HC={id:"zoom",version:qC,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,e,t){const i=Vt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&lp(n,t),n.pan=(l,s,o)=>fy(n,l,s,o),n.zoom=(l,s)=>Qu(n,l,s),n.zoomRect=(l,s,o)=>uy(n,l,s,o),n.zoomScale=(l,s,o)=>mC(n,l,s,o),n.resetZoom=l=>hC(n,l),n.getZoomLevel=()=>gC(n),n.getInitialScaleBounds=()=>cy(n),n.getZoomedScaleBounds=()=>bC(n),n.isZoomedOrPanned=()=>kC(n),n.isZoomingOrPanning=()=>tp(n)},beforeEvent(n,{event:e}){if(tp(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Vt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Vt(n),l=i.options;i.options=t,FC(l,t)&&(sp(n),lp(n,t)),EC(n,t)},beforeDatasetsDraw(n,e,t){Yo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Yo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Yo(n,"beforeDraw",t)},afterDraw(n,e,t){Yo(n,"afterDraw",t)},stop:function(n){DC(n),qs&&sp(n),x$(n)},panFunctions:ru,zoomFunctions:su,zoomRectFunctions:ou};function op(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(l,s){v(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,$t,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&y(e),l&&t&&t.end()}}}function rp(n){let e,t,i;return{c(){e=b("button"),e.textContent="Reset zoom",p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-chart-zoom svelte-kfnurg")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[4]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function jC(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&op(),g=n[3]&&rp(n);return{c(){e=b("div"),t=b("div"),i=B("Found "),l=B(n[1]),s=C(),r=B(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),ee(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),ee(e,"loading",n[2])},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(t,r),w(e,a),h&&h.m(e,null),w(e,u),w(e,f),n[11](f),w(e,c),g&&g.m(e,null),d||(m=W(f,"dblclick",n[4]),d=!0)},p(_,[k]){k&2&&oe(l,_[1]),k&2&&o!==(o=_[1]==1?"log":"logs")&&oe(r,o),k&4&&ee(t,"hidden",_[2]),_[2]?h?k&4&&O(h,1):(h=op(),h.c(),O(h,1),h.m(e,u)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),_[3]?g?g.p(_,k):(g=rp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k&4&&ee(e,"loading",_[2])},i(_){O(h)},o(_){D(h)},d(_){_&&y(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function zC(n,e,t){let{filter:i=""}=e,{zoom:l={}}=e,{presets:s=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const _=[s,V.normalizeLogsFilter(i)].filter(Boolean).map(k=>"("+k+")").join("&&");return _e.logs.getStats({filter:_}).then(k=>{m(),k=V.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),_e.error(k,!_||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}Xt(()=>(vi.register(Qi,ar,sr,iu,xs,P$,U$),vi.register(HC),t(9,r=new vi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:_=>{var k;return(k=_.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:_=>{var k;return(k=_.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:_})=>{t(3,c=_.isZoomedOrPanned()),c?(t(5,l.min=V.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=V.formatToUTCDate(_.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",l)):(l.min||l.max)&&t(5,l={})}}}}}})),()=>r==null?void 0:r.destroy()));function g(_){ie[_?"unshift":"push"](()=>{o=_,t(0,o)})}return n.$$set=_=>{"filter"in _&&t(6,i=_.filter),"zoom"in _&&t(5,l=_.zoom),"presets"in _&&t(7,s=_.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof s<"u")&&d(),n.$$.dirty&1536&&typeof a<"u"&&r&&(t(9,r.data.datasets[0].data=a,r),r.update())},[o,u,f,c,h,l,i,s,d,r,a,g]}class UC extends Se{constructor(e){super(),we(this,e,zC,jC,ke,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function VC(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){v(l,e,s),w(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(l){l&&y(e)}}}function BC(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class xu extends Se{constructor(e){super(),we(this,e,BC,VC,ke,{content:2,language:3,class:0})}}function WC(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){v(o,e,r),l||(s=[Oe(i=qe.call(null,e,n[3]?void 0:n[0])),W(e,"click",On(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&It(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&y(e),l=!1,Ie(s)}}}function YC(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function u(){V.isEmpty(i)||(V.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Xt(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,l=f.tooltip),"idleClasses"in f&&t(1,s=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[l,s,o,a,u,i,r]}class $i extends Se{constructor(e){super(),we(this,e,YC,WC,ke,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function ap(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=V.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function KC(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P,N,R,z,F,U,J,Y;d=new $i({props:{value:n[1].id}}),S=new gk({props:{level:n[1].level}}),M=new $i({props:{value:n[1].level}}),N=new _k({props:{date:n[1].created}}),F=new $i({props:{value:n[1].created}});let Z=!n[4]&&up(n),G=de(n[5](n[1].data)),pe=[];for(let ue=0;ueD(pe[ue],1,1,()=>{pe[ue]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=C(),o=b("td"),r=b("span"),u=B(a),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("tr"),g=b("td"),g.textContent="level",_=C(),k=b("td"),j(S.$$.fragment),$=C(),T=b("div"),j(M.$$.fragment),E=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),j(N.$$.fragment),R=C(),z=b("div"),j(F.$$.fragment),U=C(),Z&&Z.c(),J=C();for(let ue=0;ue{Z=null}),ae()):Z?(Z.p(ue,Te),Te&16&&O(Z,1)):(Z=up(ue),Z.c(),O(Z,1),Z.m(t,J)),Te&50){G=de(ue[5](ue[1].data));let We;for(We=0;We',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function up(n){let e,t,i,l,s,o,r;const a=[GC,ZC],u=[];function f(c,d){return c[1].message?0:1}return s=f(n),o=u[s]=a[s](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),l=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(l,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),u[s].m(l,null),r=!0},p(c,d){let m=s;s=f(c),s===m?u[s].p(c,d):(re(),D(u[m],1,1,()=>{u[m]=null}),ae(),o=u[s],o?o.p(c,d):(o=u[s]=a[s](c),o.c()),O(o,1),o.m(l,null))},i(c){r||(O(o),r=!0)},o(c){D(o),r=!1},d(c){c&&y(e),u[s].d()}}}function ZC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function GC(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new $i({props:{value:n[1].message}}),{c(){e=b("span"),i=B(t),l=C(),s=b("div"),j(o.$$.fragment),p(e,"class","txt"),p(s,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),q(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&oe(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(y(e),y(l),y(s)),H(o)}}}function XC(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=B(t),s=B(l),p(e,"class","txt")},m(o,r){v(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:te,o:te,d(o){o&&y(e)}}}function QC(n){let e,t;return e=new xu({props:{content:n[17],language:"html"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xC(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function e6(n){let e,t;return e=new xu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function t6(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function fp(n){let e,t,i;return t=new $i({props:{value:n[17]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function cp(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[t6,e6,xC,QC,XC],h=[];function g(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=g(n),u=h[a]=m[a](n);let _=!n[18]&&fp(n);return{c(){e=b("tr"),t=b("td"),i=B("data."),s=B(l),o=C(),r=b("td"),u.c(),f=C(),_&&_.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),ee(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){v(k,e,S),w(e,t),w(t,i),w(t,s),w(e,o),w(e,r),h[a].m(r,null),w(r,f),_&&_.m(r,null),w(e,c),d=!0},p(k,S){(!d||S&2)&&l!==(l=k[16]+"")&&oe(s,l),(!d||S&34)&&ee(t,"v-align-top",k[19]);let $=a;a=g(k),a===$?h[a].p(k,S):(re(),D(h[$],1,1,()=>{h[$]=null}),ae(),u=h[a],u?u.p(k,S):(u=h[a]=m[a](k),u.c()),O(u,1),u.m(r,f)),k[18]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&2&&O(_,1)):(_=fp(k),_.c(),O(_,1),_.m(r,null))},i(k){d||(O(u),O(_),d=!0)},o(k){D(u),D(_),d=!1},d(k){k&&y(e),h[a].d(),_&&_.d()}}}function n6(n){let e,t,i,l;const s=[JC,KC],o=[];function r(a,u){var f;return a[3]?0:(f=a[1])!=null&&f.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,u){~e&&o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(re(),D(o[f],1,1,()=>{o[f]=null}),ae()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),~e&&o[e].d(a)}}}function i6(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function l6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),l=b("i"),s=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(u,f){v(u,e,f),v(u,t,f),v(u,i,f),w(i,l),w(i,s),w(i,o),r||(a=[W(e,"click",n[9]),W(i,"click",n[10])],r=!0)},p(u,f){f&8&&(i.disabled=u[3])},d(u){u&&(y(e),y(t),y(i)),r=!1,Ie(a)}}}function s6(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[l6],header:[i6],default:[n6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}const dp="log_view";function o6(n,e,t){let i;const l=kt();let s,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),h()}),s==null?void 0:s.show()}function u(){return _e.cancelRequest(dp),s==null?void 0:s.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await _e.logs.getOne($,{requestKey:dp})}catch(M){M.isAbort||(u(),console.warn("resolveModel:",M),Ci(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let E of c)typeof $[E]<"u"&&T.push(E);const M=Object.keys($);for(let E of M)T.includes(E)||T.push(E);return T}function m(){V.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function g(){l("hide",o),t(1,o={})}const _=()=>u(),k=()=>m();function S($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,s,r,i,d,m,g,a,_,k,S]}class r6 extends Se{constructor(e){super(),we(this,e,o6,s6,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function a6(n,e,t){const i=n.slice();return i[1]=e[t],i}function u6(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function f6(n){let e,t,i,l=de(x0),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class _y extends Se{constructor(e){super(),we(this,e,c6,f6,ke,{class:0})}}function d6(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[m6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[h6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[_6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[g6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=W(e,"submit",nt(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(O(t.$$.fragment,d),O(l.$$.fragment,d),O(o.$$.fragment,d),O(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&y(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function p6(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function m6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[1].logs.maxDays),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&>(s.value)!==c[1].logs.maxDays&&he(s,c[1].logs.maxDays)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function h6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new _y({}),{c(){e=b("label"),t=B("Min log level"),l=C(),s=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=W(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&>(s.value)!==h[1].logs.minLevel&&he(s,h[1].logs.minLevel)},i(h){c||(O(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(y(e),y(l),y(s),y(o),y(r)),H(f),d=!1,m()}}}function _6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function g6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function b6(n){let e,t,i,l;const s=[p6,d6],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function k6(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function y6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),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(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&ee(l,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function v6(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[y6],header:[k6],default:[b6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function w6(n,e,t){let i,l;const s=kt(),o="logs_settings_"+V.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Ut(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await _e.settings.getAll()||{};k(P)}catch(P){_e.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await _e.settings.update(V.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),_e.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=gt(this.value),t(1,c)}function $(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function M(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,_,d,f,i,S,$,T,M,E,L,I,A]}class S6 extends Se{constructor(e){super(),we(this,e,w6,v6,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function T6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function pp(n){let e,t,i;function l(o){n[14](o)}let s={filter:n[1],presets:n[6]};return n[5]!==void 0&&(s.zoom=n[5]),e=new UC({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function mp(n){let e,t,i,l;function s(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new U3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){l||(O(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function $6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T=n[4],M,E=n[4],L,I,A,P;u=new Pu({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[T6,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new _y({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=pp(n),R=mp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=B(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),j(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),j(h.$$.fragment),g=C(),j(_.$$.fragment),k=C(),j(S.$$.fragment),$=C(),N.c(),M=C(),R.c(),L=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(z,F){v(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,g),q(_,e,null),w(e,k),q(S,e,null),w(e,$),N.m(e,null),v(z,M,F),R.m(z,F),v(z,L,F),I=!0,A||(P=[Oe(qe.call(null,r,{text:"Logs settings",position:"right"})),W(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&oe(s,z[7]);const U={};F&100663300&&(U.$$scope={dirty:F,ctx:z}),h.$set(U);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&ke(T,T=z[4])?(re(),D(N,1,1,te),ae(),N=pp(z),N.c(),O(N,1),N.m(e,null)):N.p(z,F),F&16&&ke(E,E=z[4])?(re(),D(R,1,1,te),ae(),R=mp(z),R.c(),O(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(O(u.$$.fragment,z),O(h.$$.fragment,z),O(_.$$.fragment,z),O(S.$$.fragment,z),O(N),O(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(y(e),y(M),y(L)),H(u),H(h),H(_),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function C6(n){let e,t,i,l,s,o;e=new pi({props:{$$slots:{default:[$6]},$$scope:{ctx:n}}});let r={};i=new r6({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new S6({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(u,f){q(e,u,f),v(u,t,f),q(i,u,f),v(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(O(e.$$.fragment,u),O(i.$$.fragment,u),O(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(y(t),y(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Ko="logId",hp="superuserRequests",_p="superuserLogRequests";function O6(n,e,t){var R;let i,l,s;Qe(n,Au,z=>t(22,l=z)),Qe(n,un,z=>t(7,s=z)),Rn(un,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(hp)||((R=window.localStorage)==null?void 0:R.getItem(_p)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[hp]=d<<0||null,V.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function M(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var U;let F={};F[Ko]=((U=z.detail)==null?void 0:U.id)||null,V.replaceHashQueryParams(F)},P=()=>{let z={};z[Ko]=null,V.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Ko)&&r&&r.show(o.get(Ko)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(_p,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,k,S,$,T,M,E,L,I,A,P,N]}class M6 extends Se{constructor(e){super(),we(this,e,O6,C6,ke,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function yp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function E6(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=B(t),l=C(),p(e,"type","button"),p(e,"class","sidebar-item"),ee(e,"active",n[5]===n[14])},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&oe(i,t),u&40&&ee(e,"active",n[5]===n[14])},d(a){a&&y(e),s=!1,o()}}}function D6(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=B(t),l=C(),p(e,"class","sidebar-item disabled")},m(r,a){v(r,e,a),w(e,i),w(e,l),s||(o=Oe(qe.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&oe(i,t)},d(r){r&&y(e),s=!1,o()}}}function vp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&yp();function r(f,c){return f[15].disabled?D6:E6}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ye(),o&&o.c(),l=C(),u.c(),s=ye(),this.first=t},m(f,c){v(f,t,c),o&&o.m(f,c),v(f,l,c),u.m(f,c),v(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=yp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(y(t),y(l),y(s)),o&&o.d(f),u.d(f)}}}function wp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:A6,then:L6,catch:I6,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){v(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&mf(t,l)||Jy(l,n,o)},i(s){i||(O(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&y(e),l.block.d(s),l.token=null,l=null}}}function I6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function L6(n){bp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=C()},m(l,s){q(e,l,s),v(l,t,s),i=!0},p(l,s){bp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(O(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&y(t),H(e,l)}}}function A6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Sp(n,e){let t,i,l,s=e[5]===e[14]&&wp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){v(o,t,r),s&&s.m(o,r),v(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&O(s,1)):(s=wp(e),s.c(),O(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(O(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(y(t),y(i)),s&&s.d(o)}}}function P6(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=de(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[8]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function R6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[N6],default:[P6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function F6(n,e,t){const i={list:{label:"List/Search",component:Tt(()=>import("./ListApiDocs-B1zjO_1B.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Tt(()=>import("./ViewApiDocs-Dd7XOl9A.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Tt(()=>import("./CreateApiDocs-DOHOivQZ.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Tt(()=>import("./UpdateApiDocs-DsdeVsYD.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Tt(()=>import("./DeleteApiDocs-Cq92M3qc.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Tt(()=>import("./RealtimeApiDocs-CLgiyZ5n.js"),[],import.meta.url)},batch:{label:"Batch",component:Tt(()=>import("./BatchApiDocs-BXCzlbPG.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Tt(()=>import("./AuthMethodsDocs-BJf1CDOL.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Tt(()=>import("./AuthWithPasswordDocs-Bcbb3J5u.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Tt(()=>import("./AuthWithOAuth2Docs-DSr9eqoG.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Tt(()=>import("./AuthWithOtpDocs-D5DhPmCe.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Tt(()=>import("./AuthRefreshDocs-Cil4P-ZL.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Tt(()=>import("./VerificationDocs-Bojha8VY.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Tt(()=>import("./PasswordResetDocs-Dnq0sANu.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Tt(()=>import("./EmailChangeDocs-uPQ6URGG.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ie[k?"unshift":"push"](()=>{s=k,t(4,s)})}function g(k){Pe.call(this,n,k)}function _(k){Pe.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime,delete a.batch):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,h,g,_]}class q6 extends Se{constructor(e){super(),we(this,e,F6,R6,ke,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}const H6=n=>({active:n&1}),Tp=n=>({active:n[0]});function $p(n){let e,t,i;const l=n[15].default,s=Lt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){v(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Pt(s,l,o,o[14],i?At(l,o[14],r,null):Nt(o[14]),null)},i(o){i||(O(s,o),o&&tt(()=>{i&&(t||(t=He(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),o&&t&&t.end()}}}function j6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(a,n,n[14],Tp);let f=n[0]&&$p(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(e,"active",n[0])},m(c,d){v(c,e,d),w(e,t),u&&u.m(t,null),w(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[W(t,"click",nt(n[17])),W(t,"drop",nt(n[18])),W(t,"dragstart",n[19]),W(t,"dragenter",n[20]),W(t,"dragleave",n[21]),W(t,"dragover",nt(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&Pt(u,a,c,c[14],s?At(a,c[14],d,H6):Nt(c[14]),Tp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&O(f,1)):(f=$p(c),f.c(),O(f,1),f.m(e,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&ee(e,"active",c[0])},i(c){s||(O(u,c),O(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&y(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function z6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function g(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of P)N.click()}}Xt(()=>()=>clearTimeout(r));function $(P){Pe.call(this,n,P)}const T=()=>c&&k(),M=P=>{u&&(t(7,m=!1),S(),s("drop",P))},E=P=>u&&s("dragstart",P),L=P=>{u&&(t(7,m=!0),s("dragenter",P))},I=P=>{u&&(t(7,m=!1),s("dragleave",P))};function A(P){ie[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,s,d,h,g,_,r,l,i,$,T,M,E,L,I,A]}class ji extends Se{constructor(e){super(),we(this,e,z6,j6,ke,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function Cp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Op(n,e,t){const i=n.slice();return i[25]=e[t],i}function Mp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Mp(n);return{c(){e=b("label"),t=B("Subject"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(e,"for",i=n[24]),p(s,"type","text"),p(s,"id",o=n[24]),p(s,"spellcheck","false"),s.required=!0},m(m,h){v(m,e,h),w(e,t),v(m,l,h),v(m,s,h),he(s,n[0].subject),v(m,r,h),c&&c.m(m,h),v(m,a,h),u||(f=W(s,"input",n[14]),u=!0)},p(m,h){var g;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(s,"id",o),h&1&&s.value!==m[0].subject&&he(s,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Mp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(m),u=!1,f()}}}function V6(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){v(s,e,o),he(e,n[0].body),i||(l=W(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&he(e,s[0].body)},i:te,o:te,d(s){s&&y(e),i=!1,l()}}}function B6(n){let e,t,i,l;function s(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),O(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function Dp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Dp(n);return{c(){e=b("label"),t=B("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ye(),p(e,"for",i=n[24])},m(g,_){v(g,e,_),w(e,t),v(g,l,_),c[s].m(g,_),v(g,r,_),m&&m.m(g,_),v(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=s;s=d(g),s===k?c[s].p(g,_):(re(),D(c[k],1,1,()=>{c[k]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),O(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Dp(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(O(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(y(e),y(l),y(r),y(a)),c[s].d(g),m&&m.d(g)}}}function Y6(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[U6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[W6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function Lp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function K6(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Lp();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),s=B(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),v(c,o,d),v(c,r,d),v(c,a,d),f&&f.m(c,d),v(c,u,d)},p(c,d){d&4&&oe(s,c[2]),c[7]?f?d&128&&O(f,1):(f=Lp(),f.c(),O(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(o),y(r),y(a),y(u)),f&&f.d(c)}}}function J6(n){let e,t;const i=[n[9]];let l={$$slots:{header:[K6],default:[Y6]},$$scope:{ctx:n}};for(let s=0;st(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ap,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Tt(async()=>{const{default:R}=await import("./CodeEditor-7pyapRXP.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Ap=d,t(6,m=!1))}function S(R){R=R.replace("*",""),V.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function M(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}function N(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Wt(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||Yn(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,$,T,M,E,L,I,A,P,N]}class G6 extends Se{constructor(e){super(),we(this,e,Z6,J6,ke,{key:1,title:2,config:0,placeholders:3,expand:10,collapse:11,collapseSiblings:12})}get expand(){return this.$$.ctx[10]}get collapse(){return this.$$.ctx[11]}get collapseSiblings(){return this.$$.ctx[12]}}function X6(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=B(n[3]),i=B(" duration (in seconds)"),s=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),ee(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){v(m,e,h),w(e,t),w(e,i),v(m,s,h),v(m,o,h),he(o,n[0]),v(m,a,h),v(m,u,h),w(u,f),c||(d=[W(o,"input",n[4]),W(f,"click",n[5])],c=!0)},p(m,h){h&8&&oe(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&>(o.value)!==m[0]&&he(o,m[0]),h&2&&ee(f,"txt-success",!!m[1])},d(m){m&&(y(e),y(s),y(o),y(a),y(u)),c=!1,Ie(d)}}}function Q6(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[X6,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function x6(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class e5 extends Se{constructor(e){super(),we(this,e,x6,Q6,ke,{key:2,label:3,duration:0,secret:1})}}function Pp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Np(n,e){let t,i,l,s,o,r;function a(c){e[5](c,e[8])}function u(c){e[6](c,e[8])}let f={key:e[8].key,label:e[8].label};return e[0][e[8].key].duration!==void 0&&(f.duration=e[0][e[8].key].duration),e[0][e[8].key].secret!==void 0&&(f.secret=e[0][e[8].key].secret),i=new e5({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,$e(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,$e(()=>s=!1)),i.$set(m)},i(c){r||(O(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&y(t),H(i)}}}function t5(n){let e,t=[],i=new Map,l,s=de(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o=n[2]&&Rp();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),l=C(),o&&o.c(),s=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),o&&o.m(r,a),v(r,s,a)},p(r,a){r[2]?o?a&4&&O(o,1):(o=Rp(),o.c(),O(o,1),o.m(s.parentNode,s)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},d(r){r&&(y(e),y(t),y(i),y(l),y(s)),o&&o.d(r)}}}function i5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[n5],default:[t5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function l5(n,e,t){let i,l,s;Qe(n,yn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(V.isEmpty(c))return!1;for(let d of r)if(c[d.key])return!0;return!1}function u(c,d){n.$$.not_equal(o[d.key].duration,c)&&(o[d.key].duration=c,t(0,o))}function f(c,d){n.$$.not_equal(o[d.key].secret,c)&&(o[d.key].secret=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,r=i?[{key:"authToken",label:"Auth"},{key:"passwordResetToken",label:"Password reset"},{key:"fileToken",label:"Protected file access"}]:[{key:"authToken",label:"Auth"},{key:"verificationToken",label:"Email verification"},{key:"passwordResetToken",label:"Password reset"},{key:"emailChangeToken",label:"Email change"},{key:"fileToken",label:"Protected file access"}]),n.$$.dirty&16&&t(2,l=a(s))},[o,r,l,i,s,u,f]}class s5 extends Se{constructor(e){super(),we(this,e,l5,i5,ke,{collection:0})}}const o5=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]}),r5=n=>({isSuperuserOnly:n&2048}),qp=n=>({isSuperuserOnly:n[11]}),a5=n=>({isSuperuserOnly:n&2048}),Hp=n=>({isSuperuserOnly:n[11]});function u5(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[c5,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function jp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-dnx4io"),p(e,"aria-hidden",n[10]),e.disabled=n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=W(e,"click",n[13]),s=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&y(e),s=!1,o()}}}function zp(n){let e,t,i,l,s,o,r,a=!n[10]&&Up();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){v(u,e,f),a&&a.m(e,null),w(e,t),w(e,i),s=!0,o||(r=W(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Up(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=He(e,$t,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=He(e,$t,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&y(e),a&&a.d(),u&&l&&l.end(),o=!1,r()}}}function Up(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function c5(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,k,S,$,T,M;const E=n[15].beforeLabel,L=Lt(E,n,n[18],Hp),I=n[15].afterLabel,A=Lt(I,n,n[18],qp);let P=n[5]&&!n[11]&&jp(n);function N(Y){n[17](Y)}var R=n[8];function z(Y,Z){let G={id:Y[21],baseCollection:Y[1],disabled:Y[10]||Y[11],placeholder:Y[11]?"":Y[6]};return Y[0]!==void 0&&(G.value=Y[0]),{props:G}}R&&(m=zt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&zp(n);const U=n[15].default,J=Lt(U,n,n[18],Fp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),l=b("span"),s=B(n[2]),o=C(),a=B(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&j(m.$$.fragment),g=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(l,"class","txt"),ee(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(Y,Z){v(Y,e,Z),w(e,t),L&&L.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,g),F&&F.m(e,null),v(Y,k,Z),v(Y,S,Z),J&&J.m(S,null),$=!0,T||(M=Oe(_=qe.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(Y,Z){if(L&&L.p&&(!$||Z&264192)&&Pt(L,E,Y,Y[18],$?At(E,Y[18],Z,a5):Nt(Y[18]),Hp),(!$||Z&4)&&oe(s,Y[2]),(!$||Z&2048)&&r!==(r=Y[11]?"- Superusers only":"")&&oe(a,r),(!$||Z&2048)&&ee(l,"txt-hint",Y[11]),A&&A.p&&(!$||Z&264192)&&Pt(A,I,Y,Y[18],$?At(I,Y[18],Z,r5):Nt(Y[18]),qp),Y[5]&&!Y[11]?P?P.p(Y,Z):(P=jp(Y),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||Z&2097152&&c!==(c=Y[21]))&&p(t,"for",c),Z&256&&R!==(R=Y[8])){if(m){re();const G=m;D(G.$$.fragment,1,0,()=>{H(G,1)}),ae()}R?(m=zt(R,z(Y)),Y[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),O(m.$$.fragment,1),q(m,e,g)):m=null}else if(R){const G={};Z&2097152&&(G.id=Y[21]),Z&2&&(G.baseCollection=Y[1]),Z&3072&&(G.disabled=Y[10]||Y[11]),Z&2112&&(G.placeholder=Y[11]?"":Y[6]),!h&&Z&1&&(h=!0,G.value=Y[0],$e(()=>h=!1)),m.$set(G)}Y[5]&&Y[11]?F?(F.p(Y,Z),Z&2080&&O(F,1)):(F=zp(Y),F.c(),O(F,1),F.m(e,null)):F&&(re(),D(F,1,1,()=>{F=null}),ae()),_&&It(_.update)&&Z&2&&_.update.call(null,Y[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||Z&264192)&&Pt(J,U,Y,Y[18],$?At(U,Y[18],Z,o5):Nt(Y[18]),Fp)},i(Y){$||(O(L,Y),O(A,Y),m&&O(m.$$.fragment,Y),O(F),O(J,Y),$=!0)},o(Y){D(L,Y),D(A,Y),m&&D(m.$$.fragment,Y),D(F),D(J,Y),$=!1},d(Y){Y&&(y(e),y(k),y(S)),L&&L.d(Y),A&&A.d(Y),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(Y),T=!1,M()}}}function d5(n){let e,t,i,l;const s=[f5,u5],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}let Vp;function p5(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{collection:r=null}=e,{rule:a=null}=e,{label:u="Rule"}=e,{formKey:f="rule"}=e,{required:c=!1}=e,{disabled:d=!1}=e,{superuserToggle:m=!0}=e,{placeholder:h="Leave empty to grant everyone access..."}=e,g=null,_=null,k=Vp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await Tt(async()=>{const{default:I}=await import("./FilterAutocompleteInput-RpihTcvl.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Vp=k,t(9,S=!1))}async function T(){t(0,a=_||""),await dn(),g==null||g.focus()}function M(){_=a,t(0,a=null)}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(7,g)})}function L(I){a=I,t(0,a)}return n.$$set=I=>{"collection"in I&&t(1,r=I.collection),"rule"in I&&t(0,a=I.rule),"label"in I&&t(2,u=I.label),"formKey"in I&&t(3,f=I.formKey),"required"in I&&t(4,c=I.required),"disabled"in I&&t(14,d=I.disabled),"superuserToggle"in I&&t(5,m=I.superuserToggle),"placeholder"in I&&t(6,h=I.placeholder),"$$scope"in I&&t(18,o=I.$$scope)},n.$$.update=()=>{n.$$.dirty&33&&t(11,i=m&&a===null),n.$$.dirty&16386&&t(10,l=d||r.system)},[a,r,u,f,c,m,h,g,k,S,l,i,T,M,d,s,E,L,o]}class il extends Se{constructor(e){super(),we(this,e,p5,d5,ke,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function m5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(s,"class","txt"),p(l,"for",o=n[5])},m(u,f){v(u,e,f),e.checked=n[0].mfa.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[3]),r=!0)},p(u,f){f&32&&t!==(t=u[5])&&p(e,"id",t),f&1&&(e.checked=u[0].mfa.enabled),f&32&&o!==(o=u[5])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function h5(n){let e,t,i,l,s;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to + */const eo=n=>n&&n.enabled&&n.modifierKey,iy=(n,e)=>n&&e[n+"Key"],Xu=(n,e)=>n&&!e[n+"Key"];function rl(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ya(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function X$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function Q$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function ly(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=Q$(e,t),r=ya(i,t),a=ya(l,t);if(s){const f=ya(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return _t(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const lu=new WeakMap;function Vt(n){let e=lu.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},lu.set(n,e)),e}function x$(n){lu.delete(n)}function sy(n,e,t,i){const l=Math.max(0,Math.min(1,(n-e)/t||0)),s=1-l;return{min:i*l,max:i*s}}function oy(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function ry(n,e,t){const i=n.max-n.min,l=i*(e-1),s=oy(n,t);return sy(s,n.min,i,l)}function eC(n,e,t){const i=oy(n,t);if(i===void 0)return{min:n.min,max:n.max};const l=Math.log10(n.min),s=Math.log10(n.max),o=Math.log10(i),r=s-l,a=r*(e-1),u=sy(o,l,r,a);return{min:Math.pow(10,l+u.min),max:Math.pow(10,s-u.max)}}function tC(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Jd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Mt(o.options,o.scale)}return Mt(s,l)}function nC(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function iC(n,{min:e,max:t,minLimit:i,maxLimit:l},s){const o=(n-t+e)/2;e-=o,t+=o;const r=s.min.options??s.min.scale,a=s.max.options??s.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),el&&(t=l,e=Math.max(l-n,i)),{min:e,max:t}}function Nl(n,{min:e,max:t},i,l=!1){const s=Vt(n.chart),{options:o}=n,r=tC(n,i),{minRange:a=0}=r,u=Jd(s,n,r,"min",-1/0),f=Jd(s,n,r,"max",1/0);if(l==="pan"&&(ef))return!0;const c=n.max-n.min,d=l?Math.max(t-e,a):c;if(l&&d===a&&c<=a)return!0;const m=iC(d,{min:e,max:t,minLimit:u,maxLimit:f},s.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,s.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function lC(n,e,t,i){const l=ry(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return Nl(n,s,i,!0)}function sC(n,e,t,i){const l=eC(n,e,t);return Nl(n,l,i,!0)}function oC(n,e,t,i){Nl(n,nC(n,e,t),i,!0)}const Zd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function rC(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),Nl(n,{min:s,max:o},t)||f}const cC={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function ay(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=cC[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e);return isNaN(u)||isNaN(f)?!0:Nl(n,{min:u,max:f},t,i?"pan":!1)}function Gd(n,e,t){return ay(n,e,t,!0)}const su={category:aC,default:lC,logarithmic:sC},ou={default:oC},ru={category:fC,default:ay,logarithmic:Gd,timeseries:Gd};function dC(n,e,t){const{id:i,options:{min:l,max:s}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==l||o.max!==s}function Xd(n,e){_t(n,(t,i)=>{e[i]||delete n[i]})}function ds(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return _t(t,function(s){dC(s,i,l)&&(i[s.id]={min:{scale:s.min,options:s.options.min},max:{scale:s.max,options:s.options.max}})}),Xd(i,t),Xd(l,t),i}function Qd(n,e,t,i){const l=su[n.type]||su.default;ut(l,[n,e,t,i])}function xd(n,e,t,i){const l=ou[n.type]||ou.default;ut(l,[n,e,t,i])}function pC(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Qu(n,e,t="none",i="api"){const{x:l=1,y:s=1,focalPoint:o=pC(n)}=typeof e=="number"?{x:e,y:e}:e,r=Vt(n),{options:{limits:a,zoom:u}}=r;ds(n,r);const f=l!==1,c=s!==1,d=ly(u,o,n);_t(d||n.scales,function(m){m.isHorizontal()&&f?Qd(m,l,o,a):!m.isHorizontal()&&c&&Qd(m,s,o,a)}),n.update(t),ut(u.onZoom,[{chart:n,trigger:i}])}function uy(n,e,t,i="none",l="api"){const s=Vt(n),{options:{limits:o,zoom:r}}=s,{mode:a="xy"}=r;ds(n,s);const u=rl(a,"x",n),f=rl(a,"y",n);_t(n.scales,function(c){c.isHorizontal()&&u?xd(c,e.x,t.x,o):!c.isHorizontal()&&f&&xd(c,e.y,t.y,o)}),n.update(i),ut(r.onZoom,[{chart:n,trigger:l}])}function mC(n,e,t,i="none",l="api"){var r;const s=Vt(n);ds(n,s);const o=n.scales[e];Nl(o,t,void 0,!0),n.update(i),ut((r=s.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:l}])}function hC(n,e="default"){const t=Vt(n),i=ds(n,t);_t(n.scales,function(l){const s=l.options;i[l.id]?(s.min=i[l.id].min.options,s.max=i[l.id].max.options):(delete s.min,delete s.max),delete t.updatedScaleLimits[l.id]}),n.update(e),ut(t.options.zoom.onZoomComplete,[{chart:n}])}function _C(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Mt(l.options,l.scale)-Mt(i.options,i.scale)}function gC(n){const e=Vt(n);let t=1,i=1;return _t(n.scales,function(l){const s=_C(e,l.id);if(s){const o=Math.round(s/(l.max-l.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function ep(n,e,t,i){const{panDelta:l}=i,s=l[n.id]||0;sl(s)===sl(e)&&(e+=s);const o=ru[n.type]||ru.default;ut(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function fy(n,e,t,i="none"){const{x:l=0,y:s=0}=typeof e=="number"?{x:e,y:e}:e,o=Vt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ds(n,o);const f=l!==0,c=s!==0;_t(t||n.scales,function(d){d.isHorizontal()&&f?ep(d,l,a,o):!d.isHorizontal()&&c&&ep(d,s,a,o)}),n.update(i),ut(u,[{chart:n}])}function cy(n){const e=Vt(n);ds(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:l,max:s}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:l.scale,max:s.scale}}return t}function bC(n){const e=Vt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function kC(n){const e=cy(n);for(const t of Object.keys(n.scales)){const{min:i,max:l}=e[t];if(i!==void 0&&n.scales[t].min!==i||l!==void 0&&n.scales[t].max!==l)return!0}return!1}function tp(n){const e=Vt(n);return e.panning||e.dragging}const np=(n,e,t)=>Math.min(t,Math.max(e,n));function An(n,e){const{handlers:t}=Vt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:l,options:s}=Vt(n),o=l[t];if(o&&o.target===e)return;An(n,t),l[t]=a=>i(n,a,s),l[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,l[t],{passive:r})}function yC(n,e){const t=Vt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function vC(n,e){const t=Vt(n);!t.dragStart||e.key!=="Escape"||(An(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function au(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return yi(n,e)}function dy(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=au(e,n);if(ut(i,[{chart:n,event:e,point:s}])===!1)return ut(l,[{chart:n,event:e}]),!1}}function wC(n,e){if(n.legend){const s=yi(e,n);if(ls(s,n.legend))return}const t=Vt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||iy(eo(i),e)||Xu(eo(l.drag),e))return ut(l.onZoomRejected,[{chart:n,event:e}]);dy(n,e,l)!==!1&&(t.dragStart=e,Hs(n,n.canvas.ownerDocument,"mousemove",yC),Hs(n,window.document,"keydown",vC))}function SC({begin:n,end:e},t){let i=e.x-n.x,l=e.y-n.y;const s=Math.abs(i/l);s>t?i=Math.sign(i)*Math.abs(l*t):s=0?2-1/(1-s):1+s,r={x:o,y:o,focalPoint:{x:e.clientX-l.left,y:e.clientY-l.top}};Qu(n,r,"zoom","wheel"),ut(t,[{chart:n}])}function MC(n,e,t,i){t&&(Vt(n).handlers[e]=X$(()=>ut(t,[{chart:n}]),i))}function EC(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(Hs(n,t,"wheel",OC),MC(n,"onZoomComplete",s,250)):An(n,"wheel"),l.enabled?(Hs(n,t,"mousedown",wC),Hs(n,t.ownerDocument,"mouseup",$C)):(An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"keydown"))}function DC(n){An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"wheel"),An(n,"click"),An(n,"keydown")}function IC(n,e){return function(t,i){const{pan:l,zoom:s={}}=e.options;if(!l||!l.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(Xu(eo(l),o)||iy(eo(s.drag),o))?(ut(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function LC(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),l=t/i;let s,o;return l>.3&&l<1.7?s=o=!0:t>i?s=!0:o=!0,{x:s,y:o}}function my(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=LC(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&rl(a,"x",n)?s:1,y:r.y&&rl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Qu(n,u,"zoom","pinch"),e.scale=t.scale}}function AC(n,e,t){if(e.options.zoom.pinch.enabled){const i=yi(t,n);ut(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ut(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function PC(n,e,t){e.scale&&(my(n,e,t),e.scale=null,ut(e.options.zoom.onZoomComplete,[{chart:n}]))}function hy(n,e,t){const i=e.delta;i&&(e.panning=!0,fy(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function NC(n,e,t){const{enabled:i,onPanStart:l,onPanRejected:s}=e.options.pan;if(!i)return;const o=t.target.getBoundingClientRect(),r={x:t.center.x-o.left,y:t.center.y-o.top};if(ut(l,[{chart:n,event:t,point:r}])===!1)return ut(s,[{chart:n,event:t}]);e.panScales=ly(e.options.pan,r,n),e.delta={x:0,y:0},hy(n,e,t)}function RC(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ut(e.options.pan.onPanComplete,[{chart:n}]))}const uu=new WeakMap;function lp(n,e){const t=Vt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new qs.Manager(i);s&&s.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",r=>AC(n,t,r)),o.on("pinch",r=>my(n,t,r)),o.on("pinchend",r=>PC(n,t,r))),l&&l.enabled&&(o.add(new qs.Pan({threshold:l.threshold,enable:IC(n,t)})),o.on("panstart",r=>NC(n,t,r)),o.on("panmove",r=>hy(n,t,r)),o.on("panend",()=>RC(n,t))),uu.set(n,o)}function sp(n){const e=uu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),uu.delete(n))}function FC(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:l,zoom:s}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=s==null?void 0:s.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(l==null?void 0:l.enabled)||(t==null?void 0:t.threshold)!==(l==null?void 0:l.threshold)}var qC="2.2.0";function Yo(n,e,t){const i=t.zoom.drag,{dragStart:l,dragEnd:s}=Vt(n);if(i.drawTime!==e||!s)return;const{left:o,top:r,width:a,height:u}=py(n,t.zoom.mode,{dragStart:l,dragEnd:s},i.maintainAspectRatio),f=n.ctx;f.save(),f.beginPath(),f.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",f.fillRect(o,r,a,u),i.borderWidth>0&&(f.lineWidth=i.borderWidth,f.strokeStyle=i.borderColor||"rgba(225,225,225)",f.strokeRect(o,r,a,u)),f.restore()}var HC={id:"zoom",version:qC,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,e,t){const i=Vt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&lp(n,t),n.pan=(l,s,o)=>fy(n,l,s,o),n.zoom=(l,s)=>Qu(n,l,s),n.zoomRect=(l,s,o)=>uy(n,l,s,o),n.zoomScale=(l,s,o)=>mC(n,l,s,o),n.resetZoom=l=>hC(n,l),n.getZoomLevel=()=>gC(n),n.getInitialScaleBounds=()=>cy(n),n.getZoomedScaleBounds=()=>bC(n),n.isZoomedOrPanned=()=>kC(n),n.isZoomingOrPanning=()=>tp(n)},beforeEvent(n,{event:e}){if(tp(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Vt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Vt(n),l=i.options;i.options=t,FC(l,t)&&(sp(n),lp(n,t)),EC(n,t)},beforeDatasetsDraw(n,e,t){Yo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Yo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Yo(n,"beforeDraw",t)},afterDraw(n,e,t){Yo(n,"afterDraw",t)},stop:function(n){DC(n),qs&&sp(n),x$(n)},panFunctions:ru,zoomFunctions:su,zoomRectFunctions:ou};function op(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(l,s){v(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,$t,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&y(e),l&&t&&t.end()}}}function rp(n){let e,t,i;return{c(){e=b("button"),e.textContent="Reset zoom",p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-chart-zoom svelte-kfnurg")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[4]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function jC(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&op(),g=n[3]&&rp(n);return{c(){e=b("div"),t=b("div"),i=B("Found "),l=B(n[1]),s=C(),r=B(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),ee(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),ee(e,"loading",n[2])},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(t,r),w(e,a),h&&h.m(e,null),w(e,u),w(e,f),n[11](f),w(e,c),g&&g.m(e,null),d||(m=W(f,"dblclick",n[4]),d=!0)},p(_,[k]){k&2&&oe(l,_[1]),k&2&&o!==(o=_[1]==1?"log":"logs")&&oe(r,o),k&4&&ee(t,"hidden",_[2]),_[2]?h?k&4&&M(h,1):(h=op(),h.c(),M(h,1),h.m(e,u)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),_[3]?g?g.p(_,k):(g=rp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k&4&&ee(e,"loading",_[2])},i(_){M(h)},o(_){D(h)},d(_){_&&y(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function zC(n,e,t){let{filter:i=""}=e,{zoom:l={}}=e,{presets:s=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const _=[s,V.normalizeLogsFilter(i)].filter(Boolean).map(k=>"("+k+")").join("&&");return _e.logs.getStats({filter:_}).then(k=>{m(),k=V.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),_e.error(k,!_||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}Xt(()=>(vi.register(Qi,ar,sr,iu,xs,P$,U$),vi.register(HC),t(9,r=new vi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:_=>{var k;return(k=_.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:_=>{var k;return(k=_.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:_})=>{t(3,c=_.isZoomedOrPanned()),c?(t(5,l.min=V.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=V.formatToUTCDate(_.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",l)):(l.min||l.max)&&t(5,l={})}}}}}})),()=>r==null?void 0:r.destroy()));function g(_){ie[_?"unshift":"push"](()=>{o=_,t(0,o)})}return n.$$set=_=>{"filter"in _&&t(6,i=_.filter),"zoom"in _&&t(5,l=_.zoom),"presets"in _&&t(7,s=_.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof s<"u")&&d(),n.$$.dirty&1536&&typeof a<"u"&&r&&(t(9,r.data.datasets[0].data=a,r),r.update())},[o,u,f,c,h,l,i,s,d,r,a,g]}class UC extends Se{constructor(e){super(),we(this,e,zC,jC,ke,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function VC(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){v(l,e,s),w(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(l){l&&y(e)}}}function BC(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class xu extends Se{constructor(e){super(),we(this,e,BC,VC,ke,{content:2,language:3,class:0})}}function WC(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){v(o,e,r),l||(s=[Oe(i=qe.call(null,e,n[3]?void 0:n[0])),W(e,"click",On(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&It(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&y(e),l=!1,Ie(s)}}}function YC(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function u(){V.isEmpty(i)||(V.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Xt(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,l=f.tooltip),"idleClasses"in f&&t(1,s=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[l,s,o,a,u,i,r]}class $i extends Se{constructor(e){super(),we(this,e,YC,WC,ke,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function ap(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=V.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function KC(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,U,J,Y;d=new $i({props:{value:n[1].id}}),S=new gk({props:{level:n[1].level}}),O=new $i({props:{value:n[1].level}}),N=new _k({props:{date:n[1].created}}),F=new $i({props:{value:n[1].created}});let Z=!n[4]&&up(n),G=de(n[5](n[1].data)),pe=[];for(let ue=0;ueD(pe[ue],1,1,()=>{pe[ue]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=C(),o=b("td"),r=b("span"),u=B(a),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("tr"),g=b("td"),g.textContent="level",_=C(),k=b("td"),j(S.$$.fragment),$=C(),T=b("div"),j(O.$$.fragment),E=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),j(N.$$.fragment),R=C(),z=b("div"),j(F.$$.fragment),U=C(),Z&&Z.c(),J=C();for(let ue=0;ue{Z=null}),ae()):Z?(Z.p(ue,Te),Te&16&&M(Z,1)):(Z=up(ue),Z.c(),M(Z,1),Z.m(t,J)),Te&50){G=de(ue[5](ue[1].data));let We;for(We=0;We',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function up(n){let e,t,i,l,s,o,r;const a=[GC,ZC],u=[];function f(c,d){return c[1].message?0:1}return s=f(n),o=u[s]=a[s](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),l=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(l,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),u[s].m(l,null),r=!0},p(c,d){let m=s;s=f(c),s===m?u[s].p(c,d):(re(),D(u[m],1,1,()=>{u[m]=null}),ae(),o=u[s],o?o.p(c,d):(o=u[s]=a[s](c),o.c()),M(o,1),o.m(l,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&y(e),u[s].d()}}}function ZC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function GC(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new $i({props:{value:n[1].message}}),{c(){e=b("span"),i=B(t),l=C(),s=b("div"),j(o.$$.fragment),p(e,"class","txt"),p(s,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),q(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&oe(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(y(e),y(l),y(s)),H(o)}}}function XC(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=B(t),s=B(l),p(e,"class","txt")},m(o,r){v(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:te,o:te,d(o){o&&y(e)}}}function QC(n){let e,t;return e=new xu({props:{content:n[17],language:"html"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xC(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function e6(n){let e,t;return e=new xu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function t6(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function fp(n){let e,t,i;return t=new $i({props:{value:n[17]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function cp(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[t6,e6,xC,QC,XC],h=[];function g(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=g(n),u=h[a]=m[a](n);let _=!n[18]&&fp(n);return{c(){e=b("tr"),t=b("td"),i=B("data."),s=B(l),o=C(),r=b("td"),u.c(),f=C(),_&&_.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),ee(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){v(k,e,S),w(e,t),w(t,i),w(t,s),w(e,o),w(e,r),h[a].m(r,null),w(r,f),_&&_.m(r,null),w(e,c),d=!0},p(k,S){(!d||S&2)&&l!==(l=k[16]+"")&&oe(s,l),(!d||S&34)&&ee(t,"v-align-top",k[19]);let $=a;a=g(k),a===$?h[a].p(k,S):(re(),D(h[$],1,1,()=>{h[$]=null}),ae(),u=h[a],u?u.p(k,S):(u=h[a]=m[a](k),u.c()),M(u,1),u.m(r,f)),k[18]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&2&&M(_,1)):(_=fp(k),_.c(),M(_,1),_.m(r,null))},i(k){d||(M(u),M(_),d=!0)},o(k){D(u),D(_),d=!1},d(k){k&&y(e),h[a].d(),_&&_.d()}}}function n6(n){let e,t,i,l;const s=[JC,KC],o=[];function r(a,u){var f;return a[3]?0:(f=a[1])!=null&&f.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,u){~e&&o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(re(),D(o[f],1,1,()=>{o[f]=null}),ae()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),~e&&o[e].d(a)}}}function i6(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function l6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),l=b("i"),s=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(u,f){v(u,e,f),v(u,t,f),v(u,i,f),w(i,l),w(i,s),w(i,o),r||(a=[W(e,"click",n[9]),W(i,"click",n[10])],r=!0)},p(u,f){f&8&&(i.disabled=u[3])},d(u){u&&(y(e),y(t),y(i)),r=!1,Ie(a)}}}function s6(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[l6],header:[i6],default:[n6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}const dp="log_view";function o6(n,e,t){let i;const l=kt();let s,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),h()}),s==null?void 0:s.show()}function u(){return _e.cancelRequest(dp),s==null?void 0:s.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await _e.logs.getOne($,{requestKey:dp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),Ci(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let E of c)typeof $[E]<"u"&&T.push(E);const O=Object.keys($);for(let E of O)T.includes(E)||T.push(E);return T}function m(){V.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function g(){l("hide",o),t(1,o={})}const _=()=>u(),k=()=>m();function S($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,s,r,i,d,m,g,a,_,k,S]}class r6 extends Se{constructor(e){super(),we(this,e,o6,s6,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function a6(n,e,t){const i=n.slice();return i[1]=e[t],i}function u6(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function f6(n){let e,t,i,l=de(x0),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class _y extends Se{constructor(e){super(),we(this,e,c6,f6,ke,{class:0})}}function d6(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[m6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[h6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[_6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[g6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=W(e,"submit",nt(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&y(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function p6(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function m6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[1].logs.maxDays),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&>(s.value)!==c[1].logs.maxDays&&he(s,c[1].logs.maxDays)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function h6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new _y({}),{c(){e=b("label"),t=B("Min log level"),l=C(),s=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=W(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&>(s.value)!==h[1].logs.minLevel&&he(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(y(e),y(l),y(s),y(o),y(r)),H(f),d=!1,m()}}}function _6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function g6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function b6(n){let e,t,i,l;const s=[p6,d6],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function k6(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function y6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),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(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&ee(l,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function v6(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[y6],header:[k6],default:[b6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function w6(n,e,t){let i,l;const s=kt(),o="logs_settings_"+V.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Ut(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await _e.settings.getAll()||{};k(P)}catch(P){_e.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await _e.settings.update(V.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),_e.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=gt(this.value),t(1,c)}function $(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,_,d,f,i,S,$,T,O,E,L,I,A]}class S6 extends Se{constructor(e){super(),we(this,e,w6,v6,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function T6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function pp(n){let e,t,i;function l(o){n[14](o)}let s={filter:n[1],presets:n[6]};return n[5]!==void 0&&(s.zoom=n[5]),e=new UC({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function mp(n){let e,t,i,l;function s(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new U3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){l||(M(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function $6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T=n[4],O,E=n[4],L,I,A,P;u=new Pu({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[T6,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new _y({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=pp(n),R=mp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=B(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),j(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),j(h.$$.fragment),g=C(),j(_.$$.fragment),k=C(),j(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=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(z,F){v(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,g),q(_,e,null),w(e,k),q(S,e,null),w(e,$),N.m(e,null),v(z,O,F),R.m(z,F),v(z,L,F),I=!0,A||(P=[Oe(qe.call(null,r,{text:"Logs settings",position:"right"})),W(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&oe(s,z[7]);const U={};F&100663300&&(U.$$scope={dirty:F,ctx:z}),h.$set(U);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&ke(T,T=z[4])?(re(),D(N,1,1,te),ae(),N=pp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&ke(E,E=z[4])?(re(),D(R,1,1,te),ae(),R=mp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(_.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(y(e),y(O),y(L)),H(u),H(h),H(_),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function C6(n){let e,t,i,l,s,o;e=new pi({props:{$$slots:{default:[$6]},$$scope:{ctx:n}}});let r={};i=new r6({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new S6({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(u,f){q(e,u,f),v(u,t,f),q(i,u,f),v(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(y(t),y(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Ko="logId",hp="superuserRequests",_p="superuserLogRequests";function O6(n,e,t){var R;let i,l,s;Qe(n,Au,z=>t(22,l=z)),Qe(n,un,z=>t(7,s=z)),Rn(un,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(hp)||((R=window.localStorage)==null?void 0:R.getItem(_p)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[hp]=d<<0||null,V.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var U;let F={};F[Ko]=((U=z.detail)==null?void 0:U.id)||null,V.replaceHashQueryParams(F)},P=()=>{let z={};z[Ko]=null,V.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Ko)&&r&&r.show(o.get(Ko)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(_p,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,k,S,$,T,O,E,L,I,A,P,N]}class M6 extends Se{constructor(e){super(),we(this,e,O6,C6,ke,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function yp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function E6(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=B(t),l=C(),p(e,"type","button"),p(e,"class","sidebar-item"),ee(e,"active",n[5]===n[14])},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&oe(i,t),u&40&&ee(e,"active",n[5]===n[14])},d(a){a&&y(e),s=!1,o()}}}function D6(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=B(t),l=C(),p(e,"class","sidebar-item disabled")},m(r,a){v(r,e,a),w(e,i),w(e,l),s||(o=Oe(qe.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&oe(i,t)},d(r){r&&y(e),s=!1,o()}}}function vp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&yp();function r(f,c){return f[15].disabled?D6:E6}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ye(),o&&o.c(),l=C(),u.c(),s=ye(),this.first=t},m(f,c){v(f,t,c),o&&o.m(f,c),v(f,l,c),u.m(f,c),v(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=yp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(y(t),y(l),y(s)),o&&o.d(f),u.d(f)}}}function wp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:A6,then:L6,catch:I6,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){v(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&mf(t,l)||Jy(l,n,o)},i(s){i||(M(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&y(e),l.block.d(s),l.token=null,l=null}}}function I6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function L6(n){bp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=C()},m(l,s){q(e,l,s),v(l,t,s),i=!0},p(l,s){bp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(M(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&y(t),H(e,l)}}}function A6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Sp(n,e){let t,i,l,s=e[5]===e[14]&&wp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){v(o,t,r),s&&s.m(o,r),v(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&M(s,1)):(s=wp(e),s.c(),M(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(M(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(y(t),y(i)),s&&s.d(o)}}}function P6(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=de(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[8]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function R6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[N6],default:[P6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function F6(n,e,t){const i={list:{label:"List/Search",component:Tt(()=>import("./ListApiDocs-BAgbsZ7y.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Tt(()=>import("./ViewApiDocs-fmO-uILm.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Tt(()=>import("./CreateApiDocs-CyJpcgbh.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Tt(()=>import("./UpdateApiDocs-CO2UpPcw.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Tt(()=>import("./DeleteApiDocs-B6O82IZT.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Tt(()=>import("./RealtimeApiDocs-D_C9UwDU.js"),[],import.meta.url)},batch:{label:"Batch",component:Tt(()=>import("./BatchApiDocs-BLANcPai.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Tt(()=>import("./AuthMethodsDocs-DOUEhU-E.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Tt(()=>import("./AuthWithPasswordDocs-sk8JSDnL.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Tt(()=>import("./AuthWithOAuth2Docs-JwYoBVwZ.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Tt(()=>import("./AuthWithOtpDocs-Dz4mWsXl.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Tt(()=>import("./AuthRefreshDocs-DvYw-jkZ.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Tt(()=>import("./VerificationDocs-Fh8xavie.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Tt(()=>import("./PasswordResetDocs-ClH0edc2.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Tt(()=>import("./EmailChangeDocs-TbOAn4ur.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ie[k?"unshift":"push"](()=>{s=k,t(4,s)})}function g(k){Pe.call(this,n,k)}function _(k){Pe.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime,delete a.batch):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,h,g,_]}class q6 extends Se{constructor(e){super(),we(this,e,F6,R6,ke,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}const H6=n=>({active:n&1}),Tp=n=>({active:n[0]});function $p(n){let e,t,i;const l=n[15].default,s=Lt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){v(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Pt(s,l,o,o[14],i?At(l,o[14],r,null):Nt(o[14]),null)},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),o&&t&&t.end()}}}function j6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(a,n,n[14],Tp);let f=n[0]&&$p(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(e,"active",n[0])},m(c,d){v(c,e,d),w(e,t),u&&u.m(t,null),w(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[W(t,"click",nt(n[17])),W(t,"drop",nt(n[18])),W(t,"dragstart",n[19]),W(t,"dragenter",n[20]),W(t,"dragleave",n[21]),W(t,"dragover",nt(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&Pt(u,a,c,c[14],s?At(a,c[14],d,H6):Nt(c[14]),Tp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=$p(c),f.c(),M(f,1),f.m(e,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&ee(e,"active",c[0])},i(c){s||(M(u,c),M(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&y(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function z6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function g(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of P)N.click()}}Xt(()=>()=>clearTimeout(r));function $(P){Pe.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),s("drop",P))},E=P=>u&&s("dragstart",P),L=P=>{u&&(t(7,m=!0),s("dragenter",P))},I=P=>{u&&(t(7,m=!1),s("dragleave",P))};function A(P){ie[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,s,d,h,g,_,r,l,i,$,T,O,E,L,I,A]}class ji extends Se{constructor(e){super(),we(this,e,z6,j6,ke,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function Cp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Op(n,e,t){const i=n.slice();return i[25]=e[t],i}function Mp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Mp(n);return{c(){e=b("label"),t=B("Subject"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(e,"for",i=n[24]),p(s,"type","text"),p(s,"id",o=n[24]),p(s,"spellcheck","false"),s.required=!0},m(m,h){v(m,e,h),w(e,t),v(m,l,h),v(m,s,h),he(s,n[0].subject),v(m,r,h),c&&c.m(m,h),v(m,a,h),u||(f=W(s,"input",n[14]),u=!0)},p(m,h){var g;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(s,"id",o),h&1&&s.value!==m[0].subject&&he(s,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Mp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(m),u=!1,f()}}}function V6(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){v(s,e,o),he(e,n[0].body),i||(l=W(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&he(e,s[0].body)},i:te,o:te,d(s){s&&y(e),i=!1,l()}}}function B6(n){let e,t,i,l;function s(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function Dp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Dp(n);return{c(){e=b("label"),t=B("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ye(),p(e,"for",i=n[24])},m(g,_){v(g,e,_),w(e,t),v(g,l,_),c[s].m(g,_),v(g,r,_),m&&m.m(g,_),v(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=s;s=d(g),s===k?c[s].p(g,_):(re(),D(c[k],1,1,()=>{c[k]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Dp(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(y(e),y(l),y(r),y(a)),c[s].d(g),m&&m.d(g)}}}function Y6(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[U6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[W6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function Lp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function K6(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Lp();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),s=B(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),v(c,o,d),v(c,r,d),v(c,a,d),f&&f.m(c,d),v(c,u,d)},p(c,d){d&4&&oe(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Lp(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(o),y(r),y(a),y(u)),f&&f.d(c)}}}function J6(n){let e,t;const i=[n[9]];let l={$$slots:{header:[K6],default:[Y6]},$$scope:{ctx:n}};for(let s=0;st(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ap,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Tt(async()=>{const{default:R}=await import("./CodeEditor-Bfa8qogr.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Ap=d,t(6,m=!1))}function S(R){R=R.replace("*",""),V.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}function N(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Wt(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||Yn(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,$,T,O,E,L,I,A,P,N]}class G6 extends Se{constructor(e){super(),we(this,e,Z6,J6,ke,{key:1,title:2,config:0,placeholders:3,expand:10,collapse:11,collapseSiblings:12})}get expand(){return this.$$.ctx[10]}get collapse(){return this.$$.ctx[11]}get collapseSiblings(){return this.$$.ctx[12]}}function X6(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=B(n[3]),i=B(" duration (in seconds)"),s=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),ee(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){v(m,e,h),w(e,t),w(e,i),v(m,s,h),v(m,o,h),he(o,n[0]),v(m,a,h),v(m,u,h),w(u,f),c||(d=[W(o,"input",n[4]),W(f,"click",n[5])],c=!0)},p(m,h){h&8&&oe(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&>(o.value)!==m[0]&&he(o,m[0]),h&2&&ee(f,"txt-success",!!m[1])},d(m){m&&(y(e),y(s),y(o),y(a),y(u)),c=!1,Ie(d)}}}function Q6(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[X6,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function x6(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class e5 extends Se{constructor(e){super(),we(this,e,x6,Q6,ke,{key:2,label:3,duration:0,secret:1})}}function Pp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Np(n,e){let t,i,l,s,o,r;function a(c){e[5](c,e[8])}function u(c){e[6](c,e[8])}let f={key:e[8].key,label:e[8].label};return e[0][e[8].key].duration!==void 0&&(f.duration=e[0][e[8].key].duration),e[0][e[8].key].secret!==void 0&&(f.secret=e[0][e[8].key].secret),i=new e5({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,$e(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,$e(()=>s=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&y(t),H(i)}}}function t5(n){let e,t=[],i=new Map,l,s=de(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o=n[2]&&Rp();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),l=C(),o&&o.c(),s=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),o&&o.m(r,a),v(r,s,a)},p(r,a){r[2]?o?a&4&&M(o,1):(o=Rp(),o.c(),M(o,1),o.m(s.parentNode,s)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},d(r){r&&(y(e),y(t),y(i),y(l),y(s)),o&&o.d(r)}}}function i5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[n5],default:[t5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function l5(n,e,t){let i,l,s;Qe(n,yn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(V.isEmpty(c))return!1;for(let d of r)if(c[d.key])return!0;return!1}function u(c,d){n.$$.not_equal(o[d.key].duration,c)&&(o[d.key].duration=c,t(0,o))}function f(c,d){n.$$.not_equal(o[d.key].secret,c)&&(o[d.key].secret=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,r=i?[{key:"authToken",label:"Auth"},{key:"passwordResetToken",label:"Password reset"},{key:"fileToken",label:"Protected file access"}]:[{key:"authToken",label:"Auth"},{key:"verificationToken",label:"Email verification"},{key:"passwordResetToken",label:"Password reset"},{key:"emailChangeToken",label:"Email change"},{key:"fileToken",label:"Protected file access"}]),n.$$.dirty&16&&t(2,l=a(s))},[o,r,l,i,s,u,f]}class s5 extends Se{constructor(e){super(),we(this,e,l5,i5,ke,{collection:0})}}const o5=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]}),r5=n=>({isSuperuserOnly:n&2048}),qp=n=>({isSuperuserOnly:n[11]}),a5=n=>({isSuperuserOnly:n&2048}),Hp=n=>({isSuperuserOnly:n[11]});function u5(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[c5,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function jp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-dnx4io"),p(e,"aria-hidden",n[10]),e.disabled=n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=W(e,"click",n[13]),s=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&y(e),s=!1,o()}}}function zp(n){let e,t,i,l,s,o,r,a=!n[10]&&Up();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){v(u,e,f),a&&a.m(e,null),w(e,t),w(e,i),s=!0,o||(r=W(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Up(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=He(e,$t,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=He(e,$t,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&y(e),a&&a.d(),u&&l&&l.end(),o=!1,r()}}}function Up(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function c5(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,k,S,$,T,O;const E=n[15].beforeLabel,L=Lt(E,n,n[18],Hp),I=n[15].afterLabel,A=Lt(I,n,n[18],qp);let P=n[5]&&!n[11]&&jp(n);function N(Y){n[17](Y)}var R=n[8];function z(Y,Z){let G={id:Y[21],baseCollection:Y[1],disabled:Y[10]||Y[11],placeholder:Y[11]?"":Y[6]};return Y[0]!==void 0&&(G.value=Y[0]),{props:G}}R&&(m=zt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&zp(n);const U=n[15].default,J=Lt(U,n,n[18],Fp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),l=b("span"),s=B(n[2]),o=C(),a=B(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&j(m.$$.fragment),g=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(l,"class","txt"),ee(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(Y,Z){v(Y,e,Z),w(e,t),L&&L.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,g),F&&F.m(e,null),v(Y,k,Z),v(Y,S,Z),J&&J.m(S,null),$=!0,T||(O=Oe(_=qe.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(Y,Z){if(L&&L.p&&(!$||Z&264192)&&Pt(L,E,Y,Y[18],$?At(E,Y[18],Z,a5):Nt(Y[18]),Hp),(!$||Z&4)&&oe(s,Y[2]),(!$||Z&2048)&&r!==(r=Y[11]?"- Superusers only":"")&&oe(a,r),(!$||Z&2048)&&ee(l,"txt-hint",Y[11]),A&&A.p&&(!$||Z&264192)&&Pt(A,I,Y,Y[18],$?At(I,Y[18],Z,r5):Nt(Y[18]),qp),Y[5]&&!Y[11]?P?P.p(Y,Z):(P=jp(Y),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||Z&2097152&&c!==(c=Y[21]))&&p(t,"for",c),Z&256&&R!==(R=Y[8])){if(m){re();const G=m;D(G.$$.fragment,1,0,()=>{H(G,1)}),ae()}R?(m=zt(R,z(Y)),Y[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),M(m.$$.fragment,1),q(m,e,g)):m=null}else if(R){const G={};Z&2097152&&(G.id=Y[21]),Z&2&&(G.baseCollection=Y[1]),Z&3072&&(G.disabled=Y[10]||Y[11]),Z&2112&&(G.placeholder=Y[11]?"":Y[6]),!h&&Z&1&&(h=!0,G.value=Y[0],$e(()=>h=!1)),m.$set(G)}Y[5]&&Y[11]?F?(F.p(Y,Z),Z&2080&&M(F,1)):(F=zp(Y),F.c(),M(F,1),F.m(e,null)):F&&(re(),D(F,1,1,()=>{F=null}),ae()),_&&It(_.update)&&Z&2&&_.update.call(null,Y[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||Z&264192)&&Pt(J,U,Y,Y[18],$?At(U,Y[18],Z,o5):Nt(Y[18]),Fp)},i(Y){$||(M(L,Y),M(A,Y),m&&M(m.$$.fragment,Y),M(F),M(J,Y),$=!0)},o(Y){D(L,Y),D(A,Y),m&&D(m.$$.fragment,Y),D(F),D(J,Y),$=!1},d(Y){Y&&(y(e),y(k),y(S)),L&&L.d(Y),A&&A.d(Y),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(Y),T=!1,O()}}}function d5(n){let e,t,i,l;const s=[f5,u5],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}let Vp;function p5(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{collection:r=null}=e,{rule:a=null}=e,{label:u="Rule"}=e,{formKey:f="rule"}=e,{required:c=!1}=e,{disabled:d=!1}=e,{superuserToggle:m=!0}=e,{placeholder:h="Leave empty to grant everyone access..."}=e,g=null,_=null,k=Vp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await Tt(async()=>{const{default:I}=await import("./FilterAutocompleteInput-fHLXb8ZI.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Vp=k,t(9,S=!1))}async function T(){t(0,a=_||""),await dn(),g==null||g.focus()}function O(){_=a,t(0,a=null)}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(7,g)})}function L(I){a=I,t(0,a)}return n.$$set=I=>{"collection"in I&&t(1,r=I.collection),"rule"in I&&t(0,a=I.rule),"label"in I&&t(2,u=I.label),"formKey"in I&&t(3,f=I.formKey),"required"in I&&t(4,c=I.required),"disabled"in I&&t(14,d=I.disabled),"superuserToggle"in I&&t(5,m=I.superuserToggle),"placeholder"in I&&t(6,h=I.placeholder),"$$scope"in I&&t(18,o=I.$$scope)},n.$$.update=()=>{n.$$.dirty&33&&t(11,i=m&&a===null),n.$$.dirty&16386&&t(10,l=d||r.system)},[a,r,u,f,c,m,h,g,k,S,l,i,T,O,d,s,E,L,o]}class il extends Se{constructor(e){super(),we(this,e,p5,d5,ke,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function m5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(s,"class","txt"),p(l,"for",o=n[5])},m(u,f){v(u,e,f),e.checked=n[0].mfa.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[3]),r=!0)},p(u,f){f&32&&t!==(t=u[5])&&p(e,"id",t),f&1&&(e.checked=u[0].mfa.enabled),f&32&&o!==(o=u[5])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function h5(n){let e,t,i,l,s;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to email != ''.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p:te,d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function _5(n){let e,t,i,l,s,o,r,a,u;l=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[m5,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[h5]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new il({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

`,t=C(),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),ee(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){v(d,e,m),v(d,t,m),v(d,i,m),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&ee(o,"fade",!d[0].mfa.enabled)},i(d){u||(O(l.$$.fragment,d),O(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(y(e),y(t),y(i)),H(l),H(r)}}}function g5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function b5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Bp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function k5(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?b5:g5}let a=r(n),u=a(n),f=n[1]&&Bp();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&O(f,1):(f=Bp(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function y5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[k5],default:[_5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function v5(n,e,t){let i,l;Qe(n,yn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!V.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class w5 extends Se{constructor(e){super(),we(this,e,v5,y5,ke,{collection:0})}}const S5=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i}const T5=n=>({}),Kp=n=>({});function Jp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Zp(n){let e,t,i;return{c(){e=b("div"),t=B(n[2]),i=C(),p(e,"class","block txt-placeholder"),ee(e,"link-hint",!n[5]&&!n[6])},m(l,s){v(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&ee(e,"link-hint",!l[5]&&!l[6])},d(l){l&&y(e)}}}function $5(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function C5(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),O(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Gp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,"Clear")),W(e,"click",On(nt(l)))],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function Xp(n){let e,t,i,l,s,o;const r=[C5,$5],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Gp(n);return{c(){e=b("div"),i.c(),l=C(),f&&f.c(),s=C(),p(e,"class","option")},m(c,d){v(c,e,d),a[t].m(e,null),w(e,l),f&&f.m(e,null),w(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),O(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Gp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(O(i),o=!0)},o(c){D(i),o=!1},d(c){c&&y(e),a[t].d(),f&&f.d()}}}function Qp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[E5]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function xp(n){let e,t,i,l,s,o,r,a,u=n[17].length&&em(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=C(),s=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(t,l),w(t,s),he(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=W(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&he(s,f[17]),f[17].length?u?u.p(f,c):(u=em(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&y(e),u&&u.d(),r=!1,a()}}}function em(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",On(nt(n[23]))),i=!0)},p:te,d(s){s&&y(e),i=!1,l()}}}function tm(n){let e,t=n[1]&&nm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=nm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function nm(n){let e,t;return{c(){e=b("div"),t=B(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&y(e)}}}function O5(n){let e=n[50]+"",t;return{c(){t=B(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&oe(t,e)},i:te,o:te,d(i){i&&y(t)}}}function M5(n){let e,t,i;const l=[{item:n[50]},n[13]];var s=n[12];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),O(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&O(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function im(n){let e,t,i,l,s,o,r;const a=[M5,O5],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[40](n[50],...m)}function d(...m){return n[41](n[50],...m)}return{c(){e=b("div"),i.c(),l=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),ee(e,"closable",n[9]),ee(e,"selected",n[21](n[50]))},m(m,h){v(m,e,h),u[t].m(e,null),w(e,l),s=!0,o||(r=[W(e,"click",c),W(e,"keydown",d)],o=!0)},p(m,h){n=m;let g=t;t=f(n),t===g?u[t].p(n,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),O(i,1),i.m(e,l)),(!s||h[0]&512)&&ee(e,"closable",n[9]),(!s||h[0]&6291456)&&ee(e,"selected",n[21](n[50]))},i(m){s||(O(i),s=!0)},o(m){D(i),s=!1},d(m){m&&y(e),u[t].d(),o=!1,Ie(r)}}}function E5(n){let e,t,i,l,s,o=n[14]&&xp(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Kp);let u=de(n[22]),f=[];for(let g=0;gD(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=tm(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Wp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;gD(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Zp(n));let c=!n[5]&&!n[6]&&Qp(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&ee(e,"upside",d[7]),(!o||m[0]&32784)&&ee(e,"multiple",d[4]),(!o||m[0]&32800)&&ee(e,"disabled",d[5]),(!o||m[0]&32832)&&ee(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=_()}=e,{toggle:S=d}=e,{closable:$=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:M={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=kt();let{class:N=""}=e,R,z="",F,U;function J(ve){if(V.isEmpty(k))return;let Ce=V.toArray(k);V.inArray(Ce,ve)&&(V.removeByValue(Ce,ve),t(0,k=d?Ce:(Ce==null?void 0:Ce[0])||_())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Y(ve){if(d){let Ce=V.toArray(k);V.inArray(Ce,ve)||t(0,k=[...Ce,ve])}else t(0,k=ve);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Z(ve){return l(ve)?J(ve):Y(ve)}function G(){t(0,k=_()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function pe(){R!=null&&R.show&&(R==null||R.show())}function ce(){R!=null&&R.hide&&(R==null||R.hide())}function ue(){if(V.isEmpty(k)||V.isEmpty(c))return;let ve=V.toArray(k),Ce=[];for(const ct of ve)V.inArray(c,ct)||Ce.push(ct);if(Ce.length){for(const ct of Ce)V.removeByValue(ve,ct);t(0,k=d?ve:ve[0])}}function Te(){t(17,z="")}function Ke(ve,Ce){ve=ve||[];const ct=A||I5;return ve.filter(Ht=>ct(Ht,Ce))||[]}function Je(ve,Ce){ve.preventDefault(),S&&d?Z(Ce):Y(Ce)}function ft(ve,Ce){(ve.code==="Enter"||ve.code==="Space")&&(Je(ve,Ce),$&&ce())}function et(){Te(),setTimeout(()=>{const ve=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ve&&(ve.focus(),ve.scrollIntoView({block:"nearest"}))},0)}function xe(ve){ve.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Xt(()=>{const ve=document.querySelectorAll(`label[for="${r}"]`);for(const Ce of ve)Ce.addEventListener("click",xe);return()=>{for(const Ce of ve)Ce.removeEventListener("click",xe)}});const We=ve=>J(ve);function at(ve){ie[ve?"unshift":"push"](()=>{U=ve,t(20,U)})}function jt(){z=this.value,t(17,z)}const Ve=(ve,Ce)=>Je(Ce,ve),Ee=(ve,Ce)=>ft(Ce,ve);function st(ve){ie[ve?"unshift":"push"](()=>{R=ve,t(18,R)})}function De(ve){Pe.call(this,n,ve)}function Ye(ve){ie[ve?"unshift":"push"](()=>{F=ve,t(19,F)})}return n.$$set=ve=>{"id"in ve&&t(27,r=ve.id),"noOptionsText"in ve&&t(1,a=ve.noOptionsText),"selectPlaceholder"in ve&&t(2,u=ve.selectPlaceholder),"searchPlaceholder"in ve&&t(3,f=ve.searchPlaceholder),"items"in ve&&t(28,c=ve.items),"multiple"in ve&&t(4,d=ve.multiple),"disabled"in ve&&t(5,m=ve.disabled),"readonly"in ve&&t(6,h=ve.readonly),"upside"in ve&&t(7,g=ve.upside),"zeroFunc"in ve&&t(29,_=ve.zeroFunc),"selected"in ve&&t(0,k=ve.selected),"toggle"in ve&&t(8,S=ve.toggle),"closable"in ve&&t(9,$=ve.closable),"labelComponent"in ve&&t(10,T=ve.labelComponent),"labelComponentProps"in ve&&t(11,M=ve.labelComponentProps),"optionComponent"in ve&&t(12,E=ve.optionComponent),"optionComponentProps"in ve&&t(13,L=ve.optionComponentProps),"searchable"in ve&&t(14,I=ve.searchable),"searchFunc"in ve&&t(30,A=ve.searchFunc),"class"in ve&&t(15,N=ve.class),"$$scope"in ve&&t(45,o=ve.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),Te()),n.$$.dirty[0]&268566528&&t(22,i=Ke(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ve){const Ce=V.toArray(k);return V.inArray(Ce,ve)})},[k,a,u,f,d,m,h,g,S,$,T,M,E,L,I,N,J,z,R,F,U,l,i,Te,Je,ft,et,r,c,_,A,Y,Z,G,pe,ce,s,We,at,jt,Ve,Ee,st,De,Ye,o]}class ps extends Se{constructor(e){super(),we(this,e,L5,D5,ke,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,zeroFunc:29,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:30,class:15,deselectItem:16,selectItem:31,toggleItem:32,reset:33,showDropdown:34,hideDropdown:35},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[31]}get toggleItem(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get showDropdown(){return this.$$.ctx[34]}get hideDropdown(){return this.$$.ctx[35]}}function A5(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o',i=C(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ei(l,a)},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),l.autofocus&&l.focus(),s||(o=[Oe(qe.call(null,t,{position:"left",text:"Set new value"})),W(t,"click",nt(n[3]))],s=!0)},p(u,f){ei(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(y(e),y(i),y(l)),s=!1,Ie(o)}}}function N5(n){let e;function t(s,o){return s[1]?P5:A5}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function R5(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await dn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class ef extends Se{constructor(e){super(),we(this,e,R5,N5,ke,{value:0,mask:1})}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[1].clientId),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&2&&s.value!==u[1].clientId&&he(s,u[1].clientId)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function q5(n){let e,t,i,l,s,o,r,a;function u(d){n[15](d)}function f(d){n[16](d)}let c={id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[1].clientSecret!==void 0&&(c.value=n[1].clientSecret),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Client secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function lm(n){let e,t,i,l;const s=[{key:n[6]},n[3].optionsComponentProps||{}];function o(u){n[17](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&q(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}r?(t=zt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),O(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){l||(t&&O(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&y(e),t&&H(t)}}}function H5(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[F5,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[q5,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&lm(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=W(e,"submit",nt(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&O(u,1)):(u=lm(f),u.c(),O(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(O(t.$$.fragment,f),O(l.$$.fragment,f),O(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&y(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function j5(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function z5(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[3].logo)&&p(e,"src",t),s&8&&i!==(i=l[3].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function U5(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?z5:j5}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=B(l),o=C(),r=b("small"),a=B("("),f=B(u),c=B(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){v(g,e,_),h.m(e,null),v(g,t,_),v(g,i,_),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(g,_){m===(m=d(g))&&h?h.p(g,_):(h.d(1),h=m(g),h&&(h.c(),h.m(e,null))),_&8&&l!==(l=g[3].title+"")&&oe(s,l),_&8&&u!==(u=g[3].key+"")&&oe(f,u)},d(g){g&&(y(e),y(t),y(i)),h.d()}}}function sm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[Oe(qe.call(null,e,{text:"Remove provider",position:"right"})),W(e,"click",n[10])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function V5(n){let e,t,i,l,s,o,r,a,u=!n[4]&&sm(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[8]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),w(l,s),r||(a=W(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=sm(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(l.disabled=o)},d(f){f&&(y(e),y(t),y(i),y(l)),u&&u.d(f),r=!1,a()}}}function B5(n){let e,t,i={btnClose:!1,$$slots:{footer:[V5],header:[U5],default:[H5]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function W5(n,e,t){let i,l;const s=kt(),o="provider_popup_"+V.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=V.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){Yn(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function k(){_n(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function M(P){u=P,t(1,u)}const E=()=>_();function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,l="oauth2.providers."+m)},[g,u,r,a,f,d,l,i,o,_,k,h,c,m,S,$,T,M,E,L,I,A]}class Y5 extends Se{constructor(e){super(),we(this,e,W5,B5,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function K5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[2]),r||(a=W(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&4&&s.value!==u[2]&&he(s,u[2])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function J5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Team ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[3]),r||(a=W(s,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&8&&s.value!==u[3]&&he(s,u[3])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function Z5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Key ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[4]),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&16&&s.value!==u[4]&&he(s,u[4])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function G5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",ur),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[6]),u||(f=[Oe(qe.call(null,l,{text:`Max ${ur} seconds (~${ur/(60*60*24*30)<<0} months).`,position:"top"})),W(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&>(r.value)!==c[6]&&he(r,c[6])},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function X5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Private key"),l=C(),s=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- + (Learn more) .

`,t=C(),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),ee(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){v(d,e,m),v(d,t,m),v(d,i,m),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&ee(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(y(e),y(t),y(i)),H(l),H(r)}}}function g5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function b5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Bp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function k5(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?b5:g5}let a=r(n),u=a(n),f=n[1]&&Bp();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=Bp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function y5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[k5],default:[_5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function v5(n,e,t){let i,l;Qe(n,yn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!V.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class w5 extends Se{constructor(e){super(),we(this,e,v5,y5,ke,{collection:0})}}const S5=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i}const T5=n=>({}),Kp=n=>({});function Jp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Zp(n){let e,t,i;return{c(){e=b("div"),t=B(n[2]),i=C(),p(e,"class","block txt-placeholder"),ee(e,"link-hint",!n[5]&&!n[6])},m(l,s){v(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&ee(e,"link-hint",!l[5]&&!l[6])},d(l){l&&y(e)}}}function $5(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function C5(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Gp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,"Clear")),W(e,"click",On(nt(l)))],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function Xp(n){let e,t,i,l,s,o;const r=[C5,$5],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Gp(n);return{c(){e=b("div"),i.c(),l=C(),f&&f.c(),s=C(),p(e,"class","option")},m(c,d){v(c,e,d),a[t].m(e,null),w(e,l),f&&f.m(e,null),w(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),M(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Gp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&y(e),a[t].d(),f&&f.d()}}}function Qp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[E5]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function xp(n){let e,t,i,l,s,o,r,a,u=n[17].length&&em(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=C(),s=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(t,l),w(t,s),he(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=W(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&he(s,f[17]),f[17].length?u?u.p(f,c):(u=em(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&y(e),u&&u.d(),r=!1,a()}}}function em(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",On(nt(n[23]))),i=!0)},p:te,d(s){s&&y(e),i=!1,l()}}}function tm(n){let e,t=n[1]&&nm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=nm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function nm(n){let e,t;return{c(){e=b("div"),t=B(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&y(e)}}}function O5(n){let e=n[50]+"",t;return{c(){t=B(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&oe(t,e)},i:te,o:te,d(i){i&&y(t)}}}function M5(n){let e,t,i;const l=[{item:n[50]},n[13]];var s=n[12];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function im(n){let e,t,i,l,s,o,r;const a=[M5,O5],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[40](n[50],...m)}function d(...m){return n[41](n[50],...m)}return{c(){e=b("div"),i.c(),l=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),ee(e,"closable",n[9]),ee(e,"selected",n[21](n[50]))},m(m,h){v(m,e,h),u[t].m(e,null),w(e,l),s=!0,o||(r=[W(e,"click",c),W(e,"keydown",d)],o=!0)},p(m,h){n=m;let g=t;t=f(n),t===g?u[t].p(n,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),M(i,1),i.m(e,l)),(!s||h[0]&512)&&ee(e,"closable",n[9]),(!s||h[0]&6291456)&&ee(e,"selected",n[21](n[50]))},i(m){s||(M(i),s=!0)},o(m){D(i),s=!1},d(m){m&&y(e),u[t].d(),o=!1,Ie(r)}}}function E5(n){let e,t,i,l,s,o=n[14]&&xp(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Kp);let u=de(n[22]),f=[];for(let g=0;gD(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=tm(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Wp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;gD(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Zp(n));let c=!n[5]&&!n[6]&&Qp(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&ee(e,"upside",d[7]),(!o||m[0]&32784)&&ee(e,"multiple",d[4]),(!o||m[0]&32800)&&ee(e,"disabled",d[5]),(!o||m[0]&32832)&&ee(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=_()}=e,{toggle:S=d}=e,{closable:$=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=kt();let{class:N=""}=e,R,z="",F,U;function J(ve){if(V.isEmpty(k))return;let Ce=V.toArray(k);V.inArray(Ce,ve)&&(V.removeByValue(Ce,ve),t(0,k=d?Ce:(Ce==null?void 0:Ce[0])||_())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Y(ve){if(d){let Ce=V.toArray(k);V.inArray(Ce,ve)||t(0,k=[...Ce,ve])}else t(0,k=ve);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Z(ve){return l(ve)?J(ve):Y(ve)}function G(){t(0,k=_()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function pe(){R!=null&&R.show&&(R==null||R.show())}function ce(){R!=null&&R.hide&&(R==null||R.hide())}function ue(){if(V.isEmpty(k)||V.isEmpty(c))return;let ve=V.toArray(k),Ce=[];for(const ct of ve)V.inArray(c,ct)||Ce.push(ct);if(Ce.length){for(const ct of Ce)V.removeByValue(ve,ct);t(0,k=d?ve:ve[0])}}function Te(){t(17,z="")}function Ke(ve,Ce){ve=ve||[];const ct=A||I5;return ve.filter(Ht=>ct(Ht,Ce))||[]}function Je(ve,Ce){ve.preventDefault(),S&&d?Z(Ce):Y(Ce)}function ft(ve,Ce){(ve.code==="Enter"||ve.code==="Space")&&(Je(ve,Ce),$&&ce())}function et(){Te(),setTimeout(()=>{const ve=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ve&&(ve.focus(),ve.scrollIntoView({block:"nearest"}))},0)}function xe(ve){ve.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Xt(()=>{const ve=document.querySelectorAll(`label[for="${r}"]`);for(const Ce of ve)Ce.addEventListener("click",xe);return()=>{for(const Ce of ve)Ce.removeEventListener("click",xe)}});const We=ve=>J(ve);function at(ve){ie[ve?"unshift":"push"](()=>{U=ve,t(20,U)})}function jt(){z=this.value,t(17,z)}const Ve=(ve,Ce)=>Je(Ce,ve),Ee=(ve,Ce)=>ft(Ce,ve);function st(ve){ie[ve?"unshift":"push"](()=>{R=ve,t(18,R)})}function De(ve){Pe.call(this,n,ve)}function Ye(ve){ie[ve?"unshift":"push"](()=>{F=ve,t(19,F)})}return n.$$set=ve=>{"id"in ve&&t(27,r=ve.id),"noOptionsText"in ve&&t(1,a=ve.noOptionsText),"selectPlaceholder"in ve&&t(2,u=ve.selectPlaceholder),"searchPlaceholder"in ve&&t(3,f=ve.searchPlaceholder),"items"in ve&&t(28,c=ve.items),"multiple"in ve&&t(4,d=ve.multiple),"disabled"in ve&&t(5,m=ve.disabled),"readonly"in ve&&t(6,h=ve.readonly),"upside"in ve&&t(7,g=ve.upside),"zeroFunc"in ve&&t(29,_=ve.zeroFunc),"selected"in ve&&t(0,k=ve.selected),"toggle"in ve&&t(8,S=ve.toggle),"closable"in ve&&t(9,$=ve.closable),"labelComponent"in ve&&t(10,T=ve.labelComponent),"labelComponentProps"in ve&&t(11,O=ve.labelComponentProps),"optionComponent"in ve&&t(12,E=ve.optionComponent),"optionComponentProps"in ve&&t(13,L=ve.optionComponentProps),"searchable"in ve&&t(14,I=ve.searchable),"searchFunc"in ve&&t(30,A=ve.searchFunc),"class"in ve&&t(15,N=ve.class),"$$scope"in ve&&t(45,o=ve.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),Te()),n.$$.dirty[0]&268566528&&t(22,i=Ke(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ve){const Ce=V.toArray(k);return V.inArray(Ce,ve)})},[k,a,u,f,d,m,h,g,S,$,T,O,E,L,I,N,J,z,R,F,U,l,i,Te,Je,ft,et,r,c,_,A,Y,Z,G,pe,ce,s,We,at,jt,Ve,Ee,st,De,Ye,o]}class ps extends Se{constructor(e){super(),we(this,e,L5,D5,ke,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,zeroFunc:29,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:30,class:15,deselectItem:16,selectItem:31,toggleItem:32,reset:33,showDropdown:34,hideDropdown:35},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[31]}get toggleItem(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get showDropdown(){return this.$$.ctx[34]}get hideDropdown(){return this.$$.ctx[35]}}function A5(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o',i=C(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ei(l,a)},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),l.autofocus&&l.focus(),s||(o=[Oe(qe.call(null,t,{position:"left",text:"Set new value"})),W(t,"click",nt(n[3]))],s=!0)},p(u,f){ei(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(y(e),y(i),y(l)),s=!1,Ie(o)}}}function N5(n){let e;function t(s,o){return s[1]?P5:A5}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function R5(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await dn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class ef extends Se{constructor(e){super(),we(this,e,R5,N5,ke,{value:0,mask:1})}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[1].clientId),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&2&&s.value!==u[1].clientId&&he(s,u[1].clientId)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function q5(n){let e,t,i,l,s,o,r,a;function u(d){n[15](d)}function f(d){n[16](d)}let c={id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[1].clientSecret!==void 0&&(c.value=n[1].clientSecret),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Client secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function lm(n){let e,t,i,l;const s=[{key:n[6]},n[3].optionsComponentProps||{}];function o(u){n[17](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&q(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}r?(t=zt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){l||(t&&M(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&y(e),t&&H(t)}}}function H5(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[F5,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[q5,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&lm(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=W(e,"submit",nt(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=lm(f),u.c(),M(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(M(t.$$.fragment,f),M(l.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&y(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function j5(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function z5(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[3].logo)&&p(e,"src",t),s&8&&i!==(i=l[3].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function U5(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?z5:j5}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=B(l),o=C(),r=b("small"),a=B("("),f=B(u),c=B(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){v(g,e,_),h.m(e,null),v(g,t,_),v(g,i,_),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(g,_){m===(m=d(g))&&h?h.p(g,_):(h.d(1),h=m(g),h&&(h.c(),h.m(e,null))),_&8&&l!==(l=g[3].title+"")&&oe(s,l),_&8&&u!==(u=g[3].key+"")&&oe(f,u)},d(g){g&&(y(e),y(t),y(i)),h.d()}}}function sm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[Oe(qe.call(null,e,{text:"Remove provider",position:"right"})),W(e,"click",n[10])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function V5(n){let e,t,i,l,s,o,r,a,u=!n[4]&&sm(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[8]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),w(l,s),r||(a=W(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=sm(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(l.disabled=o)},d(f){f&&(y(e),y(t),y(i),y(l)),u&&u.d(f),r=!1,a()}}}function B5(n){let e,t,i={btnClose:!1,$$slots:{footer:[V5],header:[U5],default:[H5]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function W5(n,e,t){let i,l;const s=kt(),o="provider_popup_"+V.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=V.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){Yn(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function k(){_n(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>_();function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,l="oauth2.providers."+m)},[g,u,r,a,f,d,l,i,o,_,k,h,c,m,S,$,T,O,E,L,I,A]}class Y5 extends Se{constructor(e){super(),we(this,e,W5,B5,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function K5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[2]),r||(a=W(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&4&&s.value!==u[2]&&he(s,u[2])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function J5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Team ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[3]),r||(a=W(s,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&8&&s.value!==u[3]&&he(s,u[3])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function Z5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Key ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[4]),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&16&&s.value!==u[4]&&he(s,u[4])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function G5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",ur),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[6]),u||(f=[Oe(qe.call(null,l,{text:`Max ${ur} seconds (~${ur/(60*60*24*30)<<0} months).`,position:"top"})),W(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&>(r.value)!==c[6]&&he(r,c[6])},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function X5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Private key"),l=C(),s=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[5]),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&he(s,c[5])},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function Q5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S;return l=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[K5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[J5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[Z5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[G5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[X5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),j(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){v($,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(g,t,null),_=!0,k||(S=W(e,"submit",nt(n[17])),k=!0)},p($,T){const M={};T&25165828&&(M.$$scope={dirty:T,ctx:$}),l.$set(M);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){_||(O(l.$$.fragment,$),O(r.$$.fragment,$),O(f.$$.fragment,$),O(m.$$.fragment,$),O(g.$$.fragment,$),_=!0)},o($){D(l.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),_=!1},d($){$&&y(e),H(l),H(r),H(f),H(m),H(g),k=!1,S()}}}function x5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function e8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],ee(l,"btn-loading",n[7])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&ee(l,"btn-loading",c[7])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function t8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[e8],header:[x5],default:[Q5]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ur=15777e3;function n8(n,e,t){let i;const l=kt(),s="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||ur),Ut({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await _e.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),nn("Successfully generated client secret."),l("submit",P),o==null||o.hide()}catch(P){_e.error(P)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const M=()=>g(),E=()=>!d;function L(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,g,m,_,k,S,$,T,M,E,L,I,A]}class i8 extends Se{constructor(e){super(),we(this,e,n8,t8,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function l8(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new i8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Generate secret",o=C(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),q(r,d,m),a=!0,u||(f=W(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(O(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(y(e),y(o)),n[4](null),H(r,d),u=!1,f()}}}function s8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){ie[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class o8 extends Se{constructor(e){super(),we(this,e,s8,l8,ke,{key:1,config:0})}}function r8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].authURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].authURL&&he(s,c[0].authURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function a8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].tokenURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].tokenURL&&he(s,c[0].tokenURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function u8(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[r8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[a8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(O(i.$$.fragment,r),O(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l)),H(i,r),H(s,r)}}}function f8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authURL=this.value,t(0,l)}function o(){l.tokenURL=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class c8 extends Se{constructor(e){super(),we(this,e,f8,u8,ke,{key:1,config:0})}}function om(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&y(e)}}}function d8(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&om(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=B(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),v(o,e,r),v(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=om(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&oe(l,i)},i:te,o:te,d(o){o&&(y(e),y(t)),s&&s.d(o)}}}function p8(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class rm extends Se{constructor(e){super(),we(this,e,p8,d8,ke,{item:0})}}const m8=n=>({}),am=n=>({});function h8(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[13],am);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&8192)&&Pt(i,t,l,l[13],e?At(t,l[13],s,m8):Nt(l[13]),am)},i(l){e||(O(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function _8(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[h8]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function g8(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=rm}=e,{optionComponent:c=rm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=V.toArray(T,!0);let M=[];for(let E of T){const L=V.findByKey(r,d,E);L&&M.push(L)}T.length&&!M.length||t(0,u=a?M:M[0])}async function g(T){let M=V.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?M:M[0])}function _(T){u=T,t(0,u)}function k(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(13,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&g(u)},[u,r,a,f,c,l,m,d,s,_,k,S,$,o]}class zn extends Se{constructor(e){super(),we(this,e,g8,_8,ke,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function b8(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Wt(c)),t(5,s=lt(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=V.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ms extends Se{constructor(e){super(),we(this,e,k8,b8,ke,{value:0,separator:1,readonly:2,disabled:3})}}function y8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Display name"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].displayName),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&he(s,u[0].displayName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function v8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function w8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function S8(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("Fetch user info from"),l=C(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function T8(n){let e,t,i,l,s,o,r,a;return l=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[C8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[O8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token - is a direct result of the trusted server code->token exchange response.`,i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){v(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(O(l.$$.fragment,u),O(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=He(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=He(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),H(l),H(o),u&&r&&r.end()}}}function $8(n){let e,t,i,l;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[M8,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){v(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(O(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=He(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=He(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&y(e),H(t),s&&i&&i.end()}}}function C8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].extra.jwksURL),u||(f=[Oe(qe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),W(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&he(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function O8(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ms({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(O(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function M8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function E8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){v(c,e,d),e.checked=n[0].pkce,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[11]),Oe(qe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function D8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[y8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[v8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[w8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[S8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[$8,T8],S=[];function $(T,M){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[E8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),j(s.$$.fragment),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),j(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,M){q(e,T,M),v(T,t,M),v(T,i,M),v(T,l,M),q(s,T,M),v(T,o,M),q(r,T,M),v(T,a,M),q(u,T,M),v(T,f,M),v(T,c,M),S[d].m(c,null),v(T,h,M),q(g,T,M),_=!0},p(T,[M]){const E={};M&2&&(E.name=T[1]+".displayName"),M&24577&&(E.$$scope={dirty:M,ctx:T}),e.$set(E);const L={};M&2&&(L.name=T[1]+".authURL"),M&24577&&(L.$$scope={dirty:M,ctx:T}),s.$set(L);const I={};M&2&&(I.name=T[1]+".tokenURL"),M&24577&&(I.$$scope={dirty:M,ctx:T}),r.$set(I);const A={};M&24580&&(A.$$scope={dirty:M,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,M):(re(),D(S[P],1,1,()=>{S[P]=null}),ae(),m=S[d],m?m.p(T,M):(m=S[d]=k[d](T),m.c()),O(m,1),m.m(c,null));const N={};M&2&&(N.name=T[1]+".pkce"),M&24577&&(N.$$scope={dirty:M,ctx:T}),g.$set(N)},i(T){_||(O(e.$$.fragment,T),O(s.$$.fragment,T),O(r.$$.fragment,T),O(u.$$.fragment,T),O(m),O(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(y(t),y(i),y(l),y(o),y(a),y(f),y(c),y(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(g,T)}}}function I8(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;V.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(_){o=_,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(_){n.$$.not_equal(l.extra.issuers,_)&&(l.extra.issuers=_,t(0,l))}function g(){l.pkce=this.checked,t(0,l)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,l=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,g]}class va extends Se{constructor(e){super(),we(this,e,I8,D8,ke,{key:1,config:0})}}function L8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function A8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function P8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function N8(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[L8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[A8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[P8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=B(n[2]),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),q(l,f,c),v(f,s,c),q(o,f,c),v(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&oe(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(O(l.$$.fragment,f),O(o.$$.fragment,f),O(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(e),y(i),y(s),y(r)),H(l,f),H(o,f),H(a,f)}}}function R8(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authURL=this.value,t(0,s)}function u(){s.tokenURL=this.value,t(0,s)}function f(){s.userInfoURL=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class wa extends Se{constructor(e){super(),we(this,e,R8,N8,ke,{key:1,config:0,required:4,title:2})}}const tf=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:o8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:c8},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:wa,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function um(n,e,t){const i=n.slice();return i[16]=e[t],i}function fm(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){v(o,e,r),i=!0,l||(s=W(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function F8(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&fm(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(s,"id",o=n[19]),p(s,"type","text"),p(s,"placeholder","Search provider")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[1]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(s,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(s,"id",o),m&2&&s.value!==d[1]&&he(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&O(c,1)):(c=fm(d),c.c(),O(c,1),c.m(a.parentNode,a)):c&&(re(),D(c,1,1,()=>{c=null}),ae())},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function cm(n){let e,t,i,l,s=n[1]!=""&&dm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),s&&s.c(),l=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){v(o,e,r),w(e,t),w(e,i),s&&s.m(e,null),w(e,l)},p(o,r){o[1]!=""?s?s.p(o,r):(s=dm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function dm(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[5]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[16].logo)&&p(e,"src",t),s&8&&i!==(i=l[16].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function mm(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,k=e[16].logo&&pm(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),k&&k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-6"),this.first=t},m($,T){v($,t,T),w(t,i),w(i,l),k&&k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(t,h),g||(_=W(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=pm(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&oe(u,a),T&8&&d!==(d=e[16].key+"")&&oe(m,d)},d($){$&&y(t),k&&k.d(),g=!1,_()}}}function q8(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[F8,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=de(n[3]);const a=f=>f[16].key;for(let f=0;f!l.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=$=>f($);function _($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}function k($){Pe.call(this,n,$)}function S($){Pe.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,l=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||l!==-1)&&t(3,r=c())},[u,o,s,r,f,d,l,a,m,h,g,_,k,S]}class V8 extends Se{constructor(e){super(),we(this,e,U8,z8,ke,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const l=i[9](i[28].name);return i[29]=l,i}function B8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[10]),r=!0)},p(u,f){f[0]&134217728&&t!==(t=u[27])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].oauth2.enabled),f[0]&134217728&&o!==(o=u[27])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function W8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Y8(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s[0]&1&&!bn(e.src,t="./images/oauth2/"+l[29].logo)&&p(e,"src",t),s[0]&1&&i!==(i=l[29].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function _m(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,{text:"Edit config",position:"left"})),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function gm(n,e){var $;let t,i,l,s,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,M){var E;return(E=T[29])!=null&&E.logo?Y8:W8}let _=g(e),k=_(e),S=e[29]&&_m(e);return{key:n,first:null,c(){var T,M,E;t=b("div"),i=b("div"),l=b("figure"),k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),S&&S.c(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),ee(i,"error",!V.isEmpty((E=(M=(T=e[1])==null?void 0:T.oauth2)==null?void 0:M.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,M){v(T,t,M),w(t,i),w(i,l),k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(i,h),S&&S.m(i,null)},p(T,M){var E,L,I,A;e=T,_===(_=g(e))&&k?k.p(e,M):(k.d(1),k=_(e),k&&(k.c(),k.m(l,null))),M[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&oe(u,a),M[0]&1&&d!==(d=e[28].name+"")&&oe(m,d),e[29]?S?S.p(e,M):(S=_m(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),M[0]&3&&ee(i,"error",!V.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&y(t),k.d(),S&&S.d()}}}function K8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function J8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function bm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[Z8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[G8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[X8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[Q8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,k){v(_,e,k),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),g=!0},p(_,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:_}),l.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:_}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:_}),f.$set(T);const M={};k[0]&134217761|k[1]&2&&(M.$$scope={dirty:k,ctx:_}),m.$set(M)},i(_){g||(O(l.$$.fragment,_),O(r.$$.fragment,_),O(f.$$.fragment,_),O(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=He(e,mt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=He(e,mt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&y(e),H(l),H(r),H(f),H(m),_&&h&&h.end()}}}function Z8(n){let e,t,i,l,s,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:lO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 full name"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function G8(n){let e,t,i,l,s,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:sO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 avatar"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function X8(n){let e,t,i,l,s,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:oO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 id"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function Q8(n){let e,t,i,l,s,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:rO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 username"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function x8(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,k,S,$,T,M,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[B8,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=de(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=B("Optional "),h=B(m),g=B(" create fields map"),_=C(),N.c(),S=C(),R&&R.c(),$=ye(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),v(z,t,F),v(z,i,F);for(let U=0;U{R=null}),ae())},i(z){T||(O(e.$$.fragment,z),O(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(y(t),y(i),y(u),y(f),y(S),y($)),H(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,s),v(a,o,u),v(a,r,u)},p(a,u){u[0]&128&&oe(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&oe(s,l),u[0]&128&&ee(e,"label-warning",!a[7]),u[0]&128&&ee(e,"label-info",a[7]>0)},d(a){a&&(y(e),y(o),y(r))}}}function km(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function nO(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?tO:eO}let a=r(n),u=a(n),f=n[8]&&km();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[8]?f?d[0]&256&&O(f,1):(f=km(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function iO(n){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[nO],default:[x8]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(ym))||[]};i=new V8({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new Y5({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(c,d){q(e,c,d),v(c,t,d),q(i,c,d),v(c,l,d),q(s,c,d),o=!0},p(c,d){var _,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:k.map(ym))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(O(e.$$.fragment,c),O(i.$$.fragment,c),O(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(y(t),y(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const lO=()=>"",sO=()=>"",oO=()=>"",rO=()=>"",ym=n=>n.name;function aO(n,e,t){let i,l,s;Qe(n,yn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function g(F=[]){var U,J;t(5,m=((U=F==null?void 0:F.filter(Y=>a.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:U.map(Y=>Y.name))||[]),t(6,h=((J=F==null?void 0:F.filter(Y=>u.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:J.map(Y=>Y.name))||[])}function _(F){for(let U of tf)if(U.key==F)return U;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,U,J)=>{c==null||c.show(F,U,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function M(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var U,J;c.show(F.detail,{},((J=(U=o.oauth2)==null?void 0:U.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const U=F.detail.uiOptions;V.removeByKey(o.oauth2.providers,"name",U.key),t(0,o)},z=F=>{const U=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),V.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:U.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,U;n.$$.dirty[0]&1&&V.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&g(o.fields),n.$$.dirty[0]&2&&t(8,i=!V.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((U=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:U.length)||0)},[o,s,f,c,d,m,h,l,i,_,k,S,$,T,M,E,L,I,A,P,N,R,z]}class uO extends Se{constructor(e){super(),we(this,e,aO,iO,ke,{collection:0},null,[-1,-1])}}function vm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function fO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&vm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].otp.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=[W(e,"change",n[4]),W(e,"change",n[5])],u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&1&&(e.checked=d[0].otp.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[2]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,Ie(f)}}}function cO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.duration),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.duration&&he(s,u[0].otp.duration)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function dO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Generated password length"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.length),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.length&&he(s,u[0].otp.length)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pO(n){let e,t,i,l,s,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[fO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),v(f,t,c),v(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(O(e.$$.fragment,f),O(s.$$.fragment,f),O(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(t),y(i)),H(e,f),H(s),H(a)}}}function mO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function hO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function wm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function _O(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?hO:mO}let a=r(n),u=a(n),f=n[1]&&wm();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&O(f,1):(f=wm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function gO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[_O],default:[pO]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bO(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o.otp)&&t(0,o.otp={enabled:!0,duration:300,length:8},o),n.$$.dirty&1&&t(2,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,l=!V.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class kO extends Se{constructor(e){super(),we(this,e,bO,gO,ke,{collection:0})}}function Sm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function yO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&Sm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},m(d,m){v(d,e,m),e.checked=n[0].passwordAuth.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=Sm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function vO(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function wO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[yO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[vO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function SO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function TO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function $O(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?TO:SO}let a=r(n),u=a(n),f=n[2]&&Tm();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&O(f,1):(f=Tm(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function CO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[$O],default:[wO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function OO(n,e,t){let i,l,s;Qe(n,yn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],g=(d==null?void 0:d.indexes)||[];for(let _ of g){const k=V.parseIndex(_);if(!k.unique||k.columns.length!=1||k.columns[0].name=="email")continue;const S=h.find($=>!$.hidden&&$.name.toLowerCase()==k.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!V.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class MO extends Se{constructor(e){super(),we(this,e,OO,CO,ke,{collection:0})}}function $m(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cm(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=Fy(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=B(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,he(i,i.__value),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,g){v(h,t,g),w(t,i),i.checked=i.__value===e[2],w(t,s),w(t,o),w(o,a),w(t,f),d||(m=W(i,"change",e[10]),d=!0)},p(h,g){e=h,g&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),g&4&&(i.checked=i.__value===e[2]),g&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&y(t),c.r(),d=!1,m()}}}function EO(n){let e=[],t=new Map,i,l=de(n[7]);const s=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[DO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=W(e,"submit",nt(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(O(t.$$.fragment,a),O(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),H(l),o=!1,r()}}}function LO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function AO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],ee(l,"btn-loading",n[4])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&ee(l,"btn-loading",c[4])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function PO(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[AO],header:[LO],default:[IO]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const Sa="last_email_test",Om="email_test_request";function NO(n,e,t){let i;const l=kt(),s="email_test_"+V.randomString(5),o=[{label:"Verification",value:"verification"},{label:"Password reset",value:"password-reset"},{label:"Confirm email change",value:"email-change"},{label:"OTP",value:"otp"},{label:"Login alert",value:"login-alert"}];let r,a="",u=localStorage.getItem(Sa),f=o[0].value,c=!1,d=null;function m(I="",A="",P=""){a=I||"_superusers",t(1,u=A||localStorage.getItem(Sa)),t(2,f=P||o[0].value),Ut({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function g(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(Sa,u),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Om),Ci("Test email send timeout.")},3e4);try{await _e.settings.testEmail(a,u,f,{$cancelKey:Om}),nn("Successfully sent test email."),l("submit"),t(4,c=!1),await dn(),h()}catch(I){t(4,c=!1),_e.error(I)}clearTimeout(d)}}const _=[[]];function k(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const $=()=>g(),T=()=>!c;function M(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function E(I){Pe.call(this,n,I)}function L(I){Pe.call(this,n,I)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,g,m,k,_,S,$,T,M,E,L]}class gy extends Se{constructor(e){super(),we(this,e,NO,PO,ke,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Mm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function RO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].authAlert.enabled),f&2097152&&o!==(o=u[21])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function Em(n){let e,t,i;function l(o){n[11](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new uO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Dm(n,e){var a;let t,i,l,s;function o(u){e[15](u,e[18])}let r={single:!0,key:e[18].key,title:e[18].label,placeholders:(a=e[18])==null?void 0:a.placeholders};return e[18].config!==void 0&&(r.config=e[18].config),i=new G6({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,$e(()=>l=!1)),i.$set(c)},i(u){s||(O(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&y(t),H(i,u)}}}function FO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P=[],N=new Map,R,z,F,U,J,Y,Z,G,pe,ce,ue;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[RO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function Te(De){n[10](De)}let Ke={};n[0]!==void 0&&(Ke.collection=n[0]),u=new MO({props:Ke}),ie.push(()=>be(u,"collection",Te));let Je=!n[1]&&Em(n);function ft(De){n[12](De)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new kO({props:et}),ie.push(()=>be(m,"collection",ft));function xe(De){n[13](De)}let We={};n[0]!==void 0&&(We.collection=n[0]),_=new w5({props:We}),ie.push(()=>be(_,"collection",xe));let at=de(n[2]);const jt=De=>De[18].key;for(let De=0;Debe(J,"collection",Ve));let st={};return G=new gy({props:st}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),c=C(),Je&&Je.c(),d=C(),j(m.$$.fragment),g=C(),j(_.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",M=C(),E=b("button"),E.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let De=0;Def=!1)),u.$set(Ce),De[1]?Je&&(re(),D(Je,1,1,()=>{Je=null}),ae()):Je?(Je.p(De,Ye),Ye&2&&O(Je,1)):(Je=Em(De),Je.c(),O(Je,1),Je.m(a,d));const ct={};!h&&Ye&1&&(h=!0,ct.collection=De[0],$e(()=>h=!1)),m.$set(ct);const Ht={};!k&&Ye&1&&(k=!0,Ht.collection=De[0],$e(()=>k=!1)),_.$set(Ht),Ye&4&&(at=de(De[2]),re(),P=vt(P,Ye,jt,1,De,at,N,A,Bt,Dm,null,Mm),ae());const Le={};!Y&&Ye&1&&(Y=!0,Le.collection=De[0],$e(()=>Y=!1)),J.$set(Le);const ot={};G.$set(ot)},i(De){if(!pe){O(o.$$.fragment,De),O(u.$$.fragment,De),O(Je),O(m.$$.fragment,De),O(_.$$.fragment,De);for(let Ye=0;Yec==null?void 0:c.show(u.id);function S(M,E){n.$$.not_equal(E.config,M)&&(E.config=M,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function $(M){u=M,t(0,u)}function T(M){ie[M?"unshift":"push"](()=>{c=M,t(3,c)})}return n.$$set=M=>{"collection"in M&&t(0,u=M.collection)},n.$$.update=()=>{var M,E;n.$$.dirty&1&&typeof((M=u.otp)==null?void 0:M.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,g,_,k,S,$,T]}class HO extends Se{constructor(e){super(),we(this,e,qO,FO,ke,{collection:0})}}const jO=n=>({dragging:n&4,dragover:n&8}),Im=n=>({dragging:n[2],dragover:n[3]});function zO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(o,n,n[9],Im);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),ee(e,"dragging",n[2]),ee(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"dragover",nt(n[11])),W(e,"dragleave",nt(n[12])),W(e,"dragend",n[13]),W(e,"dragstart",n[14]),W(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Pt(r,o,a,a[9],i?At(o,a[9],u,jO):Nt(a[9]),Im),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&ee(e,"dragging",a[2]),(!i||u&8)&&ee(e,"dragover",a[3])},i(a){i||(O(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function UO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,M){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:M,group:a})),s("drag",T)}}function h(T,M){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const L=E.index<<0;L{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,k,S,$]}class _o extends Se{constructor(e){super(),we(this,e,UO,zO,ke,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Lm(n,e,t){const i=n.slice();return i[27]=e[t],i}function VO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=W(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function BO(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),O(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],$e(()=>t=!1)),e.$set(c)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function WO(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function YO(n){let e,t,i,l;const s=[WO,BO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function Am(n){let e,t,i,l=de(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[YO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Am(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),r&&r.c(),s=ye()},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),r&&r.m(a,u),v(a,s,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Am(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(O(e.$$.fragment,a),O(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l),y(s)),H(e,a),H(i,a),r&&r.d(a)}}}function JO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=B(t),l=B(" index")},m(s,o){v(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&y(e)}}}function Nm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,{text:"Delete",position:"top"})),W(e,"click",n[16])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function ZO(n){let e,t,i,l,s,o,r=n[5]!=""&&Nm(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),ee(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),s||(o=[W(t,"click",n[17]),W(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Nm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&ee(l,"btn-disabled",a[9].length<=0)},d(a){a&&(y(e),y(t),y(i),y(l)),r&&r.d(a),s=!1,Ie(o)}}}function GO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[ZO],header:[JO],default:[KO]},$$scope:{ctx:n}};for(let s=0;sZ.name==U);Y?V.removeByValue(J.columns,Y):V.pushUnique(J.columns,{name:U}),t(2,d=V.buildIndex(J))}Xt(async()=>{t(8,g=!0);try{t(7,h=(await Tt(async()=>{const{default:U}=await import("./CodeEditor-7pyapRXP.js");return{default:U}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,g=!1)});const E=()=>$(),L=()=>k(),I=()=>T(),A=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=V.buildIndex(l))};function P(U){d=U,t(2,d)}const N=U=>M(U);function R(U){ie[U?"unshift":"push"](()=>{f=U,t(4,f)})}function z(U){Pe.call(this,n,U)}function F(U){Pe.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),Wt(U)),t(14,r=lt(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,J,Y;n.$$.dirty[0]&1&&t(10,i=((J=(U=u==null?void 0:u.fields)==null?void 0:U.filter(Z=>!Z.toDelete&&Z.name!="id"))==null?void 0:J.map(Z=>Z.name))||[]),n.$$.dirty[0]&4&&t(3,l=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((Y=l.columns)==null?void 0:Y.map(Z=>Z.name))||[])},[u,k,d,l,f,c,m,h,g,s,i,$,T,M,r,_,E,L,I,A,P,N,R,z,F]}class QO extends Se{constructor(e){super(),we(this,e,XO,GO,ke,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Rm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=V.parseIndex(i[10]);return i[11]=l,i}function Fm(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){var u;v(r,e,a),l=!0,s||(o=Oe(t=qe.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),s=!0)},p(r,a){var u;t&&It(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,$t,{duration:150},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,$t,{duration:150},!1)),i.run(0)),l=!1},d(r){r&&y(e),r&&i&&i.end(),s=!1,o()}}}function qm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Hm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(jm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&qm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Oe(r=qe.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),W(e,"click",c)],a=!0)},p(m,h){var g,_,k,S,$;n=m,n[11].unique?f||(f=qm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((g=n[11].columns)==null?void 0:g.map(jm).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&It(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&y(e),f&&f.d(),a=!1,Ie(u)}}}function xO(n){var M,E,L,I,A;let e,t,i=(((E=(M=n[0])==null?void 0:M.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&Fm(n),k=de(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;Pbe(c,"collection",$)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=B("Unique constraints and indexes ("),l=B(i),s=B(`) - `),_&&_.c(),o=C(),r=b("div");for(let P=0;P+ New index',f=C(),j(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){v(P,e,N),w(e,t),w(e,l),w(e,s),_&&_.m(e,null),v(P,o,N),v(P,r,N);for(let R=0;R{_=null}),ae()),N&7){k=de(((Y=P[0])==null?void 0:Y.indexes)||[]);let Z;for(Z=0;Zd=!1)),c.$set(R)},i(P){m||(O(_),O(c.$$.fragment,P),m=!0)},o(P){D(_),D(c.$$.fragment,P),m=!1},d(P){P&&(y(e),y(o),y(r),y(f)),_&&_.d(),dt(S,P),n[6](null),H(c,P),h=!1,g()}}}const jm=n=>n.name;function eM(n,e,t){let i;Qe(n,yn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let g=0;gs==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{var h;(h=i.indexes)!=null&&h.message&&Yn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class tM extends Se{constructor(e){super(),we(this,e,eM,xO,ke,{collection:0})}}function zm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Um(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent=`${n[5].label}`,s=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),o||(r=W(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&y(e),o=!1,r()}}}function nM(n){let e,t=de(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class sM extends Se{constructor(e){super(),we(this,e,lM,iM,ke,{class:0})}}const oM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Vm=n=>({interactive:n[7],hasErrors:n[6]}),rM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Bm=n=>({interactive:n[7],hasErrors:n[6]}),aM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Wm=n=>({interactive:n[7],hasErrors:n[6]});function Ym(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Km(n){let e,t;return{c(){e=b("span"),t=B(n[5]),p(e,"class","label label-success")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&32&&oe(t,i[5])},d(i){i&&y(e)}}}function Jm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function uM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Km(n),g=n[0].hidden&&Jm();return{c(){e=b("div"),h&&h.c(),t=C(),g&&g.c(),i=C(),l=b("div"),s=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=V.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),ee(l,"txt-disabled",!n[7]||n[0].system),p(u,"type","text"),u.required=!0,u.disabled=f=!n[7]||n[0].system,p(u,"spellcheck","false"),p(u,"placeholder","Field name"),u.value=c=n[0].name,p(u,"title","System field")},m(_,k){v(_,e,k),h&&h.m(e,null),w(e,t),g&&g.m(e,null),v(_,i,k),v(_,l,k),w(l,s),v(_,a,k),v(_,u,k),n[22](u),d||(m=[Oe(r=qe.call(null,l,n[0].type+(n[0].system?" (system)":""))),W(l,"click",n[21]),W(u,"input",n[23])],d=!0)},p(_,k){_[0].required?h?h.p(_,k):(h=Km(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Jm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k[0]&1&&o!==(o=V.getFieldTypeIcon(_[0].type))&&p(s,"class",o),r&&It(r.update)&&k[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),k[0]&129&&ee(l,"txt-disabled",!_[7]||_[0].system),k[0]&129&&f!==(f=!_[7]||_[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=_[0].name)&&u.value!==c&&(u.value=c)},d(_){_&&(y(e),y(i),y(l),y(a),y(u)),h&&h.d(),g&&g.d(),n[22](null),d=!1,Ie(m)}}}function fM(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function cM(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label",i="Toggle "+n[0].name+" field options"),p(e,"class",l="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),ee(e,"btn-hint",!n[4]&&!n[6]),ee(e,"btn-danger",n[6])},m(r,a){v(r,e,a),w(e,t),s||(o=W(e,"click",n[17]),s=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&l!==(l="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",l),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&ee(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&ee(e,"btn-danger",r[6])},d(r){r&&y(e),s=!1,o()}}}function dM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,"Restore")),W(e,"click",n[14])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function Zm(n){let e,t,i,l,s=!n[0].primaryKey&&n[0].type!="autodate"&&(!n[8]||!n[10].includes(n[0].name)),o,r=!n[0].primaryKey&&(!n[8]||!n[11].includes(n[0].name)),a,u=!n[8]||!n[12].includes(n[0].name),f,c,d,m;const h=n[20].options,g=Lt(h,n,n[28],Bm);let _=s&&Gm(n),k=r&&Xm(n),S=u&&Qm(n);const $=n[20].optionsFooter,T=Lt($,n,n[28],Vm);let M=!n[0]._toDelete&&!n[0].primaryKey&&xm(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),l=b("div"),_&&_.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),M&&M.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){v(E,e,L),w(e,t),g&&g.m(t,null),w(e,i),w(e,l),_&&_.m(l,null),w(l,o),k&&k.m(l,null),w(l,a),S&&S.m(l,null),w(l,f),T&&T.m(l,null),w(l,c),M&&M.m(l,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Pt(g,h,E,E[28],m?At(h,E[28],L,rM):Nt(E[28]),Bm),L[0]&257&&(s=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),s?_?(_.p(E,L),L[0]&257&&O(_,1)):(_=Gm(E),_.c(),O(_,1),_.m(l,o)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?k?(k.p(E,L),L[0]&257&&O(k,1)):(k=Xm(E),k.c(),O(k,1),k.m(l,a)):k&&(re(),D(k,1,1,()=>{k=null}),ae()),L[0]&257&&(u=!E[8]||!E[12].includes(E[0].name)),u?S?(S.p(E,L),L[0]&257&&O(S,1)):(S=Qm(E),S.c(),O(S,1),S.m(l,f)):S&&(re(),D(S,1,1,()=>{S=null}),ae()),T&&T.p&&(!m||L[0]&268435648)&&Pt(T,$,E,E[28],m?At($,E[28],L,oM):Nt(E[28]),Vm),!E[0]._toDelete&&!E[0].primaryKey?M?(M.p(E,L),L[0]&1&&O(M,1)):(M=xm(E),M.c(),O(M,1),M.m(l,null)):M&&(re(),D(M,1,1,()=>{M=null}),ae())},i(E){m||(O(g,E),O(_),O(k),O(S),O(T,E),O(M),E&&tt(()=>{m&&(d||(d=He(e,mt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(_),D(k),D(S),D(T,E),D(M),E&&(d||(d=He(e,mt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&y(e),g&&g.d(E),_&&_.d(),k&&k.d(),S&&S.d(),T&&T.d(E),M&&M.d(),E&&d&&d.end()}}}function Gm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[pM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435489|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),o=B(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[34])},m(m,h){v(m,e,h),e.checked=n[0].required,v(m,i,h),v(m,l,h),w(l,s),w(s,o),w(l,r),w(l,a),c||(d=[W(e,"change",n[24]),Oe(u=qe.call(null,a,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&(e.checked=m[0].required),h[0]&32&&oe(o,m[5]),u&&It(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(y(e),y(i),y(l)),c=!1,Ie(d)}}}function Xm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[mM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){v(c,e,d),e.checked=n[0].hidden,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[25]),W(e,"change",n[26]),Oe(qe.call(null,r,{text:"Hide from the JSON API response and filters."}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].hidden),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function Qm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[hM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),l=C(),s=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(s,"for",f=n[34])},m(m,h){v(m,e,h),e.checked=n[0].presentable,v(m,l,h),v(m,s,h),w(s,o),w(s,r),w(s,a),c||(d=[W(e,"change",n[27]),Oe(qe.call(null,a,{text:"Whether the field should be preferred in the Superuser UI relation listings (default to auto)."}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&i!==(i=m[0].hidden)&&(e.disabled=i),h[0]&1&&(e.checked=m[0].presentable),h[0]&1&&u!==(u="ri-information-line "+(m[0].hidden?"txt-disabled":"link-hint"))&&p(a,"class",u),h[1]&8&&f!==(f=m[34])&&p(s,"for",f)},d(m){m&&(y(e),y(l),y(s)),c=!1,Ie(d)}}}function xm(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[_M]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(o)}}}function eh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[13])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function _M(n){let e,t,i,l,s,o=!n[0].system&&eh(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ye(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){v(r,e,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l||(s=W(e,"click",nt(n[15])),l=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=eh(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),o&&o.d(r),l=!1,s()}}}function gM(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&n[2]&&Ym();l=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[uM]},$$scope:{ctx:n}}});const c=n[20].default,d=Lt(c,n,n[28],Wm),m=d||fM();function h(S,$){if(S[0]._toDelete)return dM;if(S[7])return cM}let g=h(n),_=g&&g(n),k=n[7]&&n[4]&&Zm(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),j(l.$$.fragment),s=C(),m&&m.c(),o=C(),_&&_.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),ee(e,"required",n[0].required),ee(e,"expanded",n[7]&&n[4]),ee(e,"deleted",n[0]._toDelete)},m(S,$){v(S,e,$),w(e,t),f&&f.m(t,null),w(t,i),q(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),_&&_.m(t,null),w(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=Ym(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$[0]&268435648)&&Pt(d,c,S,S[28],u?At(c,S[28],$,aM):Nt(S[28]),Wm),g===(g=h(S))&&_?_.p(S,$):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&O(k,1)):(k=Zm(S),k.c(),O(k,1),k.m(e,null)):k&&(re(),D(k,1,1,()=>{k=null}),ae()),(!u||$[0]&1)&&ee(e,"required",S[0].required),(!u||$[0]&144)&&ee(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&ee(e,"deleted",S[0]._toDelete)},i(S){u||(O(l.$$.fragment,S),O(m,S),O(k),S&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(k),S&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&y(e),f&&f.d(),H(l),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let Ta=[];function bM(n,e,t){let i,l,s,o,r;Qe(n,yn,ce=>t(19,r=ce));let{$$slots:a={},$$scope:u}=e;const f="f_"+V.randomString(8),c=kt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:k=V.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,M=!1;function E(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function L(){t(0,k._toDelete=!1,k),Ut({})}function I(){k._toDelete||(N(),c("duplicate"))}function A(ce){return V.slugify(ce)}function P(){t(4,M=!0),z()}function N(){t(4,M=!1)}function R(){M?N():P()}function z(){for(let ce of Ta)ce.id!=f&&ce.collapse()}Xt(()=>(Ta.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{V.removeByKey(Ta,"id",f)}));const F=()=>T==null?void 0:T.focus();function U(ce){ie[ce?"unshift":"push"](()=>{T=ce,t(3,T)})}const J=ce=>{const ue=k.name;t(0,k.name=A(ce.target.value),k),ce.target.value=k.name,c("rename",{oldName:ue,newName:k.name})};function Y(){k.required=this.checked,t(0,k)}function Z(){k.hidden=this.checked,t(0,k)}const G=ce=>{ce.target.checked&&t(0,k.presentable=!1,k)};function pe(){k.presentable=this.checked,t(0,k)}return n.$$set=ce=>{"key"in ce&&t(1,_=ce.key),"field"in ce&&t(0,k=ce.field),"draggable"in ce&&t(2,S=ce.draggable),"collection"in ce&&t(18,$=ce.collection),"$$scope"in ce&&t(28,u=ce.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,l=!k._toDelete),n.$$.dirty[0]&524290&&t(6,s=!V.isEmpty(V.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,_,S,T,M,o,s,l,i,c,m,h,g,E,L,I,A,R,$,r,a,F,U,J,Y,Z,G,pe,u]}class ni extends Se{constructor(e){super(),we(this,e,bM,gM,ke,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function kM(n){let e,t,i,l,s,o;function r(u){n[5](u)}let a={id:n[13],items:n[3],disabled:n[0].system,readonly:!n[12]};return n[2]!==void 0&&(a.keyOfSelected=n[2]),t=new zn({props:a}),ie.push(()=>be(t,"keyOfSelected",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Oe(qe.call(null,e,{text:"Auto set on:",position:"top"})),s=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],$e(()=>i=!1)),t.$set(c)},i(u){l||(O(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&y(e),H(t),s=!1,o()}}}function yM(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[kM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),v(r,s,a),o=!0},p(r,a){const u={};a&4096&&(u.class="form-field form-field-single-multiple-select form-field-autodate-select "+(r[12]?"":"readonly")),a&28677&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(O(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l),y(s)),H(i,r)}}}function vM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[yM,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}const $a=1,Ca=2,Oa=3;function wM(n,e,t){const i=["field","key"];let l=lt(e,i);const s=[{label:"Create",value:$a},{label:"Update",value:Ca},{label:"Create/Update",value:Oa}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Oa:o.onUpdate?Ca:$a}function f(_){switch(_){case $a:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case Ca:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Oa:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!0,o);break}}function c(_){a=_,t(2,a)}function d(_){o=_,t(0,o)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Wt(_)),t(4,l=lt(e,i)),"field"in _&&t(0,o=_.field),"key"in _&&t(1,r=_.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,s,l,c,d,m,h,g]}class SM extends Se{constructor(e){super(),we(this,e,wM,vM,ke,{field:0,key:1})}}function TM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function $M(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class CM extends Se{constructor(e){super(),we(this,e,$M,TM,ke,{field:0,key:1})}}var Ma=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],es={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},to={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Gn=function(n){return n===!0?1:0};function th(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Ea=function(n){return n instanceof Array?n:[n]};function $n(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Ot(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function Jo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function by(n,e){if(e(n))return n;if(n.parentNode)return by(n.parentNode,e)}function Zo(n,e){var t=Ot("div","numInputWrapper"),i=Ot("input","numInput "+n),l=Ot("span","arrowUp"),s=Ot("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function Un(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Da=function(){},$r=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},OM={D:Da,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Gn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Da,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Da,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},wl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},js={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[js.w(n,e,t)]},F:function(n,e,t){return $r(js.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Ln(js.h(n,e,t))},H:function(n){return Ln(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Gn(n.getHours()>11)]},M:function(n,e){return $r(n.getMonth(),!0,e)},S:function(n){return Ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Ln(n.getFullYear(),4)},d:function(n){return Ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Ln(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},ky=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return js[c]&&m[d-1]!=="\\"?js[c](r,f,t):c!=="\\"?c:""}).join("")}},fu=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||es).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var h=void 0,g=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),le=La(t.config);x.setHours(le.hours,le.minutes,le.seconds,x.getMilliseconds()),t.selectedDates=[x],t.latestSelectedDateObj=x}X!==void 0&&X.type!=="blur"&&cl(X);var ge=t._input.value;c(),Dn(),t._input.value!==ge&&t._debouncedChange()}function u(X,x){return X%12+12*Gn(x===t.l10n.amPM[1])}function f(X){switch(X%24){case 0:case 12:return 12;default:return X%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var X=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,x=(parseInt(t.minuteElement.value,10)||0)%60,le=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(X=u(X,t.amPM.textContent));var ge=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Fe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Be=Ia(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Ia(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),se=Ia(X,x,le);if(se>rt&&se=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ln(le)))}function h(X){var x=Un(X),le=parseInt(x.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,x,le,ge){if(x instanceof Array)return x.forEach(function(Fe){return g(X,Fe,le,ge)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,x,le,ge)});X.addEventListener(x,le,ge),t._handlers.push({remove:function(){return X.removeEventListener(x,le,ge)}})}function _(){Dt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(ge){return g(ge,"click",t[le])})}),t.isMobile){wn();return}var X=th(Ee,50);if(t._debouncedChange=th(_,IM),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ve(Un(le))}),g(t._input,"keydown",jt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",jt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ft):g(window.document,"mousedown",ft),g(window.document,"focus",ft,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Rl),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",En)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var x=function(le){return Un(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",$),g([t.hourElement,t.minuteElement],["focus","click"],x),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(le){a(le)})}t.config.allowInput&&g(t._input,"blur",at)}function S(X,x){var le=X!==void 0?t.parseDate(X):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(X);var Fe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Fe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Be=Ot("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Be,t.element),Be.appendChild(t.element),t.altInput&&Be.appendChild(t.altInput),Be.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function E(X,x,le,ge){var Fe=xe(x,!0),Be=Ot("span",X,x.getDate().toString());return Be.dateObj=x,Be.$i=ge,Be.setAttribute("aria-label",t.formatDate(x,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Vn(x,t.now)===0&&(t.todayDateElem=Be,Be.classList.add("today"),Be.setAttribute("aria-current","date")),Fe?(Be.tabIndex=-1,ul(x)&&(Be.classList.add("selected"),t.selectedDateElem=Be,t.config.mode==="range"&&($n(Be,"startRange",t.selectedDates[0]&&Vn(x,t.selectedDates[0],!0)===0),$n(Be,"endRange",t.selectedDates[1]&&Vn(x,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Be.classList.add("inRange")))):Be.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zi(x)&&!ul(x)&&Be.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&ge%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(x)+""),Dt("onDayCreate",Be),Be}function L(X){X.focus(),t.config.mode==="range"&&Ve(X)}function I(X){for(var x=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,ge=x;ge!=le;ge+=X)for(var Fe=t.daysContainer.children[ge],Be=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,se=Be;se!=rt;se+=X){var Me=Fe.children[se];if(Me.className.indexOf("hidden")===-1&&xe(Me.dateObj))return Me}}function A(X,x){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,ge=x>0?t.config.showMonths:-1,Fe=x>0?1:-1,Be=le-t.currentMonth;Be!=ge;Be+=Fe)for(var rt=t.daysContainer.children[Be],se=le-t.currentMonth===Be?X.$i+x:x<0?rt.children.length-1:0,Me=rt.children.length,Ne=se;Ne>=0&&Ne0?Me:-1);Ne+=Fe){var ze=rt.children[Ne];if(ze.className.indexOf("hidden")===-1&&xe(ze.dateObj)&&Math.abs(X.$i-Ne)>=Math.abs(x))return L(ze)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,x){var le=s(),ge=We(le||document.body),Fe=X!==void 0?X:ge?le:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:I(x>0?1:-1);Fe===void 0?t._input.focus():ge?A(Fe,x):L(Fe)}function N(X,x){for(var le=(new Date(X,x,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ge=t.utils.getDaysInMonth((x-1+12)%12,X),Fe=t.utils.getDaysInMonth(x,X),Be=window.document.createDocumentFragment(),rt=t.config.showMonths>1,se=rt?"prevMonthDay hidden":"prevMonthDay",Me=rt?"nextMonthDay hidden":"nextMonthDay",Ne=ge+1-le,ze=0;Ne<=ge;Ne++,ze++)Be.appendChild(E("flatpickr-day "+se,new Date(X,x-1,Ne),Ne,ze));for(Ne=1;Ne<=Fe;Ne++,ze++)Be.appendChild(E("flatpickr-day",new Date(X,x,Ne),Ne,ze));for(var Ge=Fe+1;Ge<=42-le&&(t.config.showMonths===1||ze%7!==0);Ge++,ze++)Be.appendChild(E("flatpickr-day "+Me,new Date(X,x+1,Ge%Fe),Ge,ze));var xt=Ot("div","dayContainer");return xt.appendChild(Be),xt}function R(){if(t.daysContainer!==void 0){Jo(t.daysContainer),t.weekNumbers&&Jo(t.weekNumbers);for(var X=document.createDocumentFragment(),x=0;x1||t.config.monthSelectorType!=="dropdown")){var X=function(ge){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&get.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var x=0;x<12;x++)if(X(x)){var le=Ot("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,x).getMonth().toString(),le.textContent=$r(x,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===x&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Ot("div","flatpickr-month"),x=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Ot("span","cur-month"):(t.monthsDropdownContainer=Ot("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var se=Un(rt),Me=parseInt(se.value,10);t.changeMonth(Me-t.currentMonth),Dt("onMonthChange")}),z(),le=t.monthsDropdownContainer);var ge=Zo("cur-year",{tabindex:"-1"}),Fe=ge.getElementsByTagName("input")[0];Fe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Fe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Fe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Fe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Be=Ot("div","flatpickr-current-month");return Be.appendChild(le),Be.appendChild(ge),x.appendChild(Be),X.appendChild(x),{container:X,yearElement:Fe,monthElement:le}}function U(){Jo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var x=F();t.yearElements.push(x.yearElement),t.monthElements.push(x.monthElement),t.monthNav.appendChild(x.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Ot("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Ot("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Ot("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(X){t.__hidePrevMonthArrow!==X&&($n(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&($n(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Ui(),t.monthNav}function Y(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=La(t.config);t.timeContainer=Ot("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var x=Ot("span","flatpickr-time-separator",":"),le=Zo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var ge=Zo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ge.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():X.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(le),t.timeContainer.appendChild(x),t.timeContainer.appendChild(ge),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Zo("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():X.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(Ot("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Ot("span","flatpickr-am-pm",t.l10n.amPM[Gn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function Z(){t.weekdayContainer?Jo(t.weekdayContainer):t.weekdayContainer=Ot("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var x=Ot("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(x)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,x=nh(t.l10n.weekdays.shorthand);X>0&&X({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[J5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[Z5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[G5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[X5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),j(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){v($,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(g,t,null),_=!0,k||(S=W(e,"submit",nt(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){_||(M(l.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(g.$$.fragment,$),_=!0)},o($){D(l.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),_=!1},d($){$&&y(e),H(l),H(r),H(f),H(m),H(g),k=!1,S()}}}function x5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function e8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],ee(l,"btn-loading",n[7])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&ee(l,"btn-loading",c[7])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function t8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[e8],header:[x5],default:[Q5]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ur=15777e3;function n8(n,e,t){let i;const l=kt(),s="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||ur),Ut({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await _e.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),nn("Successfully generated client secret."),l("submit",P),o==null||o.hide()}catch(P){_e.error(P)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!d;function L(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,g,m,_,k,S,$,T,O,E,L,I,A]}class i8 extends Se{constructor(e){super(),we(this,e,n8,t8,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function l8(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new i8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Generate secret",o=C(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),q(r,d,m),a=!0,u||(f=W(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(y(e),y(o)),n[4](null),H(r,d),u=!1,f()}}}function s8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){ie[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class o8 extends Se{constructor(e){super(),we(this,e,s8,l8,ke,{key:1,config:0})}}function r8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].authURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].authURL&&he(s,c[0].authURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function a8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].tokenURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].tokenURL&&he(s,c[0].tokenURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function u8(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[r8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[a8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(i.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l)),H(i,r),H(s,r)}}}function f8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authURL=this.value,t(0,l)}function o(){l.tokenURL=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class c8 extends Se{constructor(e){super(),we(this,e,f8,u8,ke,{key:1,config:0})}}function om(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&y(e)}}}function d8(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&om(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=B(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),v(o,e,r),v(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=om(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&oe(l,i)},i:te,o:te,d(o){o&&(y(e),y(t)),s&&s.d(o)}}}function p8(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class rm extends Se{constructor(e){super(),we(this,e,p8,d8,ke,{item:0})}}const m8=n=>({}),am=n=>({});function h8(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[13],am);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&8192)&&Pt(i,t,l,l[13],e?At(t,l[13],s,m8):Nt(l[13]),am)},i(l){e||(M(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function _8(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[h8]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function g8(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=rm}=e,{optionComponent:c=rm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=V.toArray(T,!0);let O=[];for(let E of T){const L=V.findByKey(r,d,E);L&&O.push(L)}T.length&&!O.length||t(0,u=a?O:O[0])}async function g(T){let O=V.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?O:O[0])}function _(T){u=T,t(0,u)}function k(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(13,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&g(u)},[u,r,a,f,c,l,m,d,s,_,k,S,$,o]}class zn extends Se{constructor(e){super(),we(this,e,g8,_8,ke,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function b8(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Wt(c)),t(5,s=lt(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=V.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ms extends Se{constructor(e){super(),we(this,e,k8,b8,ke,{value:0,separator:1,readonly:2,disabled:3})}}function y8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Display name"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].displayName),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&he(s,u[0].displayName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function v8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function w8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function S8(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("Fetch user info from"),l=C(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function T8(n){let e,t,i,l,s,o,r,a;return l=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[C8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[O8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token + is a direct result of the trusted server code->token exchange response.`,i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){v(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=He(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=He(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),H(l),H(o),u&&r&&r.end()}}}function $8(n){let e,t,i,l;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[M8,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){v(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=He(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=He(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&y(e),H(t),s&&i&&i.end()}}}function C8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].extra.jwksURL),u||(f=[Oe(qe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),W(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&he(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function O8(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ms({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function M8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function E8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){v(c,e,d),e.checked=n[0].pkce,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[11]),Oe(qe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function D8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[y8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[v8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[w8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[S8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[$8,T8],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[E8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),j(s.$$.fragment),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),j(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),v(T,t,O),v(T,i,O),v(T,l,O),q(s,T,O),v(T,o,O),q(r,T,O),v(T,a,O),q(u,T,O),v(T,f,O),v(T,c,O),S[d].m(c,null),v(T,h,O),q(g,T,O),_=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),s.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(re(),D(S[P],1,1,()=>{S[P]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(s.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(y(t),y(i),y(l),y(o),y(a),y(f),y(c),y(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(g,T)}}}function I8(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;V.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(_){o=_,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(_){n.$$.not_equal(l.extra.issuers,_)&&(l.extra.issuers=_,t(0,l))}function g(){l.pkce=this.checked,t(0,l)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,l=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,g]}class va extends Se{constructor(e){super(),we(this,e,I8,D8,ke,{key:1,config:0})}}function L8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function A8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function P8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function N8(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[L8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[A8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[P8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=B(n[2]),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),q(l,f,c),v(f,s,c),q(o,f,c),v(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&oe(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(l.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(e),y(i),y(s),y(r)),H(l,f),H(o,f),H(a,f)}}}function R8(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authURL=this.value,t(0,s)}function u(){s.tokenURL=this.value,t(0,s)}function f(){s.userInfoURL=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class wa extends Se{constructor(e){super(),we(this,e,R8,N8,ke,{key:1,config:0,required:4,title:2})}}const tf=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:o8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:c8},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:wa,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function um(n,e,t){const i=n.slice();return i[16]=e[t],i}function fm(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){v(o,e,r),i=!0,l||(s=W(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function F8(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&fm(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(s,"id",o=n[19]),p(s,"type","text"),p(s,"placeholder","Search provider")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[1]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(s,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(s,"id",o),m&2&&s.value!==d[1]&&he(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=fm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(re(),D(c,1,1,()=>{c=null}),ae())},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function cm(n){let e,t,i,l,s=n[1]!=""&&dm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),s&&s.c(),l=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){v(o,e,r),w(e,t),w(e,i),s&&s.m(e,null),w(e,l)},p(o,r){o[1]!=""?s?s.p(o,r):(s=dm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function dm(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[5]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[16].logo)&&p(e,"src",t),s&8&&i!==(i=l[16].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function mm(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,k=e[16].logo&&pm(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),k&&k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-6"),this.first=t},m($,T){v($,t,T),w(t,i),w(i,l),k&&k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(t,h),g||(_=W(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=pm(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&oe(u,a),T&8&&d!==(d=e[16].key+"")&&oe(m,d)},d($){$&&y(t),k&&k.d(),g=!1,_()}}}function q8(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[F8,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=de(n[3]);const a=f=>f[16].key;for(let f=0;f!l.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=$=>f($);function _($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}function k($){Pe.call(this,n,$)}function S($){Pe.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,l=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||l!==-1)&&t(3,r=c())},[u,o,s,r,f,d,l,a,m,h,g,_,k,S]}class V8 extends Se{constructor(e){super(),we(this,e,U8,z8,ke,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const l=i[9](i[28].name);return i[29]=l,i}function B8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[10]),r=!0)},p(u,f){f[0]&134217728&&t!==(t=u[27])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].oauth2.enabled),f[0]&134217728&&o!==(o=u[27])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function W8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Y8(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s[0]&1&&!bn(e.src,t="./images/oauth2/"+l[29].logo)&&p(e,"src",t),s[0]&1&&i!==(i=l[29].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function _m(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,{text:"Edit config",position:"left"})),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function gm(n,e){var $;let t,i,l,s,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,O){var E;return(E=T[29])!=null&&E.logo?Y8:W8}let _=g(e),k=_(e),S=e[29]&&_m(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),l=b("figure"),k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),S&&S.c(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),ee(i,"error",!V.isEmpty((E=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){v(T,t,O),w(t,i),w(i,l),k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(i,h),S&&S.m(i,null)},p(T,O){var E,L,I,A;e=T,_===(_=g(e))&&k?k.p(e,O):(k.d(1),k=_(e),k&&(k.c(),k.m(l,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&oe(u,a),O[0]&1&&d!==(d=e[28].name+"")&&oe(m,d),e[29]?S?S.p(e,O):(S=_m(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&ee(i,"error",!V.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&y(t),k.d(),S&&S.d()}}}function K8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function J8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function bm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[Z8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[G8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[X8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[Q8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,k){v(_,e,k),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),g=!0},p(_,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:_}),l.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:_}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:_}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:_}),m.$set(O)},i(_){g||(M(l.$$.fragment,_),M(r.$$.fragment,_),M(f.$$.fragment,_),M(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=He(e,mt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=He(e,mt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&y(e),H(l),H(r),H(f),H(m),_&&h&&h.end()}}}function Z8(n){let e,t,i,l,s,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:lO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 full name"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function G8(n){let e,t,i,l,s,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:sO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 avatar"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function X8(n){let e,t,i,l,s,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:oO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 id"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function Q8(n){let e,t,i,l,s,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:rO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 username"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function x8(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,k,S,$,T,O,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[B8,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=de(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=B("Optional "),h=B(m),g=B(" create fields map"),_=C(),N.c(),S=C(),R&&R.c(),$=ye(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),v(z,t,F),v(z,i,F);for(let U=0;U{R=null}),ae())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(y(t),y(i),y(u),y(f),y(S),y($)),H(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,s),v(a,o,u),v(a,r,u)},p(a,u){u[0]&128&&oe(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&oe(s,l),u[0]&128&&ee(e,"label-warning",!a[7]),u[0]&128&&ee(e,"label-info",a[7]>0)},d(a){a&&(y(e),y(o),y(r))}}}function km(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function nO(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?tO:eO}let a=r(n),u=a(n),f=n[8]&&km();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[8]?f?d[0]&256&&M(f,1):(f=km(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function iO(n){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[nO],default:[x8]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(ym))||[]};i=new V8({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new Y5({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(c,d){q(e,c,d),v(c,t,d),q(i,c,d),v(c,l,d),q(s,c,d),o=!0},p(c,d){var _,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:k.map(ym))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(y(t),y(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const lO=()=>"",sO=()=>"",oO=()=>"",rO=()=>"",ym=n=>n.name;function aO(n,e,t){let i,l,s;Qe(n,yn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function g(F=[]){var U,J;t(5,m=((U=F==null?void 0:F.filter(Y=>a.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:U.map(Y=>Y.name))||[]),t(6,h=((J=F==null?void 0:F.filter(Y=>u.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:J.map(Y=>Y.name))||[])}function _(F){for(let U of tf)if(U.key==F)return U;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,U,J)=>{c==null||c.show(F,U,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var U,J;c.show(F.detail,{},((J=(U=o.oauth2)==null?void 0:U.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const U=F.detail.uiOptions;V.removeByKey(o.oauth2.providers,"name",U.key),t(0,o)},z=F=>{const U=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),V.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:U.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,U;n.$$.dirty[0]&1&&V.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&g(o.fields),n.$$.dirty[0]&2&&t(8,i=!V.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((U=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:U.length)||0)},[o,s,f,c,d,m,h,l,i,_,k,S,$,T,O,E,L,I,A,P,N,R,z]}class uO extends Se{constructor(e){super(),we(this,e,aO,iO,ke,{collection:0},null,[-1,-1])}}function vm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function fO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&vm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].otp.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=[W(e,"change",n[4]),W(e,"change",n[5])],u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&1&&(e.checked=d[0].otp.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[2]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,Ie(f)}}}function cO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.duration),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.duration&&he(s,u[0].otp.duration)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function dO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Generated password length"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.length),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.length&&he(s,u[0].otp.length)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pO(n){let e,t,i,l,s,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[fO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),v(f,t,c),v(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(s.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(t),y(i)),H(e,f),H(s),H(a)}}}function mO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function hO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function wm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function _O(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?hO:mO}let a=r(n),u=a(n),f=n[1]&&wm();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=wm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function gO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[_O],default:[pO]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bO(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o.otp)&&t(0,o.otp={enabled:!0,duration:300,length:8},o),n.$$.dirty&1&&t(2,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,l=!V.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class kO extends Se{constructor(e){super(),we(this,e,bO,gO,ke,{collection:0})}}function Sm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function yO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&Sm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},m(d,m){v(d,e,m),e.checked=n[0].passwordAuth.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=Sm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function vO(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function wO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[yO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[vO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function SO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function TO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function $O(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?TO:SO}let a=r(n),u=a(n),f=n[2]&&Tm();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&M(f,1):(f=Tm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function CO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[$O],default:[wO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function OO(n,e,t){let i,l,s;Qe(n,yn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],g=(d==null?void 0:d.indexes)||[];for(let _ of g){const k=V.parseIndex(_);if(!k.unique||k.columns.length!=1||k.columns[0].name=="email")continue;const S=h.find($=>!$.hidden&&$.name.toLowerCase()==k.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!V.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class MO extends Se{constructor(e){super(),we(this,e,OO,CO,ke,{collection:0})}}function $m(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cm(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=Fy(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=B(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,he(i,i.__value),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,g){v(h,t,g),w(t,i),i.checked=i.__value===e[2],w(t,s),w(t,o),w(o,a),w(t,f),d||(m=W(i,"change",e[10]),d=!0)},p(h,g){e=h,g&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),g&4&&(i.checked=i.__value===e[2]),g&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&y(t),c.r(),d=!1,m()}}}function EO(n){let e=[],t=new Map,i,l=de(n[7]);const s=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[DO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=W(e,"submit",nt(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(M(t.$$.fragment,a),M(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),H(l),o=!1,r()}}}function LO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function AO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],ee(l,"btn-loading",n[4])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&ee(l,"btn-loading",c[4])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function PO(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[AO],header:[LO],default:[IO]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const Sa="last_email_test",Om="email_test_request";function NO(n,e,t){let i;const l=kt(),s="email_test_"+V.randomString(5),o=[{label:"Verification",value:"verification"},{label:"Password reset",value:"password-reset"},{label:"Confirm email change",value:"email-change"},{label:"OTP",value:"otp"},{label:"Login alert",value:"login-alert"}];let r,a="",u=localStorage.getItem(Sa),f=o[0].value,c=!1,d=null;function m(I="",A="",P=""){a=I||"_superusers",t(1,u=A||localStorage.getItem(Sa)),t(2,f=P||o[0].value),Ut({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function g(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(Sa,u),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Om),Ci("Test email send timeout.")},3e4);try{await _e.settings.testEmail(a,u,f,{$cancelKey:Om}),nn("Successfully sent test email."),l("submit"),t(4,c=!1),await dn(),h()}catch(I){t(4,c=!1),_e.error(I)}clearTimeout(d)}}const _=[[]];function k(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const $=()=>g(),T=()=>!c;function O(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function E(I){Pe.call(this,n,I)}function L(I){Pe.call(this,n,I)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,g,m,k,_,S,$,T,O,E,L]}class gy extends Se{constructor(e){super(),we(this,e,NO,PO,ke,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Mm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function RO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].authAlert.enabled),f&2097152&&o!==(o=u[21])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function Em(n){let e,t,i;function l(o){n[11](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new uO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Dm(n,e){var a;let t,i,l,s;function o(u){e[15](u,e[18])}let r={single:!0,key:e[18].key,title:e[18].label,placeholders:(a=e[18])==null?void 0:a.placeholders};return e[18].config!==void 0&&(r.config=e[18].config),i=new G6({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,$e(()=>l=!1)),i.$set(c)},i(u){s||(M(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&y(t),H(i,u)}}}function FO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P=[],N=new Map,R,z,F,U,J,Y,Z,G,pe,ce,ue;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[RO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function Te(De){n[10](De)}let Ke={};n[0]!==void 0&&(Ke.collection=n[0]),u=new MO({props:Ke}),ie.push(()=>be(u,"collection",Te));let Je=!n[1]&&Em(n);function ft(De){n[12](De)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new kO({props:et}),ie.push(()=>be(m,"collection",ft));function xe(De){n[13](De)}let We={};n[0]!==void 0&&(We.collection=n[0]),_=new w5({props:We}),ie.push(()=>be(_,"collection",xe));let at=de(n[2]);const jt=De=>De[18].key;for(let De=0;Debe(J,"collection",Ve));let st={};return G=new gy({props:st}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),c=C(),Je&&Je.c(),d=C(),j(m.$$.fragment),g=C(),j(_.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),E=b("button"),E.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let De=0;Def=!1)),u.$set(Ce),De[1]?Je&&(re(),D(Je,1,1,()=>{Je=null}),ae()):Je?(Je.p(De,Ye),Ye&2&&M(Je,1)):(Je=Em(De),Je.c(),M(Je,1),Je.m(a,d));const ct={};!h&&Ye&1&&(h=!0,ct.collection=De[0],$e(()=>h=!1)),m.$set(ct);const Ht={};!k&&Ye&1&&(k=!0,Ht.collection=De[0],$e(()=>k=!1)),_.$set(Ht),Ye&4&&(at=de(De[2]),re(),P=vt(P,Ye,jt,1,De,at,N,A,Bt,Dm,null,Mm),ae());const Le={};!Y&&Ye&1&&(Y=!0,Le.collection=De[0],$e(()=>Y=!1)),J.$set(Le);const ot={};G.$set(ot)},i(De){if(!pe){M(o.$$.fragment,De),M(u.$$.fragment,De),M(Je),M(m.$$.fragment,De),M(_.$$.fragment,De);for(let Ye=0;Yec==null?void 0:c.show(u.id);function S(O,E){n.$$.not_equal(E.config,O)&&(E.config=O,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ie[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,E;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,g,_,k,S,$,T]}class HO extends Se{constructor(e){super(),we(this,e,qO,FO,ke,{collection:0})}}const jO=n=>({dragging:n&4,dragover:n&8}),Im=n=>({dragging:n[2],dragover:n[3]});function zO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(o,n,n[9],Im);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),ee(e,"dragging",n[2]),ee(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"dragover",nt(n[11])),W(e,"dragleave",nt(n[12])),W(e,"dragend",n[13]),W(e,"dragstart",n[14]),W(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Pt(r,o,a,a[9],i?At(o,a[9],u,jO):Nt(a[9]),Im),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&ee(e,"dragging",a[2]),(!i||u&8)&&ee(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function UO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),s("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const L=E.index<<0;L{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,k,S,$]}class _o extends Se{constructor(e){super(),we(this,e,UO,zO,ke,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Lm(n,e,t){const i=n.slice();return i[27]=e[t],i}function VO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=W(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function BO(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],$e(()=>t=!1)),e.$set(c)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function WO(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function YO(n){let e,t,i,l;const s=[WO,BO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function Am(n){let e,t,i,l=de(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[YO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Am(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),r&&r.c(),s=ye()},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),r&&r.m(a,u),v(a,s,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Am(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l),y(s)),H(e,a),H(i,a),r&&r.d(a)}}}function JO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=B(t),l=B(" index")},m(s,o){v(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&y(e)}}}function Nm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,{text:"Delete",position:"top"})),W(e,"click",n[16])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function ZO(n){let e,t,i,l,s,o,r=n[5]!=""&&Nm(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),ee(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),s||(o=[W(t,"click",n[17]),W(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Nm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&ee(l,"btn-disabled",a[9].length<=0)},d(a){a&&(y(e),y(t),y(i),y(l)),r&&r.d(a),s=!1,Ie(o)}}}function GO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[ZO],header:[JO],default:[KO]},$$scope:{ctx:n}};for(let s=0;sZ.name==U);Y?V.removeByValue(J.columns,Y):V.pushUnique(J.columns,{name:U}),t(2,d=V.buildIndex(J))}Xt(async()=>{t(8,g=!0);try{t(7,h=(await Tt(async()=>{const{default:U}=await import("./CodeEditor-Bfa8qogr.js");return{default:U}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,g=!1)});const E=()=>$(),L=()=>k(),I=()=>T(),A=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=V.buildIndex(l))};function P(U){d=U,t(2,d)}const N=U=>O(U);function R(U){ie[U?"unshift":"push"](()=>{f=U,t(4,f)})}function z(U){Pe.call(this,n,U)}function F(U){Pe.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),Wt(U)),t(14,r=lt(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,J,Y;n.$$.dirty[0]&1&&t(10,i=((J=(U=u==null?void 0:u.fields)==null?void 0:U.filter(Z=>!Z.toDelete&&Z.name!="id"))==null?void 0:J.map(Z=>Z.name))||[]),n.$$.dirty[0]&4&&t(3,l=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((Y=l.columns)==null?void 0:Y.map(Z=>Z.name))||[])},[u,k,d,l,f,c,m,h,g,s,i,$,T,O,r,_,E,L,I,A,P,N,R,z,F]}class QO extends Se{constructor(e){super(),we(this,e,XO,GO,ke,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Rm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=V.parseIndex(i[10]);return i[11]=l,i}function Fm(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){var u;v(r,e,a),l=!0,s||(o=Oe(t=qe.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),s=!0)},p(r,a){var u;t&&It(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,$t,{duration:150},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,$t,{duration:150},!1)),i.run(0)),l=!1},d(r){r&&y(e),r&&i&&i.end(),s=!1,o()}}}function qm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Hm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(jm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&qm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Oe(r=qe.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),W(e,"click",c)],a=!0)},p(m,h){var g,_,k,S,$;n=m,n[11].unique?f||(f=qm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((g=n[11].columns)==null?void 0:g.map(jm).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&It(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&y(e),f&&f.d(),a=!1,Ie(u)}}}function xO(n){var O,E,L,I,A;let e,t,i=(((E=(O=n[0])==null?void 0:O.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&Fm(n),k=de(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;Pbe(c,"collection",$)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=B("Unique constraints and indexes ("),l=B(i),s=B(`) + `),_&&_.c(),o=C(),r=b("div");for(let P=0;P+ New index',f=C(),j(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){v(P,e,N),w(e,t),w(e,l),w(e,s),_&&_.m(e,null),v(P,o,N),v(P,r,N);for(let R=0;R{_=null}),ae()),N&7){k=de(((Y=P[0])==null?void 0:Y.indexes)||[]);let Z;for(Z=0;Zd=!1)),c.$set(R)},i(P){m||(M(_),M(c.$$.fragment,P),m=!0)},o(P){D(_),D(c.$$.fragment,P),m=!1},d(P){P&&(y(e),y(o),y(r),y(f)),_&&_.d(),dt(S,P),n[6](null),H(c,P),h=!1,g()}}}const jm=n=>n.name;function eM(n,e,t){let i;Qe(n,yn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let g=0;gs==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{var h;(h=i.indexes)!=null&&h.message&&Yn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class tM extends Se{constructor(e){super(),we(this,e,eM,xO,ke,{collection:0})}}function zm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Um(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent=`${n[5].label}`,s=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),o||(r=W(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&y(e),o=!1,r()}}}function nM(n){let e,t=de(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class sM extends Se{constructor(e){super(),we(this,e,lM,iM,ke,{class:0})}}const oM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Vm=n=>({interactive:n[7],hasErrors:n[6]}),rM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Bm=n=>({interactive:n[7],hasErrors:n[6]}),aM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Wm=n=>({interactive:n[7],hasErrors:n[6]});function Ym(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Km(n){let e,t;return{c(){e=b("span"),t=B(n[5]),p(e,"class","label label-success")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&32&&oe(t,i[5])},d(i){i&&y(e)}}}function Jm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function uM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Km(n),g=n[0].hidden&&Jm();return{c(){e=b("div"),h&&h.c(),t=C(),g&&g.c(),i=C(),l=b("div"),s=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=V.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),ee(l,"txt-disabled",!n[7]||n[0].system),p(u,"type","text"),u.required=!0,u.disabled=f=!n[7]||n[0].system,p(u,"spellcheck","false"),p(u,"placeholder","Field name"),u.value=c=n[0].name,p(u,"title","System field")},m(_,k){v(_,e,k),h&&h.m(e,null),w(e,t),g&&g.m(e,null),v(_,i,k),v(_,l,k),w(l,s),v(_,a,k),v(_,u,k),n[22](u),d||(m=[Oe(r=qe.call(null,l,n[0].type+(n[0].system?" (system)":""))),W(l,"click",n[21]),W(u,"input",n[23])],d=!0)},p(_,k){_[0].required?h?h.p(_,k):(h=Km(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Jm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k[0]&1&&o!==(o=V.getFieldTypeIcon(_[0].type))&&p(s,"class",o),r&&It(r.update)&&k[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),k[0]&129&&ee(l,"txt-disabled",!_[7]||_[0].system),k[0]&129&&f!==(f=!_[7]||_[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=_[0].name)&&u.value!==c&&(u.value=c)},d(_){_&&(y(e),y(i),y(l),y(a),y(u)),h&&h.d(),g&&g.d(),n[22](null),d=!1,Ie(m)}}}function fM(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function cM(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label",i="Toggle "+n[0].name+" field options"),p(e,"class",l="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),ee(e,"btn-hint",!n[4]&&!n[6]),ee(e,"btn-danger",n[6])},m(r,a){v(r,e,a),w(e,t),s||(o=W(e,"click",n[17]),s=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&l!==(l="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",l),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&ee(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&ee(e,"btn-danger",r[6])},d(r){r&&y(e),s=!1,o()}}}function dM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,"Restore")),W(e,"click",n[14])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function Zm(n){let e,t,i,l,s=!n[0].primaryKey&&n[0].type!="autodate"&&(!n[8]||!n[10].includes(n[0].name)),o,r=!n[0].primaryKey&&(!n[8]||!n[11].includes(n[0].name)),a,u=!n[8]||!n[12].includes(n[0].name),f,c,d,m;const h=n[20].options,g=Lt(h,n,n[28],Bm);let _=s&&Gm(n),k=r&&Xm(n),S=u&&Qm(n);const $=n[20].optionsFooter,T=Lt($,n,n[28],Vm);let O=!n[0]._toDelete&&!n[0].primaryKey&&xm(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),l=b("div"),_&&_.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){v(E,e,L),w(e,t),g&&g.m(t,null),w(e,i),w(e,l),_&&_.m(l,null),w(l,o),k&&k.m(l,null),w(l,a),S&&S.m(l,null),w(l,f),T&&T.m(l,null),w(l,c),O&&O.m(l,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Pt(g,h,E,E[28],m?At(h,E[28],L,rM):Nt(E[28]),Bm),L[0]&257&&(s=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),s?_?(_.p(E,L),L[0]&257&&M(_,1)):(_=Gm(E),_.c(),M(_,1),_.m(l,o)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?k?(k.p(E,L),L[0]&257&&M(k,1)):(k=Xm(E),k.c(),M(k,1),k.m(l,a)):k&&(re(),D(k,1,1,()=>{k=null}),ae()),L[0]&257&&(u=!E[8]||!E[12].includes(E[0].name)),u?S?(S.p(E,L),L[0]&257&&M(S,1)):(S=Qm(E),S.c(),M(S,1),S.m(l,f)):S&&(re(),D(S,1,1,()=>{S=null}),ae()),T&&T.p&&(!m||L[0]&268435648)&&Pt(T,$,E,E[28],m?At($,E[28],L,oM):Nt(E[28]),Vm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,L),L[0]&1&&M(O,1)):(O=xm(E),O.c(),M(O,1),O.m(l,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae())},i(E){m||(M(g,E),M(_),M(k),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=He(e,mt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(_),D(k),D(S),D(T,E),D(O),E&&(d||(d=He(e,mt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&y(e),g&&g.d(E),_&&_.d(),k&&k.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function Gm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[pM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435489|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),o=B(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[34])},m(m,h){v(m,e,h),e.checked=n[0].required,v(m,i,h),v(m,l,h),w(l,s),w(s,o),w(l,r),w(l,a),c||(d=[W(e,"change",n[24]),Oe(u=qe.call(null,a,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&(e.checked=m[0].required),h[0]&32&&oe(o,m[5]),u&&It(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(y(e),y(i),y(l)),c=!1,Ie(d)}}}function Xm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[mM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){v(c,e,d),e.checked=n[0].hidden,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[25]),W(e,"change",n[26]),Oe(qe.call(null,r,{text:"Hide from the JSON API response and filters."}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].hidden),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function Qm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[hM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),l=C(),s=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(s,"for",f=n[34])},m(m,h){v(m,e,h),e.checked=n[0].presentable,v(m,l,h),v(m,s,h),w(s,o),w(s,r),w(s,a),c||(d=[W(e,"change",n[27]),Oe(qe.call(null,a,{text:"Whether the field should be preferred in the Superuser UI relation listings (default to auto)."}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&i!==(i=m[0].hidden)&&(e.disabled=i),h[0]&1&&(e.checked=m[0].presentable),h[0]&1&&u!==(u="ri-information-line "+(m[0].hidden?"txt-disabled":"link-hint"))&&p(a,"class",u),h[1]&8&&f!==(f=m[34])&&p(s,"for",f)},d(m){m&&(y(e),y(l),y(s)),c=!1,Ie(d)}}}function xm(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[_M]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(o)}}}function eh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[13])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function _M(n){let e,t,i,l,s,o=!n[0].system&&eh(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ye(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){v(r,e,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l||(s=W(e,"click",nt(n[15])),l=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=eh(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),o&&o.d(r),l=!1,s()}}}function gM(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&n[2]&&Ym();l=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[uM]},$$scope:{ctx:n}}});const c=n[20].default,d=Lt(c,n,n[28],Wm),m=d||fM();function h(S,$){if(S[0]._toDelete)return dM;if(S[7])return cM}let g=h(n),_=g&&g(n),k=n[7]&&n[4]&&Zm(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),j(l.$$.fragment),s=C(),m&&m.c(),o=C(),_&&_.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),ee(e,"required",n[0].required),ee(e,"expanded",n[7]&&n[4]),ee(e,"deleted",n[0]._toDelete)},m(S,$){v(S,e,$),w(e,t),f&&f.m(t,null),w(t,i),q(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),_&&_.m(t,null),w(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=Ym(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$[0]&268435648)&&Pt(d,c,S,S[28],u?At(c,S[28],$,aM):Nt(S[28]),Wm),g===(g=h(S))&&_?_.p(S,$):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&M(k,1)):(k=Zm(S),k.c(),M(k,1),k.m(e,null)):k&&(re(),D(k,1,1,()=>{k=null}),ae()),(!u||$[0]&1)&&ee(e,"required",S[0].required),(!u||$[0]&144)&&ee(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&ee(e,"deleted",S[0]._toDelete)},i(S){u||(M(l.$$.fragment,S),M(m,S),M(k),S&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(k),S&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&y(e),f&&f.d(),H(l),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let Ta=[];function bM(n,e,t){let i,l,s,o,r;Qe(n,yn,ce=>t(19,r=ce));let{$$slots:a={},$$scope:u}=e;const f="f_"+V.randomString(8),c=kt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:k=V.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,O=!1;function E(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function L(){t(0,k._toDelete=!1,k),Ut({})}function I(){k._toDelete||(N(),c("duplicate"))}function A(ce){return V.slugify(ce)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let ce of Ta)ce.id!=f&&ce.collapse()}Xt(()=>(Ta.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{V.removeByKey(Ta,"id",f)}));const F=()=>T==null?void 0:T.focus();function U(ce){ie[ce?"unshift":"push"](()=>{T=ce,t(3,T)})}const J=ce=>{const ue=k.name;t(0,k.name=A(ce.target.value),k),ce.target.value=k.name,c("rename",{oldName:ue,newName:k.name})};function Y(){k.required=this.checked,t(0,k)}function Z(){k.hidden=this.checked,t(0,k)}const G=ce=>{ce.target.checked&&t(0,k.presentable=!1,k)};function pe(){k.presentable=this.checked,t(0,k)}return n.$$set=ce=>{"key"in ce&&t(1,_=ce.key),"field"in ce&&t(0,k=ce.field),"draggable"in ce&&t(2,S=ce.draggable),"collection"in ce&&t(18,$=ce.collection),"$$scope"in ce&&t(28,u=ce.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,l=!k._toDelete),n.$$.dirty[0]&524290&&t(6,s=!V.isEmpty(V.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,_,S,T,O,o,s,l,i,c,m,h,g,E,L,I,A,R,$,r,a,F,U,J,Y,Z,G,pe,u]}class ni extends Se{constructor(e){super(),we(this,e,bM,gM,ke,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function kM(n){let e,t,i,l,s,o;function r(u){n[5](u)}let a={id:n[13],items:n[3],disabled:n[0].system,readonly:!n[12]};return n[2]!==void 0&&(a.keyOfSelected=n[2]),t=new zn({props:a}),ie.push(()=>be(t,"keyOfSelected",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Oe(qe.call(null,e,{text:"Auto set on:",position:"top"})),s=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],$e(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&y(e),H(t),s=!1,o()}}}function yM(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[kM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),v(r,s,a),o=!0},p(r,a){const u={};a&4096&&(u.class="form-field form-field-single-multiple-select form-field-autodate-select "+(r[12]?"":"readonly")),a&28677&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l),y(s)),H(i,r)}}}function vM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[yM,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}const $a=1,Ca=2,Oa=3;function wM(n,e,t){const i=["field","key"];let l=lt(e,i);const s=[{label:"Create",value:$a},{label:"Update",value:Ca},{label:"Create/Update",value:Oa}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Oa:o.onUpdate?Ca:$a}function f(_){switch(_){case $a:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case Ca:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Oa:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!0,o);break}}function c(_){a=_,t(2,a)}function d(_){o=_,t(0,o)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Wt(_)),t(4,l=lt(e,i)),"field"in _&&t(0,o=_.field),"key"in _&&t(1,r=_.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,s,l,c,d,m,h,g]}class SM extends Se{constructor(e){super(),we(this,e,wM,vM,ke,{field:0,key:1})}}function TM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function $M(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class CM extends Se{constructor(e){super(),we(this,e,$M,TM,ke,{field:0,key:1})}}var Ma=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],es={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},to={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Gn=function(n){return n===!0?1:0};function th(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Ea=function(n){return n instanceof Array?n:[n]};function $n(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Ot(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function Jo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function by(n,e){if(e(n))return n;if(n.parentNode)return by(n.parentNode,e)}function Zo(n,e){var t=Ot("div","numInputWrapper"),i=Ot("input","numInput "+n),l=Ot("span","arrowUp"),s=Ot("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function Un(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Da=function(){},$r=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},OM={D:Da,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Gn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Da,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Da,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},wl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},js={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[js.w(n,e,t)]},F:function(n,e,t){return $r(js.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Ln(js.h(n,e,t))},H:function(n){return Ln(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Gn(n.getHours()>11)]},M:function(n,e){return $r(n.getMonth(),!0,e)},S:function(n){return Ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Ln(n.getFullYear(),4)},d:function(n){return Ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Ln(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},ky=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return js[c]&&m[d-1]!=="\\"?js[c](r,f,t):c!=="\\"?c:""}).join("")}},fu=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||es).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var h=void 0,g=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),le=La(t.config);x.setHours(le.hours,le.minutes,le.seconds,x.getMilliseconds()),t.selectedDates=[x],t.latestSelectedDateObj=x}X!==void 0&&X.type!=="blur"&&cl(X);var ge=t._input.value;c(),Dn(),t._input.value!==ge&&t._debouncedChange()}function u(X,x){return X%12+12*Gn(x===t.l10n.amPM[1])}function f(X){switch(X%24){case 0:case 12:return 12;default:return X%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var X=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,x=(parseInt(t.minuteElement.value,10)||0)%60,le=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(X=u(X,t.amPM.textContent));var ge=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Fe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Be=Ia(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Ia(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),se=Ia(X,x,le);if(se>rt&&se=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ln(le)))}function h(X){var x=Un(X),le=parseInt(x.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,x,le,ge){if(x instanceof Array)return x.forEach(function(Fe){return g(X,Fe,le,ge)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,x,le,ge)});X.addEventListener(x,le,ge),t._handlers.push({remove:function(){return X.removeEventListener(x,le,ge)}})}function _(){Dt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(ge){return g(ge,"click",t[le])})}),t.isMobile){wn();return}var X=th(Ee,50);if(t._debouncedChange=th(_,IM),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ve(Un(le))}),g(t._input,"keydown",jt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",jt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ft):g(window.document,"mousedown",ft),g(window.document,"focus",ft,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Rl),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",En)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var x=function(le){return Un(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",$),g([t.hourElement,t.minuteElement],["focus","click"],x),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(le){a(le)})}t.config.allowInput&&g(t._input,"blur",at)}function S(X,x){var le=X!==void 0?t.parseDate(X):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(X);var Fe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Fe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Be=Ot("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Be,t.element),Be.appendChild(t.element),t.altInput&&Be.appendChild(t.altInput),Be.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function E(X,x,le,ge){var Fe=xe(x,!0),Be=Ot("span",X,x.getDate().toString());return Be.dateObj=x,Be.$i=ge,Be.setAttribute("aria-label",t.formatDate(x,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Vn(x,t.now)===0&&(t.todayDateElem=Be,Be.classList.add("today"),Be.setAttribute("aria-current","date")),Fe?(Be.tabIndex=-1,ul(x)&&(Be.classList.add("selected"),t.selectedDateElem=Be,t.config.mode==="range"&&($n(Be,"startRange",t.selectedDates[0]&&Vn(x,t.selectedDates[0],!0)===0),$n(Be,"endRange",t.selectedDates[1]&&Vn(x,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Be.classList.add("inRange")))):Be.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zi(x)&&!ul(x)&&Be.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&ge%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(x)+""),Dt("onDayCreate",Be),Be}function L(X){X.focus(),t.config.mode==="range"&&Ve(X)}function I(X){for(var x=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,ge=x;ge!=le;ge+=X)for(var Fe=t.daysContainer.children[ge],Be=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,se=Be;se!=rt;se+=X){var Me=Fe.children[se];if(Me.className.indexOf("hidden")===-1&&xe(Me.dateObj))return Me}}function A(X,x){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,ge=x>0?t.config.showMonths:-1,Fe=x>0?1:-1,Be=le-t.currentMonth;Be!=ge;Be+=Fe)for(var rt=t.daysContainer.children[Be],se=le-t.currentMonth===Be?X.$i+x:x<0?rt.children.length-1:0,Me=rt.children.length,Ne=se;Ne>=0&&Ne0?Me:-1);Ne+=Fe){var ze=rt.children[Ne];if(ze.className.indexOf("hidden")===-1&&xe(ze.dateObj)&&Math.abs(X.$i-Ne)>=Math.abs(x))return L(ze)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,x){var le=s(),ge=We(le||document.body),Fe=X!==void 0?X:ge?le:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:I(x>0?1:-1);Fe===void 0?t._input.focus():ge?A(Fe,x):L(Fe)}function N(X,x){for(var le=(new Date(X,x,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ge=t.utils.getDaysInMonth((x-1+12)%12,X),Fe=t.utils.getDaysInMonth(x,X),Be=window.document.createDocumentFragment(),rt=t.config.showMonths>1,se=rt?"prevMonthDay hidden":"prevMonthDay",Me=rt?"nextMonthDay hidden":"nextMonthDay",Ne=ge+1-le,ze=0;Ne<=ge;Ne++,ze++)Be.appendChild(E("flatpickr-day "+se,new Date(X,x-1,Ne),Ne,ze));for(Ne=1;Ne<=Fe;Ne++,ze++)Be.appendChild(E("flatpickr-day",new Date(X,x,Ne),Ne,ze));for(var Ge=Fe+1;Ge<=42-le&&(t.config.showMonths===1||ze%7!==0);Ge++,ze++)Be.appendChild(E("flatpickr-day "+Me,new Date(X,x+1,Ge%Fe),Ge,ze));var xt=Ot("div","dayContainer");return xt.appendChild(Be),xt}function R(){if(t.daysContainer!==void 0){Jo(t.daysContainer),t.weekNumbers&&Jo(t.weekNumbers);for(var X=document.createDocumentFragment(),x=0;x1||t.config.monthSelectorType!=="dropdown")){var X=function(ge){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&get.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var x=0;x<12;x++)if(X(x)){var le=Ot("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,x).getMonth().toString(),le.textContent=$r(x,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===x&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Ot("div","flatpickr-month"),x=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Ot("span","cur-month"):(t.monthsDropdownContainer=Ot("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var se=Un(rt),Me=parseInt(se.value,10);t.changeMonth(Me-t.currentMonth),Dt("onMonthChange")}),z(),le=t.monthsDropdownContainer);var ge=Zo("cur-year",{tabindex:"-1"}),Fe=ge.getElementsByTagName("input")[0];Fe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Fe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Fe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Fe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Be=Ot("div","flatpickr-current-month");return Be.appendChild(le),Be.appendChild(ge),x.appendChild(Be),X.appendChild(x),{container:X,yearElement:Fe,monthElement:le}}function U(){Jo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var x=F();t.yearElements.push(x.yearElement),t.monthElements.push(x.monthElement),t.monthNav.appendChild(x.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Ot("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Ot("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Ot("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(X){t.__hidePrevMonthArrow!==X&&($n(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&($n(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Ui(),t.monthNav}function Y(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=La(t.config);t.timeContainer=Ot("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var x=Ot("span","flatpickr-time-separator",":"),le=Zo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var ge=Zo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ge.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():X.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(le),t.timeContainer.appendChild(x),t.timeContainer.appendChild(ge),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Zo("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():X.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(Ot("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Ot("span","flatpickr-am-pm",t.l10n.amPM[Gn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function Z(){t.weekdayContainer?Jo(t.weekdayContainer):t.weekdayContainer=Ot("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var x=Ot("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(x)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,x=nh(t.l10n.weekdays.shorthand);X>0&&X `+x.join("")+` - `}}function pe(){t.calendarContainer.classList.add("hasWeeks");var X=Ot("div","flatpickr-weekwrapper");X.appendChild(Ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var x=Ot("div","flatpickr-weeks");return X.appendChild(x),{weekWrapper:X,weekNumbers:x}}function ce(X,x){x===void 0&&(x=!0);var le=x?X:X-t.currentMonth;le<0&&t._hidePrevMonthArrow===!0||le>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=le,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),z()),R(),Dt("onMonthChange"),Ui())}function ue(X,x){if(X===void 0&&(X=!0),x===void 0&&(x=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,x===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=La(t.config),ge=le.hours,Fe=le.minutes,Be=le.seconds;m(ge,Fe,Be)}t.redraw(),X&&Dt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Dt("onClose")}function Ke(){t.config!==void 0&&Dt("onDestroy");for(var X=t._handlers.length;X--;)t._handlers[X].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var x=t.calendarContainer.parentNode;if(x.lastChild&&x.removeChild(x.lastChild),x.parentNode){for(;x.firstChild;)x.parentNode.insertBefore(x.firstChild,x);x.parentNode.removeChild(x)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(le){try{delete t[le]}catch{}})}function Je(X){return t.calendarContainer.contains(X)}function ft(X){if(t.isOpen&&!t.config.inline){var x=Un(X),le=Je(x),ge=x===t.input||x===t.altInput||t.element.contains(x)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!ge&&!le&&!Je(X.relatedTarget),Be=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(x)});Fe&&Be&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function et(X){if(!(!X||t.config.minDate&&Xt.config.maxDate.getFullYear())){var x=X,le=t.currentYear!==x;t.currentYear=x||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),le&&(t.redraw(),Dt("onYearChange"),z())}}function xe(X,x){var le;x===void 0&&(x=!0);var ge=t.parseDate(X,void 0,x);if(t.config.minDate&&ge&&Vn(ge,t.config.minDate,x!==void 0?x:!t.minDateHasTime)<0||t.config.maxDate&&ge&&Vn(ge,t.config.maxDate,x!==void 0?x:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ge===void 0)return!1;for(var Fe=!!t.config.enable,Be=(le=t.config.enable)!==null&&le!==void 0?le:t.config.disable,rt=0,se=void 0;rt=se.from.getTime()&&ge.getTime()<=se.to.getTime())return Fe}return!Fe}function We(X){return t.daysContainer!==void 0?X.className.indexOf("hidden")===-1&&X.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(X):!1}function at(X){var x=X.target===t._input,le=t._input.value.trimEnd()!==fl();x&&le&&!(X.relatedTarget&&Je(X.relatedTarget))&&t.setDate(t._input.value,!0,X.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function jt(X){var x=Un(X),le=t.config.wrap?n.contains(x):x===t._input,ge=t.config.allowInput,Fe=t.isOpen&&(!ge||!le),Be=t.config.inline&&le&&!ge;if(X.keyCode===13&&le){if(ge)return t.setDate(t._input.value,!0,x===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),x.blur();t.open()}else if(Je(x)||Fe||Be){var rt=!!t.timeContainer&&t.timeContainer.contains(x);switch(X.keyCode){case 13:rt?(X.preventDefault(),a(),on()):En(X);break;case 27:X.preventDefault(),on();break;case 8:case 46:le&&!t.config.allowInput&&(X.preventDefault(),t.clear());break;case 37:case 39:if(!rt&&!le){X.preventDefault();var se=s();if(t.daysContainer!==void 0&&(ge===!1||se&&We(se))){var Me=X.keyCode===39?1:-1;X.ctrlKey?(X.stopPropagation(),ce(Me),P(I(1),0)):P(void 0,Me)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:X.preventDefault();var Ne=X.keyCode===40?1:-1;t.daysContainer&&x.$i!==void 0||x===t.input||x===t.altInput?X.ctrlKey?(X.stopPropagation(),et(t.currentYear-Ne),P(I(1),0)):rt||P(void 0,Ne*7):x===t.currentYearElement?et(t.currentYear-Ne):t.config.enableTime&&(!rt&&t.hourElement&&t.hourElement.focus(),a(X),t._debouncedChange());break;case 9:if(rt){var ze=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(qt){return qt}),Ge=ze.indexOf(x);if(Ge!==-1){var xt=ze[Ge+(X.shiftKey?-1:1)];X.preventDefault(),(xt||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(x)&&X.shiftKey&&(X.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&x===t.amPM)switch(X.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Dn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Dn();break}(le||Je(x))&&Dt("onKeyDown",X)}function Ve(X,x){if(x===void 0&&(x="flatpickr-day"),!(t.selectedDates.length!==1||X&&(!X.classList.contains(x)||X.classList.contains("flatpickr-disabled")))){for(var le=X?X.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ge=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Fe=Math.min(le,t.selectedDates[0].getTime()),Be=Math.max(le,t.selectedDates[0].getTime()),rt=!1,se=0,Me=0,Ne=Fe;NeFe&&Nese)?se=Ne:Ne>ge&&(!Me||Ne ."+x));ze.forEach(function(Ge){var xt=Ge.dateObj,qt=xt.getTime(),Sn=se>0&&qt0&&qt>Me;if(Sn){Ge.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Ei){Ge.classList.remove(Ei)});return}else if(rt&&!Sn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Ei){Ge.classList.remove(Ei)}),X!==void 0&&(X.classList.add(le<=t.selectedDates[0].getTime()?"startRange":"endRange"),gele&&qt===ge&&Ge.classList.add("endRange"),qt>=se&&(Me===0||qt<=Me)&&MM(qt,ge,le)&&Ge.classList.add("inRange"))})}}function Ee(){t.isOpen&&!t.config.static&&!t.config.inline&&ct()}function st(X,x){if(x===void 0&&(x=t._positionElement),t.isMobile===!0){if(X){X.preventDefault();var le=Un(X);le&&le.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Dt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ge=t.isOpen;t.isOpen=!0,ge||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Dt("onOpen"),ct(x)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(X===void 0||!t.timeContainer.contains(X.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function De(X){return function(x){var le=t.config["_"+X+"Date"]=t.parseDate(x,t.config.dateFormat),ge=t.config["_"+(X==="min"?"max":"min")+"Date"];le!==void 0&&(t[X==="min"?"minDateHasTime":"maxDateHasTime"]=le.getHours()>0||le.getMinutes()>0||le.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Fe){return xe(Fe)}),!t.selectedDates.length&&X==="min"&&d(le),Dn()),t.daysContainer&&(ot(),le!==void 0?t.currentYearElement[X]=le.getFullYear().toString():t.currentYearElement.removeAttribute(X),t.currentYearElement.disabled=!!ge&&le!==void 0&&ge.getFullYear()===le.getFullYear())}}function Ye(){var X=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],x=mn(mn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),le={};t.config.parseDate=x.parseDate,t.config.formatDate=x.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(ze){t.config._enable=fn(ze)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(ze){t.config._disable=fn(ze)}});var ge=x.mode==="time";if(!x.dateFormat&&(x.enableTime||ge)){var Fe=tn.defaultConfig.dateFormat||es.dateFormat;le.dateFormat=x.noCalendar||ge?"H:i"+(x.enableSeconds?":S":""):Fe+" H:i"+(x.enableSeconds?":S":"")}if(x.altInput&&(x.enableTime||ge)&&!x.altFormat){var Be=tn.defaultConfig.altFormat||es.altFormat;le.altFormat=x.noCalendar||ge?"h:i"+(x.enableSeconds?":S K":" K"):Be+(" h:i"+(x.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:De("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:De("max")});var rt=function(ze){return function(Ge){t.config[ze==="min"?"_minTime":"_maxTime"]=t.parseDate(Ge,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:rt("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:rt("max")}),x.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,le,x);for(var se=0;se-1?t.config[Ne]=Ea(Me[Ne]).map(o).concat(t.config[Ne]):typeof x[Ne]>"u"&&(t.config[Ne]=Me[Ne])}x.altInputClass||(t.config.altInputClass=ve().className+" "+t.config.altInputClass),Dt("onParseConfig")}function ve(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ce(){typeof t.config.locale!="object"&&typeof tn.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=mn(mn({},tn.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?tn.l10ns[t.config.locale]:void 0),wl.D="("+t.l10n.weekdays.shorthand.join("|")+")",wl.l="("+t.l10n.weekdays.longhand.join("|")+")",wl.M="("+t.l10n.months.shorthand.join("|")+")",wl.F="("+t.l10n.months.longhand.join("|")+")",wl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var X=mn(mn({},e),JSON.parse(JSON.stringify(n.dataset||{})));X.time_24hr===void 0&&tn.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=ky(t),t.parseDate=fu({config:t.config,l10n:t.l10n})}function ct(X){if(typeof t.config.position=="function")return void t.config.position(t,X);if(t.calendarContainer!==void 0){Dt("onPreCalendarPosition");var x=X||t._positionElement,le=Array.prototype.reduce.call(t.calendarContainer.children,function(gs,Vr){return gs+Vr.offsetHeight},0),ge=t.calendarContainer.offsetWidth,Fe=t.config.position.split(" "),Be=Fe[0],rt=Fe.length>1?Fe[1]:null,se=x.getBoundingClientRect(),Me=window.innerHeight-se.bottom,Ne=Be==="above"||Be!=="below"&&Mele,ze=window.pageYOffset+se.top+(Ne?-le-2:x.offsetHeight+2);if($n(t.calendarContainer,"arrowTop",!Ne),$n(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var Ge=window.pageXOffset+se.left,xt=!1,qt=!1;rt==="center"?(Ge-=(ge-se.width)/2,xt=!0):rt==="right"&&(Ge-=ge-se.width,qt=!0),$n(t.calendarContainer,"arrowLeft",!xt&&!qt),$n(t.calendarContainer,"arrowCenter",xt),$n(t.calendarContainer,"arrowRight",qt);var Sn=window.document.body.offsetWidth-(window.pageXOffset+se.right),Ei=Ge+ge>window.document.body.offsetWidth,go=Sn+ge>window.document.body.offsetWidth;if($n(t.calendarContainer,"rightMost",Ei),!t.config.static)if(t.calendarContainer.style.top=ze+"px",!Ei)t.calendarContainer.style.left=Ge+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Sn+"px";else{var Fl=Ht();if(Fl===void 0)return;var bo=window.document.body.offsetWidth,_s=Math.max(0,bo/2-ge/2),Di=".flatpickr-calendar.centerMost:before",dl=".flatpickr-calendar.centerMost:after",pl=Fl.cssRules.length,ql="{left:"+se.left+"px;right:auto;}";$n(t.calendarContainer,"rightMost",!1),$n(t.calendarContainer,"centerMost",!0),Fl.insertRule(Di+","+dl+ql,pl),t.calendarContainer.style.left=_s+"px",t.calendarContainer.style.right="auto"}}}}function Ht(){for(var X=null,x=0;xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ge,t.config.mode==="single")t.selectedDates=[Fe];else if(t.config.mode==="multiple"){var rt=ul(Fe);rt?t.selectedDates.splice(parseInt(rt),1):t.selectedDates.push(Fe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Fe,t.selectedDates.push(Fe),Vn(Fe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(ze,Ge){return ze.getTime()-Ge.getTime()}));if(c(),Be){var se=t.currentYear!==Fe.getFullYear();t.currentYear=Fe.getFullYear(),t.currentMonth=Fe.getMonth(),se&&(Dt("onYearChange"),z()),Dt("onMonthChange")}if(Ui(),R(),Dn(),!Be&&t.config.mode!=="range"&&t.config.showMonths===1?L(ge):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Me=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Me||Ne)&&on()}_()}}var Re={locale:[Ce,G],showMonths:[U,r,Z],minDate:[S],maxDate:[S],positionElement:[bt],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ft(X,x){if(X!==null&&typeof X=="object"){Object.assign(t.config,X);for(var le in X)Re[le]!==void 0&&Re[le].forEach(function(ge){return ge()})}else t.config[X]=x,Re[X]!==void 0?Re[X].forEach(function(ge){return ge()}):Ma.indexOf(X)>-1&&(t.config[X]=Ea(x));t.redraw(),Dn(!0)}function Yt(X,x){var le=[];if(X instanceof Array)le=X.map(function(ge){return t.parseDate(ge,x)});else if(X instanceof Date||typeof X=="number")le=[t.parseDate(X,x)];else if(typeof X=="string")switch(t.config.mode){case"single":case"time":le=[t.parseDate(X,x)];break;case"multiple":le=X.split(t.config.conjunction).map(function(ge){return t.parseDate(ge,x)});break;case"range":le=X.split(t.l10n.rangeSeparator).map(function(ge){return t.parseDate(ge,x)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(X)));t.selectedDates=t.config.allowInvalidPreload?le:le.filter(function(ge){return ge instanceof Date&&xe(ge,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ge,Fe){return ge.getTime()-Fe.getTime()})}function vn(X,x,le){if(x===void 0&&(x=!1),le===void 0&&(le=t.config.dateFormat),X!==0&&!X||X instanceof Array&&X.length===0)return t.clear(x);Yt(X,le),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,x),d(),t.selectedDates.length===0&&t.clear(!1),Dn(x),x&&Dt("onChange")}function fn(X){return X.slice().map(function(x){return typeof x=="string"||typeof x=="number"||x instanceof Date?t.parseDate(x,void 0,!0):x&&typeof x=="object"&&x.from&&x.to?{from:t.parseDate(x.from,void 0),to:t.parseDate(x.to,void 0)}:x}).filter(function(x){return x})}function Oi(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var X=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);X&&Yt(X,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function li(){if(t.input=ve(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=Ot(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bt()}function bt(){t._positionElement=t.config.positionElement||t._input}function wn(){var X=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Ot("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=X,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=X==="datetime-local"?"Y-m-d\\TH:i:S":X==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(x){t.setDate(Un(x).value,!1,t.mobileFormatStr),Dt("onChange"),Dt("onClose")})}function sn(X){if(t.isOpen===!0)return t.close();t.open(X)}function Dt(X,x){if(t.config!==void 0){var le=t.config[X];if(le!==void 0&&le.length>0)for(var ge=0;le[ge]&&ge=0&&Vn(X,t.selectedDates[1])<=0}function Ui(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(X,x){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+x),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[x].textContent=$r(le.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=le.getMonth().toString(),X.value=le.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function fl(X){var x=X||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(le){return t.formatDate(le,x)}).filter(function(le,ge,Fe){return t.config.mode!=="range"||t.config.enableTime||Fe.indexOf(le)===ge}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Dn(X){X===void 0&&(X=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=fl(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=fl(t.config.altFormat)),X!==!1&&Dt("onValueUpdate")}function Rl(X){var x=Un(X),le=t.prevMonthNav.contains(x),ge=t.nextMonthNav.contains(x);le||ge?ce(le?-1:1):t.yearElements.indexOf(x)>=0?x.select():x.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):x.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(X){X.preventDefault();var x=X.type==="keydown",le=Un(X),ge=le;t.amPM!==void 0&&le===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]);var Fe=parseFloat(ge.getAttribute("min")),Be=parseFloat(ge.getAttribute("max")),rt=parseFloat(ge.getAttribute("step")),se=parseInt(ge.value,10),Me=X.delta||(x?X.which===38?1:-1:0),Ne=se+rt*Me;if(typeof ge.value<"u"&&ge.value.length===2){var ze=ge===t.hourElement,Ge=ge===t.minuteElement;NeBe&&(Ne=ge===t.hourElement?Ne-Be-Gn(!t.amPM):Fe,Ge&&T(void 0,1,t.hourElement)),t.amPM&&ze&&(rt===1?Ne+se===23:Math.abs(Ne-se)>rt)&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]),ge.value=Ln(Ne)}}return l(),t}function ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function RM(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:g=void 0}=e;Xt(()=>{const T=f??h,M=k(d);return M.onReady.push((E,L,I)=>{a===void 0&&S(E,L,I),dn().then(()=>{t(8,m=!0)})}),t(3,g=tn(T,Object.assign(M,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=kt();function k(T={}){T=Object.assign({},T);for(const M of r){const E=(L,I,A)=>{_(NM(M),[L,I,A])};M in T?(Array.isArray(T[M])||(T[M]=[T[M]]),T[M].push(E)):T[M]=[E]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,M,E){const L=ih(E,T);!lh(a,L)&&(a||L)&&t(2,a=L),t(4,u=M)}function $(T){ie[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(1,l=lt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,g=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(lh(a,ih(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[T,M]of Object.entries(k(d)))g.set(T,M)},[h,l,a,g,u,f,c,d,m,o,s,$]}class nf extends Se{constructor(e){super(),we(this,e,RM,PM,ke,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function FM(n){let e,t,i,l,s,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),s=new nf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=B("Min date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function qM(n){let e,t,i,l,s,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),s=new nf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=B("Max date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function HM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[FM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[qM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(i),H(o)}}}function jM(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[HM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function zM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=s==null?void 0:s.min,a=s==null?void 0:s.max;function u(T,M){T.detail&&T.detail.length==3&&t(0,s[M]=T.detail[1],s)}function f(T){r=T,t(2,r),t(0,s)}function c(T){n.$$.not_equal(s.min,T)&&(s.min=T,t(0,s))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,s)}function h(T){n.$$.not_equal(s.max,T)&&(s.max=T,t(0,s))}const g=T=>u(T,"max");function _(T){s=T,t(0,s)}function k(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(s==null?void 0:s.min)&&t(2,r=s==null?void 0:s.min),n.$$.dirty&9&&a!=(s==null?void 0:s.max)&&t(3,a=s==null?void 0:s.max)},[s,o,r,a,u,l,f,c,d,m,h,g,_,k,S,$]}class UM extends Se{constructor(e){super(),we(this,e,zM,jM,ke,{field:0,key:1})}}function VM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[9]),p(o,"type","number"),p(o,"id",r=n[9]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(c,o,d),u||(f=W(o,"input",n[3]),u=!0)},p(c,d){d&512&&l!==(l=c[9])&&p(e,"for",l),d&512&&r!==(r=c[9])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function BM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){v(c,e,d),e.checked=n[0].convertURLs,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[4]),Oe(qe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].convertURLs),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function WM(n){let e,t,i,l;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[VM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[BM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name="fields."+s[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name="fields."+s[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function YM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[WM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function KM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=m=>t(0,s.maxSize=m.target.value<<0,s);function a(){s.convertURLs=this.checked,t(0,s)}function u(m){s=m,t(0,s)}function f(m){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class JM extends Se{constructor(e){super(),we(this,e,KM,YM,ke,{field:0,key:1})}}function ZM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[3](_)}let g={id:n[9],disabled:!V.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(f,"class","help-block")},m(_,k){v(_,e,k),w(e,t),w(e,i),w(e,l),v(_,o,k),q(r,_,k),v(_,u,k),v(_,f,k),c=!0,d||(m=Oe(qe.call(null,l,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]),k&1&&(S.disabled=!V.isEmpty(_[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].exceptDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(O(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),H(r,_),d=!1,m()}}}function GM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[4](_)}let g={id:n[9]+".onlyDomains",disabled:!V.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".onlyDomains"),p(f,"class","help-block")},m(_,k){v(_,e,k),w(e,t),w(e,i),w(e,l),v(_,o,k),q(r,_,k),v(_,u,k),v(_,f,k),c=!0,d||(m=Oe(qe.call(null,l,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]+".onlyDomains"))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]+".onlyDomains"),k&1&&(S.disabled=!V.isEmpty(_[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].onlyDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(O(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),H(r,_),d=!1,m()}}}function XM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[ZM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[GM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(i),H(o)}}}function QM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[XM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function xM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.exceptDomains,m)&&(s.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.onlyDomains,m)&&(s.onlyDomains=m,t(0,s))}function u(m){s=m,t(0,s)}function f(m){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class yy extends Se{constructor(e){super(),we(this,e,xM,QM,ke,{field:0,key:1})}}function eE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=B(t),l=C(),s=b("small"),r=B(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),w(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&oe(i,t),u&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:te,o:te,d(a){a&&(y(e),y(l),y(s))}}}function tE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class sh extends Se{constructor(e){super(),we(this,e,tE,eE,ke,{item:0})}}const nE=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function iE(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function lE(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[iE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),v(r,s,a),o=!0},p(r,a){const u={};a&16777216&&(u.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(O(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l),y(s)),H(i,r)}}}function sE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=C(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=C(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=C(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(f,r,c),a||(u=[W(e,"click",n[8]),W(i,"click",n[9]),W(s,"click",n[10]),W(r,"click",n[11])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r)),a=!1,Ie(u)}}}function oE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$;function T(E){n[7](E)}let M={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:sh,optionComponent:sh};return n[0].mimeTypes!==void 0&&(M.keyOfSelected=n[0].mimeTypes),r=new zn({props:M}),ie.push(()=>be(r,"keyOfSelected",T)),_=new jn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[sE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),h=b("i"),g=C(),j(_.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){v(E,e,L),w(e,t),w(e,i),w(e,l),v(E,o,L),q(r,E,L),v(E,u,L),v(E,f,L),w(f,c),w(c,d),w(c,m),w(c,h),w(c,g),q(_,c,null),k=!0,S||($=Oe(qe.call(null,l,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!k||L&8388608&&s!==(s=E[23]))&&p(e,"for",s);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,$e(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){k||(O(r.$$.fragment,E),O(_.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),k=!1},d(E){E&&(y(e),y(o),y(u),y(f)),H(r,E),H(_),S=!1,$()}}}function rE(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH + `}}function pe(){t.calendarContainer.classList.add("hasWeeks");var X=Ot("div","flatpickr-weekwrapper");X.appendChild(Ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var x=Ot("div","flatpickr-weeks");return X.appendChild(x),{weekWrapper:X,weekNumbers:x}}function ce(X,x){x===void 0&&(x=!0);var le=x?X:X-t.currentMonth;le<0&&t._hidePrevMonthArrow===!0||le>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=le,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),z()),R(),Dt("onMonthChange"),Ui())}function ue(X,x){if(X===void 0&&(X=!0),x===void 0&&(x=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,x===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=La(t.config),ge=le.hours,Fe=le.minutes,Be=le.seconds;m(ge,Fe,Be)}t.redraw(),X&&Dt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Dt("onClose")}function Ke(){t.config!==void 0&&Dt("onDestroy");for(var X=t._handlers.length;X--;)t._handlers[X].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var x=t.calendarContainer.parentNode;if(x.lastChild&&x.removeChild(x.lastChild),x.parentNode){for(;x.firstChild;)x.parentNode.insertBefore(x.firstChild,x);x.parentNode.removeChild(x)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(le){try{delete t[le]}catch{}})}function Je(X){return t.calendarContainer.contains(X)}function ft(X){if(t.isOpen&&!t.config.inline){var x=Un(X),le=Je(x),ge=x===t.input||x===t.altInput||t.element.contains(x)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!ge&&!le&&!Je(X.relatedTarget),Be=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(x)});Fe&&Be&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function et(X){if(!(!X||t.config.minDate&&Xt.config.maxDate.getFullYear())){var x=X,le=t.currentYear!==x;t.currentYear=x||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),le&&(t.redraw(),Dt("onYearChange"),z())}}function xe(X,x){var le;x===void 0&&(x=!0);var ge=t.parseDate(X,void 0,x);if(t.config.minDate&&ge&&Vn(ge,t.config.minDate,x!==void 0?x:!t.minDateHasTime)<0||t.config.maxDate&&ge&&Vn(ge,t.config.maxDate,x!==void 0?x:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ge===void 0)return!1;for(var Fe=!!t.config.enable,Be=(le=t.config.enable)!==null&&le!==void 0?le:t.config.disable,rt=0,se=void 0;rt=se.from.getTime()&&ge.getTime()<=se.to.getTime())return Fe}return!Fe}function We(X){return t.daysContainer!==void 0?X.className.indexOf("hidden")===-1&&X.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(X):!1}function at(X){var x=X.target===t._input,le=t._input.value.trimEnd()!==fl();x&&le&&!(X.relatedTarget&&Je(X.relatedTarget))&&t.setDate(t._input.value,!0,X.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function jt(X){var x=Un(X),le=t.config.wrap?n.contains(x):x===t._input,ge=t.config.allowInput,Fe=t.isOpen&&(!ge||!le),Be=t.config.inline&&le&&!ge;if(X.keyCode===13&&le){if(ge)return t.setDate(t._input.value,!0,x===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),x.blur();t.open()}else if(Je(x)||Fe||Be){var rt=!!t.timeContainer&&t.timeContainer.contains(x);switch(X.keyCode){case 13:rt?(X.preventDefault(),a(),on()):En(X);break;case 27:X.preventDefault(),on();break;case 8:case 46:le&&!t.config.allowInput&&(X.preventDefault(),t.clear());break;case 37:case 39:if(!rt&&!le){X.preventDefault();var se=s();if(t.daysContainer!==void 0&&(ge===!1||se&&We(se))){var Me=X.keyCode===39?1:-1;X.ctrlKey?(X.stopPropagation(),ce(Me),P(I(1),0)):P(void 0,Me)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:X.preventDefault();var Ne=X.keyCode===40?1:-1;t.daysContainer&&x.$i!==void 0||x===t.input||x===t.altInput?X.ctrlKey?(X.stopPropagation(),et(t.currentYear-Ne),P(I(1),0)):rt||P(void 0,Ne*7):x===t.currentYearElement?et(t.currentYear-Ne):t.config.enableTime&&(!rt&&t.hourElement&&t.hourElement.focus(),a(X),t._debouncedChange());break;case 9:if(rt){var ze=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(qt){return qt}),Ge=ze.indexOf(x);if(Ge!==-1){var xt=ze[Ge+(X.shiftKey?-1:1)];X.preventDefault(),(xt||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(x)&&X.shiftKey&&(X.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&x===t.amPM)switch(X.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Dn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Dn();break}(le||Je(x))&&Dt("onKeyDown",X)}function Ve(X,x){if(x===void 0&&(x="flatpickr-day"),!(t.selectedDates.length!==1||X&&(!X.classList.contains(x)||X.classList.contains("flatpickr-disabled")))){for(var le=X?X.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ge=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Fe=Math.min(le,t.selectedDates[0].getTime()),Be=Math.max(le,t.selectedDates[0].getTime()),rt=!1,se=0,Me=0,Ne=Fe;NeFe&&Nese)?se=Ne:Ne>ge&&(!Me||Ne ."+x));ze.forEach(function(Ge){var xt=Ge.dateObj,qt=xt.getTime(),Sn=se>0&&qt0&&qt>Me;if(Sn){Ge.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Ei){Ge.classList.remove(Ei)});return}else if(rt&&!Sn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Ei){Ge.classList.remove(Ei)}),X!==void 0&&(X.classList.add(le<=t.selectedDates[0].getTime()?"startRange":"endRange"),gele&&qt===ge&&Ge.classList.add("endRange"),qt>=se&&(Me===0||qt<=Me)&&MM(qt,ge,le)&&Ge.classList.add("inRange"))})}}function Ee(){t.isOpen&&!t.config.static&&!t.config.inline&&ct()}function st(X,x){if(x===void 0&&(x=t._positionElement),t.isMobile===!0){if(X){X.preventDefault();var le=Un(X);le&&le.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Dt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ge=t.isOpen;t.isOpen=!0,ge||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Dt("onOpen"),ct(x)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(X===void 0||!t.timeContainer.contains(X.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function De(X){return function(x){var le=t.config["_"+X+"Date"]=t.parseDate(x,t.config.dateFormat),ge=t.config["_"+(X==="min"?"max":"min")+"Date"];le!==void 0&&(t[X==="min"?"minDateHasTime":"maxDateHasTime"]=le.getHours()>0||le.getMinutes()>0||le.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Fe){return xe(Fe)}),!t.selectedDates.length&&X==="min"&&d(le),Dn()),t.daysContainer&&(ot(),le!==void 0?t.currentYearElement[X]=le.getFullYear().toString():t.currentYearElement.removeAttribute(X),t.currentYearElement.disabled=!!ge&&le!==void 0&&ge.getFullYear()===le.getFullYear())}}function Ye(){var X=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],x=mn(mn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),le={};t.config.parseDate=x.parseDate,t.config.formatDate=x.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(ze){t.config._enable=fn(ze)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(ze){t.config._disable=fn(ze)}});var ge=x.mode==="time";if(!x.dateFormat&&(x.enableTime||ge)){var Fe=tn.defaultConfig.dateFormat||es.dateFormat;le.dateFormat=x.noCalendar||ge?"H:i"+(x.enableSeconds?":S":""):Fe+" H:i"+(x.enableSeconds?":S":"")}if(x.altInput&&(x.enableTime||ge)&&!x.altFormat){var Be=tn.defaultConfig.altFormat||es.altFormat;le.altFormat=x.noCalendar||ge?"h:i"+(x.enableSeconds?":S K":" K"):Be+(" h:i"+(x.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:De("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:De("max")});var rt=function(ze){return function(Ge){t.config[ze==="min"?"_minTime":"_maxTime"]=t.parseDate(Ge,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:rt("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:rt("max")}),x.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,le,x);for(var se=0;se-1?t.config[Ne]=Ea(Me[Ne]).map(o).concat(t.config[Ne]):typeof x[Ne]>"u"&&(t.config[Ne]=Me[Ne])}x.altInputClass||(t.config.altInputClass=ve().className+" "+t.config.altInputClass),Dt("onParseConfig")}function ve(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ce(){typeof t.config.locale!="object"&&typeof tn.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=mn(mn({},tn.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?tn.l10ns[t.config.locale]:void 0),wl.D="("+t.l10n.weekdays.shorthand.join("|")+")",wl.l="("+t.l10n.weekdays.longhand.join("|")+")",wl.M="("+t.l10n.months.shorthand.join("|")+")",wl.F="("+t.l10n.months.longhand.join("|")+")",wl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var X=mn(mn({},e),JSON.parse(JSON.stringify(n.dataset||{})));X.time_24hr===void 0&&tn.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=ky(t),t.parseDate=fu({config:t.config,l10n:t.l10n})}function ct(X){if(typeof t.config.position=="function")return void t.config.position(t,X);if(t.calendarContainer!==void 0){Dt("onPreCalendarPosition");var x=X||t._positionElement,le=Array.prototype.reduce.call(t.calendarContainer.children,function(gs,Vr){return gs+Vr.offsetHeight},0),ge=t.calendarContainer.offsetWidth,Fe=t.config.position.split(" "),Be=Fe[0],rt=Fe.length>1?Fe[1]:null,se=x.getBoundingClientRect(),Me=window.innerHeight-se.bottom,Ne=Be==="above"||Be!=="below"&&Mele,ze=window.pageYOffset+se.top+(Ne?-le-2:x.offsetHeight+2);if($n(t.calendarContainer,"arrowTop",!Ne),$n(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var Ge=window.pageXOffset+se.left,xt=!1,qt=!1;rt==="center"?(Ge-=(ge-se.width)/2,xt=!0):rt==="right"&&(Ge-=ge-se.width,qt=!0),$n(t.calendarContainer,"arrowLeft",!xt&&!qt),$n(t.calendarContainer,"arrowCenter",xt),$n(t.calendarContainer,"arrowRight",qt);var Sn=window.document.body.offsetWidth-(window.pageXOffset+se.right),Ei=Ge+ge>window.document.body.offsetWidth,go=Sn+ge>window.document.body.offsetWidth;if($n(t.calendarContainer,"rightMost",Ei),!t.config.static)if(t.calendarContainer.style.top=ze+"px",!Ei)t.calendarContainer.style.left=Ge+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Sn+"px";else{var Fl=Ht();if(Fl===void 0)return;var bo=window.document.body.offsetWidth,_s=Math.max(0,bo/2-ge/2),Di=".flatpickr-calendar.centerMost:before",dl=".flatpickr-calendar.centerMost:after",pl=Fl.cssRules.length,ql="{left:"+se.left+"px;right:auto;}";$n(t.calendarContainer,"rightMost",!1),$n(t.calendarContainer,"centerMost",!0),Fl.insertRule(Di+","+dl+ql,pl),t.calendarContainer.style.left=_s+"px",t.calendarContainer.style.right="auto"}}}}function Ht(){for(var X=null,x=0;xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ge,t.config.mode==="single")t.selectedDates=[Fe];else if(t.config.mode==="multiple"){var rt=ul(Fe);rt?t.selectedDates.splice(parseInt(rt),1):t.selectedDates.push(Fe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Fe,t.selectedDates.push(Fe),Vn(Fe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(ze,Ge){return ze.getTime()-Ge.getTime()}));if(c(),Be){var se=t.currentYear!==Fe.getFullYear();t.currentYear=Fe.getFullYear(),t.currentMonth=Fe.getMonth(),se&&(Dt("onYearChange"),z()),Dt("onMonthChange")}if(Ui(),R(),Dn(),!Be&&t.config.mode!=="range"&&t.config.showMonths===1?L(ge):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Me=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Me||Ne)&&on()}_()}}var Re={locale:[Ce,G],showMonths:[U,r,Z],minDate:[S],maxDate:[S],positionElement:[bt],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ft(X,x){if(X!==null&&typeof X=="object"){Object.assign(t.config,X);for(var le in X)Re[le]!==void 0&&Re[le].forEach(function(ge){return ge()})}else t.config[X]=x,Re[X]!==void 0?Re[X].forEach(function(ge){return ge()}):Ma.indexOf(X)>-1&&(t.config[X]=Ea(x));t.redraw(),Dn(!0)}function Yt(X,x){var le=[];if(X instanceof Array)le=X.map(function(ge){return t.parseDate(ge,x)});else if(X instanceof Date||typeof X=="number")le=[t.parseDate(X,x)];else if(typeof X=="string")switch(t.config.mode){case"single":case"time":le=[t.parseDate(X,x)];break;case"multiple":le=X.split(t.config.conjunction).map(function(ge){return t.parseDate(ge,x)});break;case"range":le=X.split(t.l10n.rangeSeparator).map(function(ge){return t.parseDate(ge,x)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(X)));t.selectedDates=t.config.allowInvalidPreload?le:le.filter(function(ge){return ge instanceof Date&&xe(ge,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ge,Fe){return ge.getTime()-Fe.getTime()})}function vn(X,x,le){if(x===void 0&&(x=!1),le===void 0&&(le=t.config.dateFormat),X!==0&&!X||X instanceof Array&&X.length===0)return t.clear(x);Yt(X,le),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,x),d(),t.selectedDates.length===0&&t.clear(!1),Dn(x),x&&Dt("onChange")}function fn(X){return X.slice().map(function(x){return typeof x=="string"||typeof x=="number"||x instanceof Date?t.parseDate(x,void 0,!0):x&&typeof x=="object"&&x.from&&x.to?{from:t.parseDate(x.from,void 0),to:t.parseDate(x.to,void 0)}:x}).filter(function(x){return x})}function Oi(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var X=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);X&&Yt(X,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function li(){if(t.input=ve(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=Ot(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),bt()}function bt(){t._positionElement=t.config.positionElement||t._input}function wn(){var X=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Ot("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=X,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=X==="datetime-local"?"Y-m-d\\TH:i:S":X==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(x){t.setDate(Un(x).value,!1,t.mobileFormatStr),Dt("onChange"),Dt("onClose")})}function sn(X){if(t.isOpen===!0)return t.close();t.open(X)}function Dt(X,x){if(t.config!==void 0){var le=t.config[X];if(le!==void 0&&le.length>0)for(var ge=0;le[ge]&&ge=0&&Vn(X,t.selectedDates[1])<=0}function Ui(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(X,x){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+x),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[x].textContent=$r(le.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=le.getMonth().toString(),X.value=le.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function fl(X){var x=X||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(le){return t.formatDate(le,x)}).filter(function(le,ge,Fe){return t.config.mode!=="range"||t.config.enableTime||Fe.indexOf(le)===ge}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Dn(X){X===void 0&&(X=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=fl(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=fl(t.config.altFormat)),X!==!1&&Dt("onValueUpdate")}function Rl(X){var x=Un(X),le=t.prevMonthNav.contains(x),ge=t.nextMonthNav.contains(x);le||ge?ce(le?-1:1):t.yearElements.indexOf(x)>=0?x.select():x.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):x.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(X){X.preventDefault();var x=X.type==="keydown",le=Un(X),ge=le;t.amPM!==void 0&&le===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]);var Fe=parseFloat(ge.getAttribute("min")),Be=parseFloat(ge.getAttribute("max")),rt=parseFloat(ge.getAttribute("step")),se=parseInt(ge.value,10),Me=X.delta||(x?X.which===38?1:-1:0),Ne=se+rt*Me;if(typeof ge.value<"u"&&ge.value.length===2){var ze=ge===t.hourElement,Ge=ge===t.minuteElement;NeBe&&(Ne=ge===t.hourElement?Ne-Be-Gn(!t.amPM):Fe,Ge&&T(void 0,1,t.hourElement)),t.amPM&&ze&&(rt===1?Ne+se===23:Math.abs(Ne-se)>rt)&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]),ge.value=Ln(Ne)}}return l(),t}function ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function RM(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:g=void 0}=e;Xt(()=>{const T=f??h,O=k(d);return O.onReady.push((E,L,I)=>{a===void 0&&S(E,L,I),dn().then(()=>{t(8,m=!0)})}),t(3,g=tn(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=kt();function k(T={}){T=Object.assign({},T);for(const O of r){const E=(L,I,A)=>{_(NM(O),[L,I,A])};O in T?(Array.isArray(T[O])||(T[O]=[T[O]]),T[O].push(E)):T[O]=[E]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,O,E){const L=ih(E,T);!lh(a,L)&&(a||L)&&t(2,a=L),t(4,u=O)}function $(T){ie[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(1,l=lt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,g=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(lh(a,ih(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[T,O]of Object.entries(k(d)))g.set(T,O)},[h,l,a,g,u,f,c,d,m,o,s,$]}class nf extends Se{constructor(e){super(),we(this,e,RM,PM,ke,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function FM(n){let e,t,i,l,s,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),s=new nf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=B("Min date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,$e(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function qM(n){let e,t,i,l,s,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:V.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),s=new nf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=B("Max date (UTC)"),l=C(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,$e(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function HM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[FM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[qM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(i),H(o)}}}function jM(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[HM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function zM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=s==null?void 0:s.min,a=s==null?void 0:s.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,s[O]=T.detail[1],s)}function f(T){r=T,t(2,r),t(0,s)}function c(T){n.$$.not_equal(s.min,T)&&(s.min=T,t(0,s))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,s)}function h(T){n.$$.not_equal(s.max,T)&&(s.max=T,t(0,s))}const g=T=>u(T,"max");function _(T){s=T,t(0,s)}function k(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(s==null?void 0:s.min)&&t(2,r=s==null?void 0:s.min),n.$$.dirty&9&&a!=(s==null?void 0:s.max)&&t(3,a=s==null?void 0:s.max)},[s,o,r,a,u,l,f,c,d,m,h,g,_,k,S,$]}class UM extends Se{constructor(e){super(),we(this,e,zM,jM,ke,{field:0,key:1})}}function VM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[9]),p(o,"type","number"),p(o,"id",r=n[9]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(c,o,d),u||(f=W(o,"input",n[3]),u=!0)},p(c,d){d&512&&l!==(l=c[9])&&p(e,"for",l),d&512&&r!==(r=c[9])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function BM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){v(c,e,d),e.checked=n[0].convertURLs,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[4]),Oe(qe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].convertURLs),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function WM(n){let e,t,i,l;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[VM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[BM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name="fields."+s[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name="fields."+s[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function YM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[WM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function KM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=m=>t(0,s.maxSize=m.target.value<<0,s);function a(){s.convertURLs=this.checked,t(0,s)}function u(m){s=m,t(0,s)}function f(m){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class JM extends Se{constructor(e){super(),we(this,e,KM,YM,ke,{field:0,key:1})}}function ZM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[3](_)}let g={id:n[9],disabled:!V.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(f,"class","help-block")},m(_,k){v(_,e,k),w(e,t),w(e,i),w(e,l),v(_,o,k),q(r,_,k),v(_,u,k),v(_,f,k),c=!0,d||(m=Oe(qe.call(null,l,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]),k&1&&(S.disabled=!V.isEmpty(_[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].exceptDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),H(r,_),d=!1,m()}}}function GM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[4](_)}let g={id:n[9]+".onlyDomains",disabled:!V.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".onlyDomains"),p(f,"class","help-block")},m(_,k){v(_,e,k),w(e,t),w(e,i),w(e,l),v(_,o,k),q(r,_,k),v(_,u,k),v(_,f,k),c=!0,d||(m=Oe(qe.call(null,l,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]+".onlyDomains"))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]+".onlyDomains"),k&1&&(S.disabled=!V.isEmpty(_[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].onlyDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),H(r,_),d=!1,m()}}}function XM(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[ZM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[GM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(i),H(o)}}}function QM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[XM]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function xM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.exceptDomains,m)&&(s.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.onlyDomains,m)&&(s.onlyDomains=m,t(0,s))}function u(m){s=m,t(0,s)}function f(m){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(2,l=lt(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class yy extends Se{constructor(e){super(),we(this,e,xM,QM,ke,{field:0,key:1})}}function eE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=B(t),l=C(),s=b("small"),r=B(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),w(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&oe(i,t),u&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:te,o:te,d(a){a&&(y(e),y(l),y(s))}}}function tE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class sh extends Se{constructor(e){super(),we(this,e,tE,eE,ke,{item:0})}}const nE=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function iE(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function lE(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[iE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),v(r,s,a),o=!0},p(r,a){const u={};a&16777216&&(u.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l),y(s)),H(i,r)}}}function sE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=C(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=C(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=C(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(f,r,c),a||(u=[W(e,"click",n[8]),W(i,"click",n[9]),W(s,"click",n[10]),W(r,"click",n[11])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r)),a=!1,Ie(u)}}}function oE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$;function T(E){n[7](E)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:sh,optionComponent:sh};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new zn({props:O}),ie.push(()=>be(r,"keyOfSelected",T)),_=new jn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[sE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),h=b("i"),g=C(),j(_.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){v(E,e,L),w(e,t),w(e,i),w(e,l),v(E,o,L),q(r,E,L),v(E,u,L),v(E,f,L),w(f,c),w(c,d),w(c,m),w(c,h),w(c,g),q(_,c,null),k=!0,S||($=Oe(qe.call(null,l,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!k||L&8388608&&s!==(s=E[23]))&&p(e,"for",s);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,$e(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){k||(M(r.$$.fragment,E),M(_.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),k=!1},d(E){E&&(y(e),y(o),y(u),y(f)),H(r,E),H(_),S=!1,$()}}}function rE(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH (e.g. 100x50) - crop to WxH viewbox (from center)
  • WxHt (e.g. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (e.g. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (e.g. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (e.g. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (e.g. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function aE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M;function E(I){n[12](I)}let L={id:n[23],placeholder:"e.g. 50x50, 480x720"};return n[0].thumbs!==void 0&&(L.value=n[0].thumbs),r=new ms({props:L}),ie.push(()=>be(r,"value",E)),S=new jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[rE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=C(),_=b("i"),k=C(),j(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(_,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(e,l),v(I,o,A),q(r,I,A),v(I,u,A),v(I,f,A),w(f,c),w(f,d),w(f,m),w(m,h),w(m,g),w(m,_),w(m,k),q(S,m,null),$=!0,T||(M=Oe(qe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!$||A&8388608&&s!==(s=I[23]))&&p(e,"for",s);const P={};A&8388608&&(P.id=I[23]),!a&&A&1&&(a=!0,P.value=I[0].thumbs,$e(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){$||(O(r.$$.fragment,I),O(S.$$.fragment,I),$=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),$=!1},d(I){I&&(y(e),y(o),y(u),y(f)),H(r,I),H(S),T=!1,M()}}}function uE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Max file size"),l=C(),s=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),s.value=r=n[0].maxSize||"",p(s,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),v(d,a,m),v(d,u,m),f||(c=W(s,"input",n[13]),f=!0)},p(d,m){m&8388608&&i!==(i=d[23])&&p(e,"for",i),m&8388608&&o!==(o=d[23])&&p(s,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&s.value!==r&&(s.value=r)},d(d){d&&(y(e),y(l),y(s),y(a),y(u)),f=!1,c()}}}function oh(n){let e,t,i;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[fE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function fE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0,p(s,"placeholder","Default to single")},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].maxSelect),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&>(s.value)!==u[0].maxSelect&&he(s,u[0].maxSelect)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function cE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible - (Learn more)`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){v(c,e,d),e.checked=n[0].protected,v(c,i,d),v(c,l,d),w(l,s),v(c,r,d),v(c,a,d),u||(f=W(e,"change",n[15]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(y(e),y(i),y(l),y(r),y(a)),u=!1,f()}}}function dE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;i=new fe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[oE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[aE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[uE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&oh(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[cE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),d=C(),_&&_.c(),m=C(),j(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(k,S){v(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,a),w(e,u),q(f,u,null),w(e,d),_&&_.m(e,null),w(e,m),q(h,e,null),g=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!g||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const M={};S&2&&(M.name="fields."+k[1]+".maxSize"),S&41943041&&(M.$$scope={dirty:S,ctx:k}),f.$set(M),(!g||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&4&&O(_,1)):(_=oh(k),_.c(),O(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),h.$set(E)},i(k){g||(O(i.$$.fragment,k),O(o.$$.fragment,k),O(f.$$.fragment,k),O(_),O(h.$$.fragment,k),g=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(_),D(h.$$.fragment,k),g=!1},d(k){k&&y(e),H(i),H(o),H(f),_&&_.d(),H(h)}}}function pE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[dE],default:[lE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function mE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=nE.slice(),u=s.maxSelect<=1,f=u;function c(){t(0,s.maxSelect=1,s),t(0,s.thumbs=[],s),t(0,s.mimeTypes=[],s),t(2,u=!0),t(6,f=u)}function d(){if(V.isEmpty(s.mimeTypes))return;const N=[];for(const R of s.mimeTypes)a.find(z=>z.mimeType===R)||N.push({mimeType:R});N.length&&t(3,a=a.concat(N))}function m(N){n.$$.not_equal(s.mimeTypes,N)&&(s.mimeTypes=N,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},_=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},k=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function S(N){n.$$.not_equal(s.thumbs,N)&&(s.thumbs=N,t(0,s),t(6,f),t(2,u))}const $=N=>t(0,s.maxSize=N.target.value<<0,s);function T(){s.maxSelect=gt(this.value),t(0,s),t(6,f),t(2,u)}function M(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function L(N){s=N,t(0,s),t(6,f),t(2,u)}function I(N){Pe.call(this,n,N)}function A(N){Pe.call(this,n,N)}function P(N){Pe.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Wt(N)),t(5,l=lt(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,s.maxSelect=1,s):t(0,s.maxSelect=99,s)),n.$$.dirty&1&&(typeof s.maxSelect>"u"?c():d())},[s,o,u,a,r,l,f,m,h,g,_,k,S,$,T,M,E,L,I,A,P]}class hE extends Se{constructor(e){super(),we(this,e,mE,pE,ke,{field:0,key:1})}}function _E(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[10]),p(o,"type","number"),p(o,"id",r=n[10]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(c,o,d),u||(f=W(o,"input",n[4]),u=!0)},p(c,d){d&1024&&l!==(l=c[10])&&p(e,"for",l),d&1024&&r!==(r=c[10])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function gE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function bE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function rh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L='"{"a":1,"b":2}"',I,A,P,N,R,z,F,U,J,Y,Z,G,pe;return{c(){e=b("div"),t=b("div"),i=b("div"),l=B("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=B(` and + (e.g. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function aE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O;function E(I){n[12](I)}let L={id:n[23],placeholder:"e.g. 50x50, 480x720"};return n[0].thumbs!==void 0&&(L.value=n[0].thumbs),r=new ms({props:L}),ie.push(()=>be(r,"value",E)),S=new jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[rE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),l=b("i"),o=C(),j(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=C(),_=b("i"),k=C(),j(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(_,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(e,l),v(I,o,A),q(r,I,A),v(I,u,A),v(I,f,A),w(f,c),w(f,d),w(f,m),w(m,h),w(m,g),w(m,_),w(m,k),q(S,m,null),$=!0,T||(O=Oe(qe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!$||A&8388608&&s!==(s=I[23]))&&p(e,"for",s);const P={};A&8388608&&(P.id=I[23]),!a&&A&1&&(a=!0,P.value=I[0].thumbs,$e(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){$||(M(r.$$.fragment,I),M(S.$$.fragment,I),$=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),$=!1},d(I){I&&(y(e),y(o),y(u),y(f)),H(r,I),H(S),T=!1,O()}}}function uE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Max file size"),l=C(),s=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),s.value=r=n[0].maxSize||"",p(s,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),v(d,a,m),v(d,u,m),f||(c=W(s,"input",n[13]),f=!0)},p(d,m){m&8388608&&i!==(i=d[23])&&p(e,"for",i),m&8388608&&o!==(o=d[23])&&p(s,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&s.value!==r&&(s.value=r)},d(d){d&&(y(e),y(l),y(s),y(a),y(u)),f=!1,c()}}}function oh(n){let e,t,i;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[fE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function fE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0,p(s,"placeholder","Default to single")},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].maxSelect),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&>(s.value)!==u[0].maxSelect&&he(s,u[0].maxSelect)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function cE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible + (Learn more)`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){v(c,e,d),e.checked=n[0].protected,v(c,i,d),v(c,l,d),w(l,s),v(c,r,d),v(c,a,d),u||(f=W(e,"change",n[15]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(y(e),y(i),y(l),y(r),y(a)),u=!1,f()}}}function dE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;i=new fe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[oE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[aE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[uE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&oh(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[cE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),d=C(),_&&_.c(),m=C(),j(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(k,S){v(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,a),w(e,u),q(f,u,null),w(e,d),_&&_.m(e,null),w(e,m),q(h,e,null),g=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!g||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!g||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&4&&M(_,1)):(_=oh(k),_.c(),M(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),h.$set(E)},i(k){g||(M(i.$$.fragment,k),M(o.$$.fragment,k),M(f.$$.fragment,k),M(_),M(h.$$.fragment,k),g=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(_),D(h.$$.fragment,k),g=!1},d(k){k&&y(e),H(i),H(o),H(f),_&&_.d(),H(h)}}}function pE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[dE],default:[lE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function mE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=nE.slice(),u=s.maxSelect<=1,f=u;function c(){t(0,s.maxSelect=1,s),t(0,s.thumbs=[],s),t(0,s.mimeTypes=[],s),t(2,u=!0),t(6,f=u)}function d(){if(V.isEmpty(s.mimeTypes))return;const N=[];for(const R of s.mimeTypes)a.find(z=>z.mimeType===R)||N.push({mimeType:R});N.length&&t(3,a=a.concat(N))}function m(N){n.$$.not_equal(s.mimeTypes,N)&&(s.mimeTypes=N,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},_=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},k=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function S(N){n.$$.not_equal(s.thumbs,N)&&(s.thumbs=N,t(0,s),t(6,f),t(2,u))}const $=N=>t(0,s.maxSize=N.target.value<<0,s);function T(){s.maxSelect=gt(this.value),t(0,s),t(6,f),t(2,u)}function O(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function L(N){s=N,t(0,s),t(6,f),t(2,u)}function I(N){Pe.call(this,n,N)}function A(N){Pe.call(this,n,N)}function P(N){Pe.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Wt(N)),t(5,l=lt(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,s.maxSelect=1,s):t(0,s.maxSelect=99,s)),n.$$.dirty&1&&(typeof s.maxSelect>"u"?c():d())},[s,o,u,a,r,l,f,m,h,g,_,k,S,$,T,O,E,L,I,A,P]}class hE extends Se{constructor(e){super(),we(this,e,mE,pE,ke,{field:0,key:1})}}function _E(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max size "),i=b("small"),i.textContent="(bytes)",s=C(),o=b("input"),p(e,"for",l=n[10]),p(o,"type","number"),p(o,"id",r=n[10]),p(o,"step","1"),p(o,"min","0"),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){v(c,e,d),w(e,t),w(e,i),v(c,s,d),v(c,o,d),u||(f=W(o,"input",n[4]),u=!0)},p(c,d){d&1024&&l!==(l=c[10])&&p(e,"for",l),d&1024&&r!==(r=c[10])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function gE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function bE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function rh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L='"{"a":1,"b":2}"',I,A,P,N,R,z,F,U,J,Y,Z,G,pe;return{c(){e=b("div"),t=b("div"),i=b("div"),l=B("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=B(` and `),r=b("code"),r.textContent="multipart/form-data",a=B(` requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=B(` field is a `),c=b("strong"),c.textContent="plain string",d=B(`: - `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",g=C(),_=b("li"),_.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",M=C(),E=b("li"),I=B(L),A=B(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",U=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",Y=B(` + `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",g=C(),_=b("li"),_.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",O=C(),E=b("li"),I=B(L),A=B(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",U=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",Y=B(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ce,ue){v(ce,e,ue),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(i,r),w(i,a),w(i,u),w(i,f),w(i,c),w(i,d),w(i,m),w(m,h),w(m,g),w(m,_),w(m,k),w(m,S),w(m,$),w(m,T),w(m,M),w(m,E),w(E,I),w(E,A),w(E,P),w(m,N),w(m,R),w(m,z),w(m,F),w(m,U),w(m,J),w(i,Y),w(i,Z),pe=!0},i(ce){pe||(ce&&tt(()=>{pe&&(G||(G=He(e,mt,{duration:150},!0)),G.run(1))}),pe=!0)},o(ce){ce&&(G||(G=He(e,mt,{duration:150},!1)),G.run(0)),pe=!1},d(ce){ce&&y(e),ce&&G&&G.end()}}}function kE(n){let e,t,i,l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[_E,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,k){return _[2]?bE:gE}let m=d(n),h=m(n),g=n[2]&&rh();return{c(){j(e.$$.fragment),t=C(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=C(),h.c(),r=C(),g&&g.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(_,k){q(e,_,k),v(_,t,k),v(_,i,k),w(i,l),w(i,s),h.m(i,null),v(_,r,k),g&&g.m(_,k),v(_,a,k),u=!0,f||(c=W(i,"click",n[5]),f=!0)},p(_,k){const S={};k&2&&(S.name="fields."+_[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?k&4&&O(g,1):(g=rh(),g.c(),O(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(O(e.$$.fragment,_),O(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(y(t),y(i),y(r),y(a)),H(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function yE(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[kE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Rt(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function vE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=h=>t(0,s.maxSize=h.target.value<<0,s),u=()=>{t(2,r=!r)};function f(h){s=h,t(0,s)}function c(h){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Wt(h)),t(3,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,r,l,a,u,f,c,d,m]}class wE extends Se{constructor(e){super(),we(this,e,vE,yE,ke,{field:0,key:1})}}function SE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Min"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].min),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&>(s.value)!==u[0].min&&he(s,u[0].min)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function TE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].min)},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),he(s,n[0].max),a||(u=W(s,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].min)&&p(s,"min",r),c&1&>(s.value)!==f[0].max&&he(s,f[0].max)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function $E(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[SE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[TE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(O(i.$$.fragment,a),O(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(i),H(o)}}}function CE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="No decimals",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){v(c,e,d),e.checked=n[0].onlyInt,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[3]),Oe(qe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].onlyInt),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function OE(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[CE,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".onlyInt"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ME(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[OE],options:[$E]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function EE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){s.onlyInt=this.checked,t(0,s)}function a(){s.min=gt(this.value),t(0,s)}function u(){s.max=gt(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Wt(h)),t(2,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,u,f,c,d,m]}class DE extends Se{constructor(e){super(),we(this,e,EE,ME,ke,{field:0,key:1})}}function IE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Min length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].min||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[3]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].min||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function LE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"placeholder","Up to 71 chars"),p(s,"min",r=n[0].min||0),p(s,"max","71"),s.value=a=n[0].max||""},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),u||(f=W(s,"input",n[4]),u=!0)},p(c,d){d&4096&&i!==(i=c[12])&&p(e,"for",i),d&4096&&o!==(o=c[12])&&p(s,"id",o),d&1&&r!==(r=c[0].min||0)&&p(s,"min",r),d&1&&a!==(a=c[0].max||"")&&s.value!==a&&(s.value=a)},d(c){c&&(y(e),y(l),y(s)),u=!1,f()}}}function AE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Bcrypt cost"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"placeholder","Default to 10"),p(s,"step","1"),p(s,"min","6"),p(s,"max","31"),s.value=r=n[0].cost||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[5]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].cost||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function PE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Validation pattern"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","text"),p(s,"id",o=n[12]),p(s,"placeholder","ex. ^\\w+$")},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].pattern),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(s,"id",o),f&1&&s.value!==u[0].pattern&&he(s,u[0].pattern)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function NE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[IE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[LE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[AE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[PE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&12289&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g&2&&(k.name="fields."+h[1]+".max"),g&12289&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g&2&&(S.name="fields."+h[1]+".cost"),g&12289&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const $={};g&2&&($.name="fields."+h[1]+".pattern"),g&12289&&($.$$scope={dirty:g,ctx:h}),d.$set($)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),O(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&y(e),H(i),H(o),H(u),H(d)}}}function RE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[NE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function FE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.cost=11,s)}const a=_=>t(0,s.min=_.target.value<<0,s),u=_=>t(0,s.max=_.target.value<<0,s),f=_=>t(0,s.cost=_.target.value<<0,s);function c(){s.pattern=this.value,t(0,s)}function d(_){s=_,t(0,s)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Wt(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,g]}class qE extends Se{constructor(e){super(),we(this,e,FE,RE,ke,{field:0,key:1})}}function HE(n){let e,t,i,l,s;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=W(i,"click",n[14]),l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,s()}}}function jE(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[HE]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].collectionId,$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function zE(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UE(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[jE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[zE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(r,c,d),v(c,a,d),v(c,u,d),f=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(O(i.$$.fragment,c),O(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(y(e),y(t),y(l),y(s),y(o),y(a),y(u)),H(i,c),H(r,c)}}}function ah(n){let e,t,i,l,s,o;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[VE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[BE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),j(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){v(r,e,a),q(t,e,null),v(r,i,a),v(r,l,a),q(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="fields."+r[1]+".minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="fields."+r[1]+".maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(O(t.$$.fragment,r),O(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(y(e),y(i),y(l)),H(t),H(s)}}}function VE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Min select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].minSelect||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[11]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function BE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","Default to single"),p(s,"min",r=n[0].minSelect||1)},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),he(s,n[0].maxSelect),a||(u=W(s,"input",n[12]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||1)&&p(s,"min",r),c&1&>(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function WE(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(g){n[13](g)}let h={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(h.keyOfSelected=n[0].cascadeDelete),a=new zn({props:h}),ie.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),l=b("i"),r=C(),j(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(g,_){var k,S;v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,r,_),q(a,g,_),f=!0,c||(d=Oe(s=qe.call(null,l,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + data inside an object, eg.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ce,ue){v(ce,e,ue),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(i,r),w(i,a),w(i,u),w(i,f),w(i,c),w(i,d),w(i,m),w(m,h),w(m,g),w(m,_),w(m,k),w(m,S),w(m,$),w(m,T),w(m,O),w(m,E),w(E,I),w(E,A),w(E,P),w(m,N),w(m,R),w(m,z),w(m,F),w(m,U),w(m,J),w(i,Y),w(i,Z),pe=!0},i(ce){pe||(ce&&tt(()=>{pe&&(G||(G=He(e,mt,{duration:150},!0)),G.run(1))}),pe=!0)},o(ce){ce&&(G||(G=He(e,mt,{duration:150},!1)),G.run(0)),pe=!1},d(ce){ce&&y(e),ce&&G&&G.end()}}}function kE(n){let e,t,i,l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[_E,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,k){return _[2]?bE:gE}let m=d(n),h=m(n),g=n[2]&&rh();return{c(){j(e.$$.fragment),t=C(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=C(),h.c(),r=C(),g&&g.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(_,k){q(e,_,k),v(_,t,k),v(_,i,k),w(i,l),w(i,s),h.m(i,null),v(_,r,k),g&&g.m(_,k),v(_,a,k),u=!0,f||(c=W(i,"click",n[5]),f=!0)},p(_,k){const S={};k&2&&(S.name="fields."+_[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?k&4&&M(g,1):(g=rh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(y(t),y(i),y(r),y(a)),H(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function yE(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[kE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Rt(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function vE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=h=>t(0,s.maxSize=h.target.value<<0,s),u=()=>{t(2,r=!r)};function f(h){s=h,t(0,s)}function c(h){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Wt(h)),t(3,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,r,l,a,u,f,c,d,m]}class wE extends Se{constructor(e){super(),we(this,e,vE,yE,ke,{field:0,key:1})}}function SE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Min"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].min),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&>(s.value)!==u[0].min&&he(s,u[0].min)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function TE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].min)},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),he(s,n[0].max),a||(u=W(s,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].min)&&p(s,"min",r),c&1&>(s.value)!==f[0].max&&he(s,f[0].max)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function $E(n){let e,t,i,l,s,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[SE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[TE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(i),H(o)}}}function CE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="No decimals",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){v(c,e,d),e.checked=n[0].onlyInt,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[3]),Oe(qe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].onlyInt),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function OE(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[CE,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".onlyInt"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ME(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[OE],options:[$E]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function EE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){s.onlyInt=this.checked,t(0,s)}function a(){s.min=gt(this.value),t(0,s)}function u(){s.max=gt(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Wt(h)),t(2,l=lt(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,u,f,c,d,m]}class DE extends Se{constructor(e){super(),we(this,e,EE,ME,ke,{field:0,key:1})}}function IE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Min length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].min||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[3]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].min||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function LE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max length"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"step","1"),p(s,"placeholder","Up to 71 chars"),p(s,"min",r=n[0].min||0),p(s,"max","71"),s.value=a=n[0].max||""},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),u||(f=W(s,"input",n[4]),u=!0)},p(c,d){d&4096&&i!==(i=c[12])&&p(e,"for",i),d&4096&&o!==(o=c[12])&&p(s,"id",o),d&1&&r!==(r=c[0].min||0)&&p(s,"min",r),d&1&&a!==(a=c[0].max||"")&&s.value!==a&&(s.value=a)},d(c){c&&(y(e),y(l),y(s)),u=!1,f()}}}function AE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Bcrypt cost"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),p(s,"placeholder","Default to 10"),p(s,"step","1"),p(s,"min","6"),p(s,"max","31"),s.value=r=n[0].cost||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[5]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(s,"id",o),c&1&&r!==(r=f[0].cost||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function PE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Validation pattern"),l=C(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","text"),p(s,"id",o=n[12]),p(s,"placeholder","ex. ^\\w+$")},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].pattern),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(s,"id",o),f&1&&s.value!==u[0].pattern&&he(s,u[0].pattern)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function NE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[IE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[LE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[AE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[PE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&12289&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g&2&&(k.name="fields."+h[1]+".max"),g&12289&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g&2&&(S.name="fields."+h[1]+".cost"),g&12289&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const $={};g&2&&($.name="fields."+h[1]+".pattern"),g&12289&&($.$$scope={dirty:g,ctx:h}),d.$set($)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&y(e),H(i),H(o),H(u),H(d)}}}function RE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[NE]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function FE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.cost=11,s)}const a=_=>t(0,s.min=_.target.value<<0,s),u=_=>t(0,s.max=_.target.value<<0,s),f=_=>t(0,s.cost=_.target.value<<0,s);function c(){s.pattern=this.value,t(0,s)}function d(_){s=_,t(0,s)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Wt(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,g]}class qE extends Se{constructor(e){super(),we(this,e,FE,RE,ke,{field:0,key:1})}}function HE(n){let e,t,i,l,s;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=W(i,"click",n[14]),l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,s()}}}function jE(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[HE]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].collectionId,$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function zE(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UE(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[jE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[zE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(r,c,d),v(c,a,d),v(c,u,d),f=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(y(e),y(t),y(l),y(s),y(o),y(a),y(u)),H(i,c),H(r,c)}}}function ah(n){let e,t,i,l,s,o;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[VE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[BE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),j(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){v(r,e,a),q(t,e,null),v(r,i,a),v(r,l,a),q(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="fields."+r[1]+".minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="fields."+r[1]+".maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(t.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(y(e),y(i),y(l)),H(t),H(s)}}}function VE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Min select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","0"),p(s,"placeholder","No min limit"),s.value=r=n[0].minSelect||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[11]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function BE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","Default to single"),p(s,"min",r=n[0].minSelect||1)},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),he(s,n[0].maxSelect),a||(u=W(s,"input",n[12]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].minSelect||1)&&p(s,"min",r),c&1&>(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function WE(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(g){n[13](g)}let h={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(h.keyOfSelected=n[0].cascadeDelete),a=new zn({props:h}),ie.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),l=b("i"),r=C(),j(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(g,_){var k,S;v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,r,_),q(a,g,_),f=!0,c||(d=Oe(s=qe.call(null,l,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` `),position:"top"})),c=!0)},p(g,_){var S,$;s&&It(s.update)&&_&20&&s.update.call(null,{text:[`Whether on ${((S=g[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,g[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=g[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!f||_&16777216&&o!==(o=g[24]))&&p(e,"for",o);const k={};_&16777216&&(k.id=g[24]),!u&&_&1&&(u=!0,k.keyOfSelected=g[0].cascadeDelete,$e(()=>u=!1)),a.$set(k)},i(g){f||(O(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(y(e),y(r)),H(a,g),c=!1,d()}}}function YE(n){let e,t,i,l,s,o=!n[2]&&ah(n);return l=new fe({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[WE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),j(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){v(r,e,a),o&&o.m(e,null),w(e,t),w(e,i),q(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),D(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&O(o,1)):(o=ah(r),o.c(),O(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(O(o),O(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&y(e),o&&o.d(),H(l)}}}function KE(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[YE],default:[UE,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;fbe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new lf({props:u}),n[21](l),l.$on("save",n[22]),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment)},m(f,c){q(e,f,c),v(f,i,c),q(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Rt(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],$e(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(O(e.$$.fragment,f),O(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&y(i),H(e,f),n[21](null),H(l,f)}}}function JE(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,Mn,R=>t(10,r=R));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=a.maxSelect<=1,h=m;function g(){t(0,a.maxSelect=1,a),t(0,a.collectionId=null,a),t(0,a.cascadeDelete=!1,a),t(2,m=!0),t(9,h=m)}const _=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const $=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function M(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Pe.call(this,n,R)}function I(R){Pe.call(this,n,R)}function A(R){Pe.call(this,n,R)}function P(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const N=R=>{var z,F;(F=(z=R==null?void 0:R.detail)==null?void 0:z.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=je(je({},e),Wt(R)),t(8,o=lt(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&g(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,k,S,$,T,M,E,L,I,A,P,N]}class ZE extends Se{constructor(e){super(),we(this,e,JE,KE,ke,{field:0,key:1})}}function GE(n){let e,t,i,l,s,o;function r(u){n[7](u)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].values!==void 0&&(a.value=n[0].values),t=new ms({props:a}),ie.push(()=>be(t,"value",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Oe(qe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(u,f){const c={};f&16384&&(c.id=u[14]),f&32768&&(c.readonly=!u[15]),!i&&f&1&&(i=!0,c.value=u[0].values,$e(()=>i=!1)),t.$set(c)},i(u){l||(O(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&y(e),H(t),s=!1,o()}}}function XE(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QE(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".values",$$slots:{default:[GE,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[XE,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(r,c,d),v(c,a,d),v(c,u,d),f=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(O(i.$$.fragment,c),O(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(y(e),y(t),y(l),y(s),y(o),y(a),y(u)),H(i,c),H(r,c)}}}function uh(n){let e,t;return e=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[xE,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),p(s,"max",r=n[0].values.length),p(s,"placeholder","Default to single")},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),he(s,n[0].maxSelect),a||(u=W(s,"input",n[6]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(s,"id",o),c&1&&r!==(r=f[0].values.length)&&p(s,"max",r),c&1&>(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function eD(n){let e,t,i=!n[2]&&uh(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,s){l[2]?i&&(re(),D(i,1,1,()=>{i=null}),ae()):i?(i.p(l,s),s&4&&O(i,1)):(i=uh(l),i.c(),O(i,1),i.m(e.parentNode,e))},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&y(e),i&&i.d(l)}}}function tD(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[eD],default:[QE,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function nD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=s.maxSelect<=1,u=a;function f(){t(0,s.maxSelect=1,s),t(0,s.values=[],s),t(2,a=!0),t(5,u=a)}function c(){s.maxSelect=gt(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.values,S)&&(s.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function h(S){s=S,t(0,s),t(5,u),t(2,a)}function g(S){Pe.call(this,n,S)}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return n.$$set=S=>{e=je(je({},e),Wt(S)),t(4,l=lt(e,i)),"field"in S&&t(0,s=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,s.maxSelect=1,s):t(0,s.maxSelect=((S=s.values)==null?void 0:S.length)||2,s)),n.$$.dirty&1&&typeof s.maxSelect>"u"&&f()},[s,o,a,r,l,u,c,d,m,h,g,_,k]}class iD extends Se{constructor(e){super(),we(this,e,nD,tD,ke,{field:0,key:1})}}function lD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=b("span"),t.textContent="Min length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"min","0"),p(r,"placeholder","No min limit"),r.value=u=n[0].min||""},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),v(d,r,m),f||(c=[Oe(qe.call(null,l,"Clear the field or set it to 0 for no limit.")),W(r,"input",n[3])],f=!0)},p(d,m){m&2048&&s!==(s=d[11])&&p(e,"for",s),m&2048&&a!==(a=d[11])&&p(r,"id",a),m&1&&u!==(u=d[0].min||"")&&r.value!==u&&(r.value=u)},d(d){d&&(y(e),y(o),y(r)),f=!1,Ie(c)}}}function sD(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("span"),t.textContent="Max length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"placeholder","Default to max 5000 characters"),p(r,"min",u=n[0].min||0),r.value=f=n[0].max||""},m(m,h){v(m,e,h),w(e,t),w(e,i),w(e,l),v(m,o,h),v(m,r,h),c||(d=[Oe(qe.call(null,l,"Clear the field or set it to 0 to fallback to the default limit.")),W(r,"input",n[4])],c=!0)},p(m,h){h&2048&&s!==(s=m[11])&&p(e,"for",s),h&2048&&a!==(a=m[11])&&p(r,"id",a),h&1&&u!==(u=m[0].min||0)&&p(r,"min",u),h&1&&f!==(f=m[0].max||"")&&r.value!==f&&(r.value=f)},d(m){m&&(y(e),y(o),y(r)),c=!1,Ie(d)}}}function oD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=B("Validation pattern"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("p"),f=B("Ex. "),c=b("code"),c.textContent="^[a-z0-9]+$",p(e,"for",i=n[11]),p(s,"type","text"),p(s,"id",o=n[11]),p(a,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[0].pattern),v(h,r,g),v(h,a,g),w(a,u),w(u,f),w(u,c),d||(m=W(s,"input",n[5]),d=!0)},p(h,g){g&2048&&i!==(i=h[11])&&p(e,"for",i),g&2048&&o!==(o=h[11])&&p(s,"id",o),g&1&&s.value!==h[0].pattern&&he(s,h[0].pattern)},d(h){h&&(y(e),y(l),y(s),y(r),y(a)),d=!1,m()}}}function rD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return{c(){e=b("label"),t=b("span"),t.textContent="Autogenerate pattern",i=C(),l=b("i"),o=C(),r=b("input"),u=C(),f=b("div"),c=b("p"),d=B("Ex. "),m=b("code"),m.textContent="[a-z0-9]{30}",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","text"),p(r,"id",a=n[11]),p(f,"class","help-block")},m(_,k){v(_,e,k),w(e,t),w(e,i),w(e,l),v(_,o,k),v(_,r,k),he(r,n[0].autogeneratePattern),v(_,u,k),v(_,f,k),w(f,c),w(c,d),w(c,m),h||(g=[Oe(qe.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),W(r,"input",n[6])],h=!0)},p(_,k){k&2048&&s!==(s=_[11])&&p(e,"for",s),k&2048&&a!==(a=_[11])&&p(r,"id",a),k&1&&r.value!==_[0].autogeneratePattern&&he(r,_[0].autogeneratePattern)},d(_){_&&(y(e),y(o),y(r),y(u),y(f)),h=!1,Ie(g)}}}function aD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[lD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[sD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[oD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[rD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&6145&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g&2&&(k.name="fields."+h[1]+".max"),g&6145&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g&2&&(S.name="fields."+h[1]+".pattern"),g&6145&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const $={};g&2&&($.name="fields."+h[1]+".pattern"),g&6145&&($.$$scope={dirty:g,ctx:h}),d.$set($)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),O(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&y(e),H(i),H(o),H(u),H(d)}}}function uD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[aD]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function fD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=g=>t(0,s.min=g.target.value<<0,s),a=g=>t(0,s.max=g.target.value<<0,s);function u(){s.pattern=this.value,t(0,s)}function f(){s.autogeneratePattern=this.value,t(0,s)}function c(g){s=g,t(0,s)}function d(g){Pe.call(this,n,g)}function m(g){Pe.call(this,n,g)}function h(g){Pe.call(this,n,g)}return n.$$set=g=>{e=je(je({},e),Wt(g)),t(2,l=lt(e,i)),"field"in g&&t(0,s=g.field),"key"in g&&t(1,o=g.key)},[s,o,l,r,a,u,f,c,d,m,h]}class cD extends Se{constructor(e){super(),we(this,e,fD,uD,ke,{field:0,key:1})}}function dD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function pD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class mD extends Se{constructor(e){super(),we(this,e,pD,dD,ke,{field:0,key:1})}}function fh(n,e,t){const i=n.slice();return i[24]=e[t],i[25]=e,i[26]=t,i}function hD(n){let e,t,i,l;function s(f){n[8](f,n[24],n[25],n[26])}function o(){return n[9](n[26])}function r(){return n[10](n[26])}var a=n[1][n[24].type];function u(f,c){let d={key:f[5](f[24]),collection:f[0]};return f[24]!==void 0&&(d.field=f[24]),{props:d}}return a&&(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&j(e.$$.fragment),i=C()},m(f,c){e&&q(e,f,c),v(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[24].type])){if(e){re();const d=e;D(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}a?(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),j(e.$$.fragment),O(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[24])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[24],$e(()=>t=!1)),e.$set(d)}},i(f){l||(e&&O(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&y(i),e&&H(e,f)}}}function ch(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[26],disabled:e[24]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[hD]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[26]),u&1&&(f.disabled=e[24]._toDelete),u&134217729&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function _D(n){let e,t=[],i=new Map,l,s,o,r,a,u,f,c,d,m=de(n[0].fields);const h=k=>k[24];for(let k=0;kbe(f,"collection",g)),{c(){e=b("div");for(let k=0;kc=!1)),f.$set($)},i(k){if(!d){for(let S=0;St(18,l=N));let{collection:s}=e,o;const r={text:cD,number:DE,bool:CM,email:yy,url:mD,editor:JM,date:UM,select:iD,json:wE,file:hE,relation:ZE,password:qE,autodate:SM};function a(N){s.fields[N]&&(s.fields.splice(N,1),t(0,s))}function u(N){const R=s.fields[N];if(!R)return;R.onMountSelect=!1;const z=structuredClone(R);z.id="",z.system=!1,z.name=c(z.name+"_copy"),z.onMountSelect=!0,s.fields.splice(N+1,0,z),t(0,s)}function f(N="text"){const R=V.initSchemaField({name:c(),type:N});R.onMountSelect=!0;const z=s.fields.findLastIndex(F=>F.type!="autodate");R.type!="autodate"&&z>=0?s.fields.splice(z+1,0,R):s.fields.push(R),t(0,s)}function c(N="field"){var J;let R=N,z=2,F=((J=N.match(/\d+$/))==null?void 0:J[0])||"",U=F?N.substring(0,N.length-F.length):N;for(;d(R);)R=U+((F<<0)+z),z++;return R}function d(N){var R;return!!((R=s==null?void 0:s.fields)!=null&&R.find(z=>z.name===N))}function m(N){return i.findIndex(R=>R===N)}function h(N,R){var z,F;!((z=s==null?void 0:s.fields)!=null&&z.length)||N===R||!R||(F=s==null?void 0:s.fields)!=null&&F.find(U=>U.name==N&&!U._toDelete)||t(0,s.indexes=s.indexes.map(U=>V.replaceIndexColumn(U,N,R)),s)}function g(){const N=s.fields||[],R=N.filter(F=>!F.system),z=structuredClone(l[s.type]);t(0,s.fields=z.fields,s);for(let F of N){if(!F.system)continue;const U=s.fields.findIndex(J=>J.name==F.name);U<0||t(0,s.fields[U]=Object.assign(s.fields[U],F),s)}for(let F of R)s.fields.push(F)}function _(N,R){var F;if(N===R||!R)return;let z=((F=s.passwordAuth)==null?void 0:F.identityFields)||[];for(let U=0;Ua(N),T=N=>u(N),M=N=>k(N.detail.oldName,N.detail.newName);function E(N){n.$$.not_equal(s.fields,N)&&(s.fields=N,t(0,s))}const L=N=>{if(!N.detail)return;const R=N.detail.target;R.style.opacity=0,setTimeout(()=>{var z;(z=R==null?void 0:R.style)==null||z.removeProperty("opacity")},0),N.detail.dataTransfer.setDragImage(R,0,0)},I=()=>{Ut({})},A=N=>f(N.detail);function P(N){s=N,t(0,s)}return n.$$set=N=>{"collection"in N&&t(0,s=N.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.fields>"u"&&t(0,s.fields=[],s),n.$$.dirty&129&&!s.id&&o!=s.type&&(t(7,o=s.type),g()),n.$$.dirty&1&&(i=s.fields.filter(N=>!N._toDelete))},[s,r,a,u,f,m,k,o,S,$,T,M,E,L,I,A,P]}class bD extends Se{constructor(e){super(),we(this,e,gD,_D,ke,{collection:0})}}function dh(n,e,t){const i=n.slice();return i[9]=e[t],i}function kD(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].viewQuery!==void 0&&(f.value=a[0].viewQuery),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("change",a[6]),j(e.$$.fragment),O(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].viewQuery,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&O(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function yD(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function ph(n){let e,t,i=de(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. +`),position:"top"}),(!f||_&16777216&&o!==(o=g[24]))&&p(e,"for",o);const k={};_&16777216&&(k.id=g[24]),!u&&_&1&&(u=!0,k.keyOfSelected=g[0].cascadeDelete,$e(()=>u=!1)),a.$set(k)},i(g){f||(M(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(y(e),y(r)),H(a,g),c=!1,d()}}}function YE(n){let e,t,i,l,s,o=!n[2]&&ah(n);return l=new fe({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[WE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),j(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){v(r,e,a),o&&o.m(e,null),w(e,t),w(e,i),q(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),D(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&M(o,1)):(o=ah(r),o.c(),M(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(M(o),M(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&y(e),o&&o.d(),H(l)}}}function KE(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[YE],default:[UE,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;fbe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new lf({props:u}),n[21](l),l.$on("save",n[22]),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment)},m(f,c){q(e,f,c),v(f,i,c),q(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Rt(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],$e(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(M(e.$$.fragment,f),M(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&y(i),H(e,f),n[21](null),H(l,f)}}}function JE(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,Mn,R=>t(10,r=R));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=a.maxSelect<=1,h=m;function g(){t(0,a.maxSelect=1,a),t(0,a.collectionId=null,a),t(0,a.cascadeDelete=!1,a),t(2,m=!0),t(9,h=m)}const _=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const $=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Pe.call(this,n,R)}function I(R){Pe.call(this,n,R)}function A(R){Pe.call(this,n,R)}function P(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const N=R=>{var z,F;(F=(z=R==null?void 0:R.detail)==null?void 0:z.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=je(je({},e),Wt(R)),t(8,o=lt(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&g(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,k,S,$,T,O,E,L,I,A,P,N]}class ZE extends Se{constructor(e){super(),we(this,e,JE,KE,ke,{field:0,key:1})}}function GE(n){let e,t,i,l,s,o;function r(u){n[7](u)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].values!==void 0&&(a.value=n[0].values),t=new ms({props:a}),ie.push(()=>be(t,"value",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Oe(qe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(u,f){const c={};f&16384&&(c.id=u[14]),f&32768&&(c.readonly=!u[15]),!i&&f&1&&(i=!0,c.value=u[0].values,$e(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&y(e),H(t),s=!1,o()}}}function XE(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QE(n){let e,t,i,l,s,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".values",$$slots:{default:[GE,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[XE,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),o=C(),j(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){v(c,e,d),v(c,t,d),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(r,c,d),v(c,a,d),v(c,u,d),f=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(y(e),y(t),y(l),y(s),y(o),y(a),y(u)),H(i,c),H(r,c)}}}function uh(n){let e,t;return e=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[xE,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),l=C(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),p(s,"max",r=n[0].values.length),p(s,"placeholder","Default to single")},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),he(s,n[0].maxSelect),a||(u=W(s,"input",n[6]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(s,"id",o),c&1&&r!==(r=f[0].values.length)&&p(s,"max",r),c&1&>(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function eD(n){let e,t,i=!n[2]&&uh(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),v(l,e,s),t=!0},p(l,s){l[2]?i&&(re(),D(i,1,1,()=>{i=null}),ae()):i?(i.p(l,s),s&4&&M(i,1)):(i=uh(l),i.c(),M(i,1),i.m(e.parentNode,e))},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&y(e),i&&i.d(l)}}}function tD(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[eD],default:[QE,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function nD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=s.maxSelect<=1,u=a;function f(){t(0,s.maxSelect=1,s),t(0,s.values=[],s),t(2,a=!0),t(5,u=a)}function c(){s.maxSelect=gt(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.values,S)&&(s.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function h(S){s=S,t(0,s),t(5,u),t(2,a)}function g(S){Pe.call(this,n,S)}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return n.$$set=S=>{e=je(je({},e),Wt(S)),t(4,l=lt(e,i)),"field"in S&&t(0,s=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,s.maxSelect=1,s):t(0,s.maxSelect=((S=s.values)==null?void 0:S.length)||2,s)),n.$$.dirty&1&&typeof s.maxSelect>"u"&&f()},[s,o,a,r,l,u,c,d,m,h,g,_,k]}class iD extends Se{constructor(e){super(),we(this,e,nD,tD,ke,{field:0,key:1})}}function lD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=b("span"),t.textContent="Min length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"min","0"),p(r,"placeholder","No min limit"),r.value=u=n[0].min||""},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),v(d,r,m),f||(c=[Oe(qe.call(null,l,"Clear the field or set it to 0 for no limit.")),W(r,"input",n[3])],f=!0)},p(d,m){m&2048&&s!==(s=d[11])&&p(e,"for",s),m&2048&&a!==(a=d[11])&&p(r,"id",a),m&1&&u!==(u=d[0].min||"")&&r.value!==u&&(r.value=u)},d(d){d&&(y(e),y(o),y(r)),f=!1,Ie(c)}}}function sD(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("span"),t.textContent="Max length",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","number"),p(r,"id",a=n[11]),p(r,"step","1"),p(r,"placeholder","Default to max 5000 characters"),p(r,"min",u=n[0].min||0),r.value=f=n[0].max||""},m(m,h){v(m,e,h),w(e,t),w(e,i),w(e,l),v(m,o,h),v(m,r,h),c||(d=[Oe(qe.call(null,l,"Clear the field or set it to 0 to fallback to the default limit.")),W(r,"input",n[4])],c=!0)},p(m,h){h&2048&&s!==(s=m[11])&&p(e,"for",s),h&2048&&a!==(a=m[11])&&p(r,"id",a),h&1&&u!==(u=m[0].min||0)&&p(r,"min",u),h&1&&f!==(f=m[0].max||"")&&r.value!==f&&(r.value=f)},d(m){m&&(y(e),y(o),y(r)),c=!1,Ie(d)}}}function oD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=B("Validation pattern"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("p"),f=B("Ex. "),c=b("code"),c.textContent="^[a-z0-9]+$",p(e,"for",i=n[11]),p(s,"type","text"),p(s,"id",o=n[11]),p(a,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[0].pattern),v(h,r,g),v(h,a,g),w(a,u),w(u,f),w(u,c),d||(m=W(s,"input",n[5]),d=!0)},p(h,g){g&2048&&i!==(i=h[11])&&p(e,"for",i),g&2048&&o!==(o=h[11])&&p(s,"id",o),g&1&&s.value!==h[0].pattern&&he(s,h[0].pattern)},d(h){h&&(y(e),y(l),y(s),y(r),y(a)),d=!1,m()}}}function rD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return{c(){e=b("label"),t=b("span"),t.textContent="Autogenerate pattern",i=C(),l=b("i"),o=C(),r=b("input"),u=C(),f=b("div"),c=b("p"),d=B("Ex. "),m=b("code"),m.textContent="[a-z0-9]{30}",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","text"),p(r,"id",a=n[11]),p(f,"class","help-block")},m(_,k){v(_,e,k),w(e,t),w(e,i),w(e,l),v(_,o,k),v(_,r,k),he(r,n[0].autogeneratePattern),v(_,u,k),v(_,f,k),w(f,c),w(c,d),w(c,m),h||(g=[Oe(qe.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),W(r,"input",n[6])],h=!0)},p(_,k){k&2048&&s!==(s=_[11])&&p(e,"for",s),k&2048&&a!==(a=_[11])&&p(r,"id",a),k&1&&r.value!==_[0].autogeneratePattern&&he(r,_[0].autogeneratePattern)},d(_){_&&(y(e),y(o),y(r),y(u),y(f)),h=!1,Ie(g)}}}function aD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[lD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[sD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[oD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".autogeneratePattern",$$slots:{default:[rD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&6145&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g&2&&(k.name="fields."+h[1]+".max"),g&6145&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g&2&&(S.name="fields."+h[1]+".pattern"),g&6145&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const $={};g&2&&($.name="fields."+h[1]+".autogeneratePattern"),g&6145&&($.$$scope={dirty:g,ctx:h}),d.$set($)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&y(e),H(i),H(o),H(u),H(d)}}}function uD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[aD]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function fD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=g=>t(0,s.min=g.target.value<<0,s),a=g=>t(0,s.max=g.target.value<<0,s);function u(){s.pattern=this.value,t(0,s)}function f(){s.autogeneratePattern=this.value,t(0,s)}function c(g){s=g,t(0,s)}function d(g){Pe.call(this,n,g)}function m(g){Pe.call(this,n,g)}function h(g){Pe.call(this,n,g)}return n.$$set=g=>{e=je(je({},e),Wt(g)),t(2,l=lt(e,i)),"field"in g&&t(0,s=g.field),"key"in g&&t(1,o=g.key)},[s,o,l,r,a,u,f,c,d,m,h]}class cD extends Se{constructor(e){super(),we(this,e,fD,uD,ke,{field:0,key:1})}}function dD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function pD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class mD extends Se{constructor(e){super(),we(this,e,pD,dD,ke,{field:0,key:1})}}function fh(n,e,t){const i=n.slice();return i[24]=e[t],i[25]=e,i[26]=t,i}function hD(n){let e,t,i,l;function s(f){n[8](f,n[24],n[25],n[26])}function o(){return n[9](n[26])}function r(){return n[10](n[26])}var a=n[1][n[24].type];function u(f,c){let d={key:f[5](f[24]),collection:f[0]};return f[24]!==void 0&&(d.field=f[24]),{props:d}}return a&&(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&j(e.$$.fragment),i=C()},m(f,c){e&&q(e,f,c),v(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[24].type])){if(e){re();const d=e;D(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}a?(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[24])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[24],$e(()=>t=!1)),e.$set(d)}},i(f){l||(e&&M(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&y(i),e&&H(e,f)}}}function ch(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[26],disabled:e[24]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[hD]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[26]),u&1&&(f.disabled=e[24]._toDelete),u&134217729&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function _D(n){let e,t=[],i=new Map,l,s,o,r,a,u,f,c,d,m=de(n[0].fields);const h=k=>k[24];for(let k=0;kbe(f,"collection",g)),{c(){e=b("div");for(let k=0;kc=!1)),f.$set($)},i(k){if(!d){for(let S=0;St(18,l=N));let{collection:s}=e,o;const r={text:cD,number:DE,bool:CM,email:yy,url:mD,editor:JM,date:UM,select:iD,json:wE,file:hE,relation:ZE,password:qE,autodate:SM};function a(N){s.fields[N]&&(s.fields.splice(N,1),t(0,s))}function u(N){const R=s.fields[N];if(!R)return;R.onMountSelect=!1;const z=structuredClone(R);z.id="",z.system=!1,z.name=c(z.name+"_copy"),z.onMountSelect=!0,s.fields.splice(N+1,0,z),t(0,s)}function f(N="text"){const R=V.initSchemaField({name:c(),type:N});R.onMountSelect=!0;const z=s.fields.findLastIndex(F=>F.type!="autodate");R.type!="autodate"&&z>=0?s.fields.splice(z+1,0,R):s.fields.push(R),t(0,s)}function c(N="field"){var J;let R=N,z=2,F=((J=N.match(/\d+$/))==null?void 0:J[0])||"",U=F?N.substring(0,N.length-F.length):N;for(;d(R);)R=U+((F<<0)+z),z++;return R}function d(N){var R;return!!((R=s==null?void 0:s.fields)!=null&&R.find(z=>z.name===N))}function m(N){return i.findIndex(R=>R===N)}function h(N,R){var z,F;!((z=s==null?void 0:s.fields)!=null&&z.length)||N===R||!R||(F=s==null?void 0:s.fields)!=null&&F.find(U=>U.name==N&&!U._toDelete)||t(0,s.indexes=s.indexes.map(U=>V.replaceIndexColumn(U,N,R)),s)}function g(){const N=s.fields||[],R=N.filter(F=>!F.system),z=structuredClone(l[s.type]);t(0,s.fields=z.fields,s);for(let F of N){if(!F.system)continue;const U=s.fields.findIndex(J=>J.name==F.name);U<0||t(0,s.fields[U]=Object.assign(s.fields[U],F),s)}for(let F of R)s.fields.push(F)}function _(N,R){var F;if(N===R||!R)return;let z=((F=s.passwordAuth)==null?void 0:F.identityFields)||[];for(let U=0;Ua(N),T=N=>u(N),O=N=>k(N.detail.oldName,N.detail.newName);function E(N){n.$$.not_equal(s.fields,N)&&(s.fields=N,t(0,s))}const L=N=>{if(!N.detail)return;const R=N.detail.target;R.style.opacity=0,setTimeout(()=>{var z;(z=R==null?void 0:R.style)==null||z.removeProperty("opacity")},0),N.detail.dataTransfer.setDragImage(R,0,0)},I=()=>{Ut({})},A=N=>f(N.detail);function P(N){s=N,t(0,s)}return n.$$set=N=>{"collection"in N&&t(0,s=N.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.fields>"u"&&t(0,s.fields=[],s),n.$$.dirty&129&&!s.id&&o!=s.type&&(t(7,o=s.type),g()),n.$$.dirty&1&&(i=s.fields.filter(N=>!N._toDelete))},[s,r,a,u,f,m,k,o,S,$,T,O,E,L,I,A,P]}class bD extends Se{constructor(e){super(),we(this,e,gD,_D,ke,{collection:0})}}function dh(n,e,t){const i=n.slice();return i[9]=e[t],i}function kD(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].viewQuery!==void 0&&(f.value=a[0].viewQuery),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("change",a[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].viewQuery,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function yD(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function ph(n){let e,t,i=de(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name, e.g. MAX(balance) as maxBalance.
  • Combined/multi-spaced expressions must be wrapped in parenthesis, e.g. - (MAX(balance) + 1) as maxBalance.
  • `,u=C(),g&&g.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){v(_,e,k),w(e,t),v(_,l,k),m[s].m(_,k),v(_,r,k),v(_,a,k),v(_,u,k),g&&g.m(_,k),v(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,k):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),O(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,k):(g=ph(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(O(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(y(e),y(l),y(r),y(a),y(u),y(f)),m[s].d(_),g&&g.d(_)}}}function wD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[vD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SD(n,e,t){let i;Qe(n,yn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=V.getNestedVal(c,"fields",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery(l==null?void 0:l.viewQuery);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,k=m[h]||h;r.push(V.sentenize(k+": "+_))}}Xt(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-7pyapRXP.js");return{default:c}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&Yn("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class TD extends Se{constructor(e){super(),we(this,e,SD,wD,ke,{collection:0})}}function hh(n,e,t){const i=n.slice();return i[15]=e[t],i}function _h(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A=de(n[4]),P=[];for(let N=0;N@request

    Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth methods (otp, identity/password, oauth2) before issuing an auth token. - (Learn more) .

    filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the - @collection filter:`,k=C(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=C(),T=b("hr"),M=C(),E=b("p"),E.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(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"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(N,R){v(N,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let z=0;z{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&y(e),dt(P,N),N&&L&&L.end()}}}function gh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=B(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[15]+"")&&oe(i,t)},d(l){l&&y(e)}}}function bh(n){let e=!n[3].includes(n[15]),t,i=e&&gh(n);return{c(){i&&i.c(),t=ye()},m(l,s){i&&i.m(l,s),v(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[15])),e?i?i.p(l,s):(i=gh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&y(t),i&&i.d(l)}}}function kh(n){let e,t,i,l,s,o,r,a,u;function f(_){n[8](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[$D,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new il({props:c}),ie.push(()=>be(e,"rule",f));function d(_){n[9](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new il({props:m}),ie.push(()=>be(l,"rule",d));function h(_){n[10](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new il({props:g}),ie.push(()=>be(r,"rule",h)),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment),o=C(),j(r.$$.fragment)},m(_,k){q(e,_,k),v(_,i,k),q(l,_,k),v(_,o,k),q(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&278528&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,$e(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,$e(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,$e(()=>a=!1)),r.$set(T)},i(_){u||(O(e.$$.fragment,_),O(l.$$.fragment,_),O(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(y(i),y(o)),H(e,_),H(l,_),H(r,_)}}}function yh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function $D(n){let e,t=!n[14]&&yh();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[14]?t&&(t.d(1),t=null):t||(t=yh(),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function vh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,k){return _[2]?OD:CD}let m=d(n),h=m(n),g=n[2]&&wh(n);return{c(){e=b("hr"),t=C(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=C(),h.c(),r=C(),g&&g.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm m-b-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){v(_,e,k),v(_,t,k),v(_,i,k),w(i,l),w(i,s),h.m(i,null),v(_,r,k),g&&g.m(_,k),v(_,a,k),u=!0,f||(c=W(i,"click",n[11]),f=!0)},p(_,k){m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?(g.p(_,k),k&4&&O(g,1)):(g=wh(_),g.c(),O(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(O(g),u=!0)},o(_){D(g),u=!1},d(_){_&&(y(e),y(t),y(i),y(r),y(a)),h.d(),g&&g.d(_),f=!1,c()}}}function CD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function OD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function wh(n){let e,t,i,l,s,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[MD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new il({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[ED]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new il({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),j(t.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","block")},m(m,h){v(m,e,h),q(t,e,null),w(e,l),q(s,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,$e(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,$e(()=>o=!1)),s.$set(_)},i(m){a||(O(t.$$.fragment,m),O(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=He(e,mt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=He(e,mt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&y(e),H(t),H(s),m&&r&&r.end()}}}function MD(n){let e,t,i,l,s,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who + (MAX(balance) + 1) as maxBalance.`,u=C(),g&&g.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){v(_,e,k),w(e,t),v(_,l,k),m[s].m(_,k),v(_,r,k),v(_,a,k),v(_,u,k),g&&g.m(_,k),v(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,k):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,k):(g=ph(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(M(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(y(e),y(l),y(r),y(a),y(u),y(f)),m[s].d(_),g&&g.d(_)}}}function wD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[vD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SD(n,e,t){let i;Qe(n,yn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=V.getNestedVal(c,"fields",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery(l==null?void 0:l.viewQuery);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,k=m[h]||h;r.push(V.sentenize(k+": "+_))}}Xt(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-Bfa8qogr.js");return{default:c}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&Yn("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class TD extends Se{constructor(e){super(),we(this,e,SD,wD,ke,{collection:0})}}function hh(n,e,t){const i=n.slice();return i[15]=e[t],i}function _h(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A=de(n[4]),P=[];for(let N=0;N@request filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the + @collection filter:`,k=C(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=C(),T=b("hr"),O=C(),E=b("p"),E.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(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"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(N,R){v(N,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let z=0;z{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&y(e),dt(P,N),N&&L&&L.end()}}}function gh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=B(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[15]+"")&&oe(i,t)},d(l){l&&y(e)}}}function bh(n){let e=!n[3].includes(n[15]),t,i=e&&gh(n);return{c(){i&&i.c(),t=ye()},m(l,s){i&&i.m(l,s),v(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[15])),e?i?i.p(l,s):(i=gh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&y(t),i&&i.d(l)}}}function kh(n){let e,t,i,l,s,o,r,a,u;function f(_){n[8](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[$D,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new il({props:c}),ie.push(()=>be(e,"rule",f));function d(_){n[9](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new il({props:m}),ie.push(()=>be(l,"rule",d));function h(_){n[10](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new il({props:g}),ie.push(()=>be(r,"rule",h)),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment),o=C(),j(r.$$.fragment)},m(_,k){q(e,_,k),v(_,i,k),q(l,_,k),v(_,o,k),q(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&278528&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,$e(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,$e(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,$e(()=>a=!1)),r.$set(T)},i(_){u||(M(e.$$.fragment,_),M(l.$$.fragment,_),M(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(y(i),y(o)),H(e,_),H(l,_),H(r,_)}}}function yh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function $D(n){let e,t=!n[14]&&yh();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[14]?t&&(t.d(1),t=null):t||(t=yh(),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function vh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,k){return _[2]?OD:CD}let m=d(n),h=m(n),g=n[2]&&wh(n);return{c(){e=b("hr"),t=C(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=C(),h.c(),r=C(),g&&g.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm m-b-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){v(_,e,k),v(_,t,k),v(_,i,k),w(i,l),w(i,s),h.m(i,null),v(_,r,k),g&&g.m(_,k),v(_,a,k),u=!0,f||(c=W(i,"click",n[11]),f=!0)},p(_,k){m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?(g.p(_,k),k&4&&M(g,1)):(g=wh(_),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(g),u=!0)},o(_){D(g),u=!1},d(_){_&&(y(e),y(t),y(i),y(r),y(a)),h.d(),g&&g.d(_),f=!1,c()}}}function CD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function OD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function wh(n){let e,t,i,l,s,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[MD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new il({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[ED]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new il({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),j(t.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","block")},m(m,h){v(m,e,h),q(t,e,null),w(e,l),q(s,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,$e(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,$e(()=>o=!1)),s.$set(_)},i(m){a||(M(t.$$.fragment,m),M(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=He(e,mt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=He(e,mt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&y(e),H(t),H(s),m&&r&&r.end()}}}function MD(n){let e,t,i,l,s,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who can authenticate.`,t=C(),i=b("p"),i.innerHTML=`For example, to allow only verified users you can set it to verified = true.`,l=C(),s=b("p"),s.textContent="Leave it empty to allow anyone with an account to authenticate.",o=C(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),v(a,o,u),v(a,r,u)},p:te,d(a){a&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r))}}}function ED(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the create and update API rules.`,t=C(),i=b("p"),i.textContent=`It enables superuser-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the - verified state or email, etc.`},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,d(l){l&&(y(e),y(t),y(i))}}}function DD(n){var R,z;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,k,S,$,T,M=n[1]&&_h(n);function E(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new il({props:L}),ie.push(()=>be(f,"rule",E));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new il({props:A}),ie.push(()=>be(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&kh(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&vh(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the + verified state or email, etc.`},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,d(l){l&&(y(e),y(t),y(i))}}}function DD(n){var R,z;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,k,S,$,T,O=n[1]&&_h(n);function E(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new il({props:L}),ie.push(()=>be(f,"rule",E));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new il({props:A}),ie.push(()=>be(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&kh(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&vh(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the PocketBase filter syntax and operators - .`,l=C(),s=b("button"),r=B(o),a=C(),M&&M.c(),u=C(),j(f.$$.fragment),d=C(),j(m.$$.fragment),g=C(),P&&P.c(),_=C(),N&&N.c(),k=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(F,U){v(F,e,U),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),M&&M.m(e,null),v(F,u,U),q(f,F,U),v(F,d,U),q(m,F,U),v(F,g,U),P&&P.m(F,U),v(F,_,U),N&&N.m(F,U),v(F,k,U),S=!0,$||(T=W(s,"click",n[5]),$=!0)},p(F,[U]){var Z,G;(!S||U&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&oe(r,o),F[1]?M?(M.p(F,U),U&2&&O(M,1)):(M=_h(F),M.c(),O(M,1),M.m(e,null)):M&&(re(),D(M,1,1,()=>{M=null}),ae());const J={};U&1&&(J.collection=F[0]),!c&&U&1&&(c=!0,J.rule=F[0].listRule,$e(()=>c=!1)),f.$set(J);const Y={};U&1&&(Y.collection=F[0]),!h&&U&1&&(h=!0,Y.rule=F[0].viewRule,$e(()=>h=!1)),m.$set(Y),((Z=F[0])==null?void 0:Z.type)!=="view"?P?(P.p(F,U),U&1&&O(P,1)):(P=kh(F),P.c(),O(P,1),P.m(_.parentNode,_)):P&&(re(),D(P,1,1,()=>{P=null}),ae()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,U),U&1&&O(N,1)):(N=vh(F),N.c(),O(N,1),N.m(k.parentNode,k)):N&&(re(),D(N,1,1,()=>{N=null}),ae())},i(F){S||(O(M),O(f.$$.fragment,F),O(m.$$.fragment,F),O(P),O(N),S=!0)},o(F){D(M),D(f.$$.fragment,F),D(m.$$.fragment,F),D(P),D(N),S=!1},d(F){F&&(y(e),y(u),y(d),y(g),y(_),y(k)),M&&M.d(),H(f,F),H(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function ID(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(s.listRule,k)&&(s.listRule=k,t(0,s))}function f(k){n.$$.not_equal(s.viewRule,k)&&(s.viewRule=k,t(0,s))}function c(k){n.$$.not_equal(s.createRule,k)&&(s.createRule=k,t(0,s))}function d(k){n.$$.not_equal(s.updateRule,k)&&(s.updateRule=k,t(0,s))}function m(k){n.$$.not_equal(s.deleteRule,k)&&(s.deleteRule=k,t(0,s))}const h=()=>{t(2,r=!r)};function g(k){n.$$.not_equal(s.authRule,k)&&(s.authRule=k,t(0,s))}function _(k){n.$$.not_equal(s.manageRule,k)&&(s.manageRule=k,t(0,s))}return n.$$set=k=>{"collection"in k&&t(0,s=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=V.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(k=s.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,g,_]}class LD extends Se{constructor(e){super(),we(this,e,ID,DD,ke,{collection:0})}}function Sh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Th(n,e,t){const i=n.slice();return i[30]=e[t],i}function $h(n,e,t){const i=n.slice();return i[33]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[33]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Mh(n){let e,t,i,l,s,o,r=n[9].length&&Eh();return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + .`,l=C(),s=b("button"),r=B(o),a=C(),O&&O.c(),u=C(),j(f.$$.fragment),d=C(),j(m.$$.fragment),g=C(),P&&P.c(),_=C(),N&&N.c(),k=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(F,U){v(F,e,U),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),O&&O.m(e,null),v(F,u,U),q(f,F,U),v(F,d,U),q(m,F,U),v(F,g,U),P&&P.m(F,U),v(F,_,U),N&&N.m(F,U),v(F,k,U),S=!0,$||(T=W(s,"click",n[5]),$=!0)},p(F,[U]){var Z,G;(!S||U&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&oe(r,o),F[1]?O?(O.p(F,U),U&2&&M(O,1)):(O=_h(F),O.c(),M(O,1),O.m(e,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae());const J={};U&1&&(J.collection=F[0]),!c&&U&1&&(c=!0,J.rule=F[0].listRule,$e(()=>c=!1)),f.$set(J);const Y={};U&1&&(Y.collection=F[0]),!h&&U&1&&(h=!0,Y.rule=F[0].viewRule,$e(()=>h=!1)),m.$set(Y),((Z=F[0])==null?void 0:Z.type)!=="view"?P?(P.p(F,U),U&1&&M(P,1)):(P=kh(F),P.c(),M(P,1),P.m(_.parentNode,_)):P&&(re(),D(P,1,1,()=>{P=null}),ae()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,U),U&1&&M(N,1)):(N=vh(F),N.c(),M(N,1),N.m(k.parentNode,k)):N&&(re(),D(N,1,1,()=>{N=null}),ae())},i(F){S||(M(O),M(f.$$.fragment,F),M(m.$$.fragment,F),M(P),M(N),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(P),D(N),S=!1},d(F){F&&(y(e),y(u),y(d),y(g),y(_),y(k)),O&&O.d(),H(f,F),H(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function ID(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(s.listRule,k)&&(s.listRule=k,t(0,s))}function f(k){n.$$.not_equal(s.viewRule,k)&&(s.viewRule=k,t(0,s))}function c(k){n.$$.not_equal(s.createRule,k)&&(s.createRule=k,t(0,s))}function d(k){n.$$.not_equal(s.updateRule,k)&&(s.updateRule=k,t(0,s))}function m(k){n.$$.not_equal(s.deleteRule,k)&&(s.deleteRule=k,t(0,s))}const h=()=>{t(2,r=!r)};function g(k){n.$$.not_equal(s.authRule,k)&&(s.authRule=k,t(0,s))}function _(k){n.$$.not_equal(s.manageRule,k)&&(s.manageRule=k,t(0,s))}return n.$$set=k=>{"collection"in k&&t(0,s=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=V.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(k=s.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,g,_]}class LD extends Se{constructor(e){super(),we(this,e,ID,DD,ke,{collection:0})}}function Sh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Th(n,e,t){const i=n.slice();return i[30]=e[t],i}function $h(n,e,t){const i=n.slice();return i[33]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[33]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Mh(n){let e,t,i,l,s,o,r=n[9].length&&Eh();return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, you'll have to update it manually!`,o=C(),r&&r.c(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),r&&r.m(l,null)},p(a,u){a[9].length?r||(r=Eh(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&y(e),r&&r.d()}}}function Eh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Dh(n){let e,t,i,l,s,o,r=n[5]&&Ih(n),a=!n[4]&&Lh(n),u=de(n[3]),f=[];for(let m=0;mCancel',t=C(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),e.focus(),l||(s=[W(e,"click",n[15]),W(i,"click",n[16])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function RD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[ND],header:[PD],default:[AD]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&4030|s[1]&512&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[17](null),H(e,l)}}}function FD(n,e,t){let i,l,s,o,r,a,u;const f=kt();let c,d,m,h,g=[],_=[];async function k(F,U,J=!0){t(1,d=F),t(2,m=U),h=J,await M(),I(),await dn(),i||o.length||r.length||a.length||g.length||_.length?c==null||c.show():$()}function S(){c==null||c.hide()}function $(){S(),f("confirm",h)}const T=["oidc","oidc2","oidc3"];async function M(){var F,U,J,Y;t(7,g=[]);for(let Z of T){let G=(U=(F=d==null?void 0:d.oauth2)==null?void 0:F.providers)==null?void 0:U.find(Te=>Te.name==Z),pe=(Y=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:Y.find(Te=>Te.name==Z);if(!G||!pe)continue;let ce=new URL(G.authURL).host,ue=new URL(pe.authURL).host;ce!=ue&&await E(Z)&&g.push({name:Z,oldHost:ce,newHost:ue})}}async function E(F){try{return await _e.collection("_externalAuths").getFirstListItem(_e.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:m==null?void 0:m.id,provider:F})),!0}catch{}return!1}function L(F){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${m==null?void 0:m.id}%22+%26%26+provider%3D%22${F}%22`}function I(){if(t(3,_=[]),window.location.protocol!="https:")return;const F=["listRule","viewRule"];l||F.push("createRule","updateRule","deleteRule"),s&&F.push("manageRule","authRule");let U,J;for(let Y of F)U=d==null?void 0:d[Y],J=m==null?void 0:m[Y],U!==J&&_.push({prop:Y,oldRule:U,newRule:J})}const A=()=>S(),P=()=>$();function N(F){ie[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Pe.call(this,n,F)}function z(F){Pe.call(this,n,F)}return n.$$.update=()=>{var F,U,J;n.$$.dirty[0]&6&&t(5,i=(d==null?void 0:d.name)!=(m==null?void 0:m.name)),n.$$.dirty[0]&4&&t(4,l=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(s=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!l&&((F=m==null?void 0:m.fields)==null?void 0:F.filter(Y=>Y.id&&!Y._toDelete&&Y._originalName!=Y.name))||[]),n.$$.dirty[0]&20&&t(9,r=!l&&((U=m==null?void 0:m.fields)==null?void 0:U.filter(Y=>Y.id&&Y._toDelete))||[]),n.$$.dirty[0]&6&&t(8,a=((J=m==null?void 0:m.fields)==null?void 0:J.filter(Y=>{var G;const Z=(G=d==null?void 0:d.fields)==null?void 0:G.find(pe=>pe.id==Y.id);return Z?Z.maxSelect!=1&&Y.maxSelect==1:!1}))||[]),n.$$.dirty[0]&56&&t(11,u=!l||i||_.length)},[S,d,m,_,l,i,c,g,a,r,o,u,$,L,k,A,P,N,R,z]}class qD extends Se{constructor(e){super(),we(this,e,FD,RD,ke,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function qh(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function HD(n){let e,t,i;function l(o){n[44](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new bD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jD(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new TD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Hh(n){let e,t,i,l;function s(r){n[45](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new LD({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u)},i(r){l||(O(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&y(e),H(t)}}}function jh(n){let e,t,i,l;function s(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new HO({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&ee(e,"active",r[3]===rs)},i(r){l||(O(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&y(e),H(t)}}}function zD(n){let e,t,i,l,s,o,r;const a=[jD,HD],u=[];function f(m,h){return m[17]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[15]&&n[3]===no&&Hh(n),d=n[18]&&jh(n);return{c(){e=b("div"),t=b("div"),l.c(),s=C(),c&&c.c(),o=C(),d&&d.c(),p(t,"class","tab-item"),ee(t,"active",n[3]===xi),p(e,"class","tabs-content svelte-xyiw1b")},m(m,h){v(m,e,h),w(e,t),u[i].m(t,null),w(e,s),c&&c.m(e,null),w(e,o),d&&d.m(e,null),r=!0},p(m,h){let g=i;i=f(m),i===g?u[i].p(m,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),l=u[i],l?l.p(m,h):(l=u[i]=a[i](m),l.c()),O(l,1),l.m(t,null)),(!r||h[0]&8)&&ee(t,"active",m[3]===xi),!m[15]&&m[3]===no?c?(c.p(m,h),h[0]&32776&&O(c,1)):(c=Hh(m),c.c(),O(c,1),c.m(e,o)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),m[18]?d?(d.p(m,h),h[0]&262144&&O(d,1)):(d=jh(m),d.c(),O(d,1),d.m(e,null)):d&&(re(),D(d,1,1,()=>{d=null}),ae())},i(m){r||(O(l),O(c),O(d),r=!0)},o(m){D(l),D(c),D(d),r=!1},d(m){m&&y(e),u[i].d(),c&&c.d(),d&&d.d()}}}function zh(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[UD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&131076|u[2]&2&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(y(e),y(t),y(i)),H(o)}}}function Uh(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=C(),i=b("hr"),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=W(e,"click",n[34]),l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,s()}}}function Vh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Truncate',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Bh(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){v(l,e,s),t||(i=W(e,"click",On(nt(n[36]))),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function UD(n){let e,t,i,l=!n[2].system&&Uh(n),s=!n[17]&&Vh(n),o=!n[2].system&&Bh(n);return{c(){l&&l.c(),e=C(),s&&s.c(),t=C(),o&&o.c(),i=ye()},m(r,a){l&&l.m(r,a),v(r,e,a),s&&s.m(r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a)},p(r,a){r[2].system?l&&(l.d(1),l=null):l?l.p(r,a):(l=Uh(r),l.c(),l.m(e.parentNode,e)),r[17]?s&&(s.d(1),s=null):s?s.p(r,a):(s=Vh(r),s.c(),s.m(t.parentNode,t)),r[2].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=Bh(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),l&&l.d(r),s&&s.d(r),o&&o.d(r)}}}function Wh(n){let e,t,i,l;return i=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[VD]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),j(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){v(s,e,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(y(e),y(t)),H(i,s)}}}function Yh(n){let e,t,i,l,s,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),l=C(),s=b("span"),r=B(o),a=B(" collection"),u=C(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),ee(e,"selected",n[59]==n[2].type)},m(m,h){v(m,e,h),w(e,t),w(e,l),w(e,s),w(s,r),w(s,a),w(e,u),f||(c=W(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[60]+"")&&oe(r,o),h[0]&68&&ee(e,"selected",n[59]==n[2].type)},d(m){m&&y(e),f=!1,c()}}}function VD(n){let e,t=de(Object.entries(n[6])),i=[];for(let l=0;l{R=null}),ae()):R?(R.p(F,U),U[0]&4&&O(R,1)):(R=Wh(F),R.c(),O(R,1),R.m(d,null)),(!A||U[0]&4&&T!==(T=F[2].id?-1:0))&&p(d,"tabindex",T),(!A||U[0]&4&&M!==(M=F[2].id?"":"button"))&&p(d,"role",M),(!A||U[0]&4&&E!==(E="btn btn-sm p-r-10 p-l-10 "+(F[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",E),(!A||U[0]&4)&&ee(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=Kh(),z.c(),z.m(I.parentNode,I)):z&&(z.d(1),z=null)},i(F){A||(O(R),A=!0)},o(F){D(R),A=!1},d(F){F&&(y(e),y(l),y(s),y(f),y(c),y(L),y(I)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function Jh(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){v(r,e,a),l=!0,s||(o=Oe(t=qe.call(null,e,n[12])),s=!0)},p(r,a){t&&It(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,$t,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,$t,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&y(e),r&&i&&i.end(),s=!1,o()}}}function Zh(n){var a,u,f,c,d,m,h;let e,t,i,l=!V.isEmpty((a=n[5])==null?void 0:a.listRule)||!V.isEmpty((u=n[5])==null?void 0:u.viewRule)||!V.isEmpty((f=n[5])==null?void 0:f.createRule)||!V.isEmpty((c=n[5])==null?void 0:c.updateRule)||!V.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!V.isEmpty((m=n[5])==null?void 0:m.authRule)||!V.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Gh();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===no)},m(g,_){v(g,e,_),w(e,t),w(e,i),r&&r.m(e,null),s||(o=W(e,"click",n[41]),s=!0)},p(g,_){var k,S,$,T,M,E,L;_[0]&32&&(l=!V.isEmpty((k=g[5])==null?void 0:k.listRule)||!V.isEmpty((S=g[5])==null?void 0:S.viewRule)||!V.isEmpty(($=g[5])==null?void 0:$.createRule)||!V.isEmpty((T=g[5])==null?void 0:T.updateRule)||!V.isEmpty((M=g[5])==null?void 0:M.deleteRule)||!V.isEmpty((E=g[5])==null?void 0:E.authRule)||!V.isEmpty((L=g[5])==null?void 0:L.manageRule)),l?r?_[0]&32&&O(r,1):(r=Gh(),r.c(),O(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),_[0]&8&&ee(e,"active",g[3]===no)},d(g){g&&y(e),r&&r.d(),s=!1,o()}}}function Gh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function Xh(n){let e,t,i,l=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),s,o,r=l&&Qh();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(a,u){v(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=W(e,"click",n[42]),s=!0)},p(a,u){u[0]&8224&&(l=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),l?r?u[0]&8224&&O(r,1):(r=Qh(),r.c(),O(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u[0]&8&&ee(e,"active",a[3]===rs)},d(a){a&&y(e),r&&r.d(),s=!1,o()}}}function Qh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function WD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[17]?"Query":"Fields",g,_,k=!V.isEmpty(n[12]),S,$,T,M,E,L=!!n[2].id&&(!n[2].system||!n[17])&&zh(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[BD,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let I=k&&Jh(n),A=!n[15]&&Zh(n),P=n[18]&&Xh(n);return{c(){e=b("h4"),i=B(t),l=C(),L&&L.c(),s=C(),o=b("form"),j(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),g=B(h),_=C(),I&&I.c(),S=C(),A&&A.c(),$=C(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ee(d,"active",n[3]===xi),p(c,"class","tabs-header stretched")},m(N,R){v(N,e,R),w(e,i),v(N,l,R),L&&L.m(N,R),v(N,s,R),v(N,o,R),q(r,o,null),w(o,a),w(o,u),v(N,f,R),v(N,c,R),w(c,d),w(d,m),w(m,g),w(d,_),I&&I.m(d,null),w(c,S),A&&A.m(c,null),w(c,$),P&&P.m(c,null),T=!0,M||(E=[W(o,"submit",nt(n[39])),W(d,"click",n[40])],M=!0)},p(N,R){(!T||R[0]&4)&&t!==(t=N[2].id?"Edit collection":"New collection")&&oe(i,t),N[2].id&&(!N[2].system||!N[17])?L?(L.p(N,R),R[0]&131076&&O(L,1)):(L=zh(N),L.c(),O(L,1),L.m(s.parentNode,s)):L&&(re(),D(L,1,1,()=>{L=null}),ae());const z={};R[0]&327748|R[1]&134217728|R[2]&2&&(z.$$scope={dirty:R,ctx:N}),r.$set(z),(!T||R[0]&131072)&&h!==(h=N[17]?"Query":"Fields")&&oe(g,h),R[0]&4096&&(k=!V.isEmpty(N[12])),k?I?(I.p(N,R),R[0]&4096&&O(I,1)):(I=Jh(N),I.c(),O(I,1),I.m(d,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae()),(!T||R[0]&8)&&ee(d,"active",N[3]===xi),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=Zh(N),A.c(),A.m(c,$)),N[18]?P?P.p(N,R):(P=Xh(N),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(N){T||(O(L),O(r.$$.fragment,N),O(I),T=!0)},o(N){D(L),D(r.$$.fragment,N),D(I),T=!1},d(N){N&&(y(e),y(l),y(s),y(o),y(f),y(c)),L&&L.d(N),H(r),I&&I.d(),A&&A.d(),P&&P.d(),M=!1,Ie(E)}}}function xh(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[YD]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[14]||n[9]||n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&17920&&s!==(s=!r[14]||r[9]||r[10]))&&(e.disabled=s)},i(r){o||(O(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&y(e),H(l)}}}function YD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[33]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function KD(n){let e,t,i,l,s,o,r=n[2].id?"Save changes":"Create",a,u,f,c,d,m,h=n[2].id&&xh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("div"),s=b("button"),o=b("span"),a=B(r),f=C(),h&&h.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(s,"type","button"),p(s,"title","Save and close"),p(s,"class","btn"),s.disabled=u=!n[14]||n[9]||n[10],ee(s,"btn-expanded",!n[2].id),ee(s,"btn-expanded-sm",!!n[2].id),ee(s,"btn-loading",n[9]||n[10]),p(l,"class","btns-group no-gap")},m(g,_){v(g,e,_),w(e,t),v(g,i,_),v(g,l,_),w(l,s),w(s,o),w(o,a),w(l,f),h&&h.m(l,null),c=!0,d||(m=[W(e,"click",n[31]),W(s,"click",n[32])],d=!0)},p(g,_){(!c||_[0]&512)&&(e.disabled=g[9]),(!c||_[0]&4)&&r!==(r=g[2].id?"Save changes":"Create")&&oe(a,r),(!c||_[0]&17920&&u!==(u=!g[14]||g[9]||g[10]))&&(s.disabled=u),(!c||_[0]&4)&&ee(s,"btn-expanded",!g[2].id),(!c||_[0]&4)&&ee(s,"btn-expanded-sm",!!g[2].id),(!c||_[0]&1536)&&ee(s,"btn-loading",g[9]||g[10]),g[2].id?h?(h.p(g,_),_[0]&4&&O(h,1)):(h=xh(g),h.c(),O(h,1),h.m(l,null)):h&&(re(),D(h,1,1,()=>{h=null}),ae())},i(g){c||(O(h),c=!0)},o(g){D(h),c=!1},d(g){g&&(y(e),y(i),y(l)),h&&h.d(),d=!1,Ie(m)}}}function JD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[KD],header:[WD],default:[zD]},$$scope:{ctx:n}};e=new Qt({props:s}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new qD({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&2064&&(u.beforeHide=r[47]),a[0]&521836|a[2]&2&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&y(t),n[48](null),H(e,r),n[51](null),H(i,r)}}}const xi="schema",no="api_rules",rs="options",ZD="base",e_="auth",t_="view";function Aa(n){return JSON.stringify(n)}function GD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Du,Re=>t(30,u=Re)),Qe(n,ti,Re=>t(53,f=Re)),Qe(n,yn,Re=>t(5,c=Re));const d={};d[ZD]="Base",d[t_]="View",d[e_]="Auth";const m=kt();let h,g,_=null,k={},S=!1,$=!1,T=!1,M=xi,E=Aa(k),L="",I=[];function A(Re){t(3,M=Re)}function P(Re){return z(Re),t(11,T=!0),t(10,$=!1),t(9,S=!1),A(xi),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function R(){t(11,T=!1),N()}async function z(Re){Ut({}),typeof Re<"u"?(t(28,_=Re),t(2,k=structuredClone(Re))):(t(28,_=null),t(2,k=structuredClone(u.base)),k.fields.push({type:"autodate",name:"created",onCreate:!0}),k.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,k.fields=k.fields||[],k),t(2,k._originalName=k.name||"",k),await dn(),t(29,E=Aa(k))}async function F(Re=!0){if(!$){t(10,$=!0);try{k.id?await(g==null?void 0:g.show(_,k,Re)):await U(Re)}catch{}t(10,$=!1)}}function U(Re=!0){if(S)return;t(9,S=!0);const Ft=J(),Yt=!k.id;let vn;return Yt?vn=_e.collections.create(Ft):vn=_e.collections.update(k.id,Ft),vn.then(fn=>{Ls(),Ww(fn),Re?(t(11,T=!1),N()):z(fn),nn(k.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Yt,collection:fn}),Yt&&Rn(ti,f=fn,f)}).catch(fn=>{_e.error(fn)}).finally(()=>{t(9,S=!1)})}function J(){const Re=Object.assign({},k);Re.fields=Re.fields.slice(0);for(let Ft=Re.fields.length-1;Ft>=0;Ft--)Re.fields[Ft]._toDelete&&Re.fields.splice(Ft,1);return Re}function Y(){_!=null&&_.id&&_n(`Do you really want to delete all "${_.name}" records, including their cascade delete references and files?`,()=>_e.collections.truncate(_.id).then(()=>{R(),nn(`Successfully truncated collection "${_.name}".`),m("truncate")}).catch(Re=>{_e.error(Re)}))}function Z(){_!=null&&_.id&&_n(`Do you really want to delete collection "${_.name}" and all its records?`,()=>_e.collections.delete(_.id).then(()=>{R(),nn(`Successfully deleted collection "${_.name}".`),m("delete",_),Yw(_)}).catch(Re=>{_e.error(Re)}))}function G(Re){t(2,k.type=Re,k),t(2,k=Object.assign(structuredClone(u[Re]),k)),Yn("fields")}function pe(){r?_n("You have unsaved changes. Do you really want to discard them?",()=>{ce()}):ce()}async function ce(){const Re=_?structuredClone(_):null;if(Re){if(Re.id="",Re.created="",Re.updated="",Re.name+="_duplicate",!V.isEmpty(Re.fields))for(const Ft of Re.fields)Ft.id="";if(!V.isEmpty(Re.indexes))for(let Ft=0;FtN(),Ke=()=>F(),Je=()=>F(!1),ft=()=>pe(),et=()=>Y(),xe=()=>Z(),We=Re=>{t(2,k.name=V.slugify(Re.target.value),k),Re.target.value=k.name},at=Re=>G(Re),jt=()=>{a&&F()},Ve=()=>A(xi),Ee=()=>A(no),st=()=>A(rs);function De(Re){k=Re,t(2,k),t(28,_)}function Ye(Re){k=Re,t(2,k),t(28,_)}function ve(Re){k=Re,t(2,k),t(28,_)}function Ce(Re){k=Re,t(2,k),t(28,_)}const ct=()=>r&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function Ht(Re){ie[Re?"unshift":"push"](()=>{h=Re,t(7,h)})}function Le(Re){Pe.call(this,n,Re)}function ot(Re){Pe.call(this,n,Re)}function on(Re){ie[Re?"unshift":"push"](()=>{g=Re,t(8,g)})}const En=Re=>U(Re.detail);return n.$$.update=()=>{var Re;n.$$.dirty[0]&1073741824&&t(13,I=Object.keys(u.base||{})),n.$$.dirty[0]&4&&k.type==="view"&&(t(2,k.createRule=null,k),t(2,k.updateRule=null,k),t(2,k.deleteRule=null,k),t(2,k.indexes=[],k)),n.$$.dirty[0]&268435460&&k.name&&(_==null?void 0:_.name)!=k.name&&k.indexes.length>0&&t(2,k.indexes=(Re=k.indexes)==null?void 0:Re.map(Ft=>V.replaceIndexTableName(Ft,k.name)),k),n.$$.dirty[0]&4&&t(18,i=k.type===e_),n.$$.dirty[0]&4&&t(17,l=k.type===t_),n.$$.dirty[0]&32&&(c.fields||c.viewQuery||c.indexes?t(12,L=V.getNestedVal(c,"fields.message")||"Has errors"):t(12,L="")),n.$$.dirty[0]&4&&t(16,s=!!k.id&&k.system),n.$$.dirty[0]&4&&t(15,o=!!k.id&&k.system&&k.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=E!=Aa(k)),n.$$.dirty[0]&20&&t(14,a=!k.id||r),n.$$.dirty[0]&12&&M===rs&&k.type!=="auth"&&A(xi)},[A,N,k,M,r,c,d,h,g,S,$,T,L,I,a,o,s,l,i,F,U,Y,Z,G,pe,ue,P,R,_,E,u,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ve,Ce,ct,Ht,Le,ot,on,En]}class lf extends Se{constructor(e){super(),we(this,e,GD,JD,ke,{changeTab:0,show:26,hide:1,forceHide:27},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[26]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[27]}}function XD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),ee(e,"dragging",n[1])},m(l,s){v(l,e,s),n[4](e),t||(i=[W(e,"mousedown",n[5]),W(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&ee(e,"dragging",l[1])},i:te,o:te,d(l){l&&y(e),n[4](null),t=!1,Ie(i)}}}function QD(n,e,t){const i=kt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-s.offsetLeft,u=_.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let k=_.clientX-o,S=_.clientY-r,$=_.clientX-a,T=_.clientY-u;!f&&Math.abs($-s.offsetLeft){s=_,t(0,s)})}const g=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,l=_.tolerance)},[s,f,c,l,h,g]}class xD extends Se{constructor(e){super(),we(this,e,QD,XD,ke,{tolerance:3})}}function eI(n){let e,t,i,l,s;const o=n[5].default,r=Lt(o,n,n[4],null);return l=new xD({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),j(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){v(a,e,u),r&&r.m(e,null),n[6](e),v(a,i,u),q(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&Pt(r,o,a,a[4],s?At(o,a[4],u,null):Nt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(O(r,a),O(l.$$.fragment,a),s=!0)},o(a){D(r,a),D(l.$$.fragment,a),s=!1},d(a){a&&(y(e),y(i)),r&&r.d(a),n[6](null),H(l,a)}}}const n_="@superuserSidebarWidth";function tI(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(n_)||null;function u(m){ie[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{V.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(n_,a))},[s,o,a,r,l,i,u,f,c,d]}class vy extends Se{constructor(e){super(),we(this,e,tI,eI,ke,{class:0})}}function i_(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm link-hint"),p(e,"aria-hidden","true")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(l){l&&y(e),t=!1,i()}}}function nI(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function iI(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function lI(n){var T,M;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,g,_=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((M=n[0].oauth2.providers)!=null&&M.length)&&i_();function k(E,L){return E[1]?iI:nI}let S=k(n),$=S(n);return{c(){var E;e=b("a"),t=b("i"),l=C(),s=b("span"),r=B(o),a=C(),_&&_.c(),u=C(),f=b("span"),$.c(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent btn-pin-collection m-l-auto svelte-5oh3nd"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",d="/collections?collection="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),ee(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,L){v(E,e,L),w(e,t),w(e,l),w(e,s),w(s,r),w(e,a),_&&_.m(e,null),w(e,u),w(e,f),$.m(f,null),h||(g=[Oe(c=qe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),W(f,"click",On(nt(n[5]))),Oe(Bn.call(null,e))],h=!0)},p(E,[L]){var I,A,P;L&1&&i!==(i=zs(V.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=E[0].name+"")&&oe(r,o),E[0].type=="auth"&&((I=E[0].oauth2)!=null&&I.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?_||(_=i_(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=k(E))&&($.d(1),$=S(E),$&&($.c(),$.m(f,null))),c&&It(c.update)&&L&2&&c.update.call(null,{position:"right",text:(E[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collection="+E[0].id)&&p(e,"href",d),L&1&&m!==(m=E[0].name)&&p(e,"title",m),L&5&&ee(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&y(e),_&&_.d(),$.d(),h=!1,Ie(g)}}}function sI(n,e,t){let i,l;Qe(n,ti,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?V.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class sf extends Se{constructor(e){super(),we(this,e,sI,lI,ke,{collection:0,pinnedIds:4})}}function l_(n,e,t){const i=n.slice();return i[25]=e[t],i}function s_(n,e,t){const i=n.slice();return i[25]=e[t],i}function o_(n,e,t){const i=n.slice();return i[25]=e[t],i}function r_(n){let e,t,i=[],l=new Map,s,o,r=de(n[2]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function u_(n){let e,t=[],i=new Map,l,s,o=n[2].length&&f_(),r=de(n[8]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function d_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&p_(n),m=(n[6]||n[4].length)&&m_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","sidebar-title m-b-xs"),p(e,"aria-label",l=n[6]?"Expand system collections":"Collapse system collections"),p(e,"aria-expanded",s=n[6]||n[4].length),e.disabled=o=n[4].length,ee(e,"link-hint",!n[4].length)},m(h,g){v(h,e,g),w(e,t),w(e,i),d&&d.m(e,null),v(h,r,g),m&&m.m(h,g),v(h,a,g),u=!0,f||(c=W(e,"click",n[19]),f=!0)},p(h,g){h[4].length?d&&(d.d(1),d=null):d?d.p(h,g):(d=p_(h),d.c(),d.m(e,null)),(!u||g[0]&64&&l!==(l=h[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",l),(!u||g[0]&80&&s!==(s=h[6]||h[4].length))&&p(e,"aria-expanded",s),(!u||g[0]&16&&o!==(o=h[4].length))&&(e.disabled=o),(!u||g[0]&16)&&ee(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,g),g[0]&80&&O(m,1)):(m=m_(h),m.c(),O(m,1),m.m(a.parentNode,a)):m&&(re(),D(m,1,1,()=>{m=null}),ae())},i(h){u||(O(m),u=!0)},o(h){D(m),u=!1},d(h){h&&(y(e),y(r),y(a)),d&&d.d(),m&&m.d(h),f=!1,c()}}}function p_(n){let e,t;return{c(){e=b("i"),p(e,"class",t="ri-arrow-"+(n[6]?"up":"down")+"-s-line"),p(e,"aria-hidden","true")},m(i,l){v(i,e,l)},p(i,l){l[0]&64&&t!==(t="ri-arrow-"+(i[6]?"up":"down")+"-s-line")&&p(e,"class",t)},d(i){i&&y(e)}}}function m_(n){let e=[],t=new Map,i,l,s=de(n[7]);const o=r=>r[25].id;for(let r=0;rbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function __(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function g_(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",n[21]),i=!0)},p:te,d(s){s&&y(e),i=!1,l()}}}function oI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[2].length&&r_(n),T=n[8].length&&u_(n),M=n[7].length&&d_(n),E=n[4].length&&!n[3].length&&__(),L=!n[11]&&g_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),$&&$.c(),c=C(),T&&T.c(),d=C(),M&&M.c(),m=C(),E&&E.c(),h=C(),L&&L.c(),g=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),ee(l,"hidden",!n[9]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),ee(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),ee(f,"fade",n[10]),ee(f,"sidebar-content-compact",n[3].length>20)},m(I,A){v(I,e,A),w(e,t),w(t,i),w(i,l),w(t,s),w(t,o),he(o,n[0]),v(I,r,A),v(I,a,A),v(I,u,A),v(I,f,A),$&&$.m(f,null),w(f,c),T&&T.m(f,null),w(f,d),M&&M.m(f,null),w(f,m),E&&E.m(f,null),v(I,h,A),L&&L.m(I,A),v(I,g,A),_=!0,k||(S=[W(l,"click",n[15]),W(o,"input",n[16])],k=!0)},p(I,A){(!_||A[0]&512)&&ee(l,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&he(o,I[0]),(!_||A[0]&512)&&ee(t,"active",I[9]),I[2].length?$?($.p(I,A),A[0]&4&&O($,1)):($=r_(I),$.c(),O($,1),$.m(f,c)):$&&(re(),D($,1,1,()=>{$=null}),ae()),I[8].length?T?(T.p(I,A),A[0]&256&&O(T,1)):(T=u_(I),T.c(),O(T,1),T.m(f,d)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),I[7].length?M?(M.p(I,A),A[0]&128&&O(M,1)):(M=d_(I),M.c(),O(M,1),M.m(f,m)):M&&(re(),D(M,1,1,()=>{M=null}),ae()),I[4].length&&!I[3].length?E||(E=__(),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!_||A[0]&1024)&&ee(f,"fade",I[10]),(!_||A[0]&8)&&ee(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=g_(I),L.c(),L.m(g.parentNode,g))},i(I){_||(O($),O(T),O(M),_=!0)},o(I){D($),D(T),D(M),_=!1},d(I){I&&(y(e),y(r),y(a),y(u),y(f),y(h),y(g)),$&&$.d(),T&&T.d(),M&&M.d(),E&&E.d(),L&&L.d(I),k=!1,Ie(S)}}}function rI(n){let e,t,i,l;e=new vy({props:{class:"collection-sidebar",$$slots:{default:[oI]},$$scope:{ctx:n}}});let s={};return i=new lf({props:s}),n[22](i),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,r){const a={};r[0]&4095|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(O(e.$$.fragment,o),O(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&y(t),H(e,o),n[22](null),H(i,o)}}}const b_="@pinnedCollections";function aI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function uI(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,Mn,R=>t(13,u=R)),Qe(n,ti,R=>t(14,f=R)),Qe(n,Js,R=>t(10,c=R)),Qe(n,Dl,R=>t(11,d=R));let m,h="",g=[],_=!1,k;S();function S(){t(1,g=[]);try{const R=localStorage.getItem(b_);R&&t(1,g=JSON.parse(R)||[])}catch{}}function $(){t(1,g=g.filter(R=>!!u.find(z=>z.id==R)))}const T=()=>t(0,h="");function M(){h=this.value,t(0,h)}function E(R){g=R,t(1,g)}function L(R){g=R,t(1,g)}const I=()=>{i.length||t(6,_=!_)};function A(R){g=R,t(1,g)}const P=()=>m==null?void 0:m.show();function N(R){ie[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&($(),aI()),n.$$.dirty[0]&1&&t(4,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,l=h!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(b_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,s=u.filter(R=>{var z,F,U;return R.id==h||((U=(F=(z=R.name)==null?void 0:z.replace(/\s+/g,""))==null?void 0:F.toLowerCase())==null?void 0:U.includes(i))})),n.$$.dirty[0]&10&&t(2,o=s.filter(R=>g.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(R=>!R.system&&!g.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(R=>R.system&&!g.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&k!=f.id&&(t(12,k=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,_=!0):t(6,_=!1))},[h,g,o,s,i,m,_,a,r,l,c,d,k,u,f,T,M,E,L,I,A,P,N]}class fI extends Se{constructor(e){super(),we(this,e,uI,rI,ke,{},null,[-1,-1])}}function cI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function dI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=B(n[2]),l=C(),s=b("div"),o=B(n[1]),r=B(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(e,l),w(e,s),w(s,o),w(s,r),a||(u=Oe(qe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&oe(i,f[2]),c&2&&oe(o,f[1])},d(f){f&&y(e),a=!1,u()}}}function pI(n){let e;function t(s,o){return s[0]?dI:cI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function mI(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return V.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class hI extends Se{constructor(e){super(),we(this,e,mI,pI,ke,{date:0})}}function k_(n){let e;function t(s,o){return s[4]==="image"?gI:_I}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function _I(n){let e,t;return{c(){e=b("object"),t=B("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&y(e)}}}function gI(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){v(l,e,s)},p(l,s){s&2&&!bn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&y(e)}}}function bI(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&k_(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),v(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=k_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&y(t),i&&i.d(s)}}}function kI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[0])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function yI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=B(n[2]),i=C(),l=b("i"),s=C(),o=b("div"),r=C(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,s,d),v(c,o,d),v(c,r,d),v(c,a,d),u||(f=W(a,"click",n[0]),u=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(y(e),y(s),y(o),y(r),y(a)),u=!1,f()}}}function vI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[yI],header:[kI],default:[bI]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[7](null),H(e,l)}}}function wI(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){ie[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=V.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class SI extends Se{constructor(e){super(),we(this,e,wI,vI,ke,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function TI(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?MI:u[3]==="video"||u[3]==="audio"?OI:CI}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){v(u,e,f),a.m(e,null),l||(s=W(e,"click",On(n[11])),l=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&y(e),a.d(),l=!1,s()}}}function $I(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&y(e)}}}function CI(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function OI(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function MI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),bn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){v(o,e,r),l||(s=W(e,"error",n[8]),l=!0)},p(o,r){r&32&&!bn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&y(e),l=!1,s()}}}function y_(n){let e,t,i={};return e=new SI({props:i}),n[12](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[12](null),H(e,l)}}}function EI(n){let e,t,i;function l(a,u){return a[2]?$I:TI}let s=l(n),o=s(n),r=n[7]&&y_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ye()},m(a,u){o.m(a,u),v(a,e,u),r&&r.m(a,u),v(a,t,u),i=!0},p(a,[u]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&O(r,1)):(r=y_(a),r.c(),O(r,1),r.m(t.parentNode,t)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){i||(O(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(y(e),y(t)),o.d(a),r&&r.d(a)}}}function DI(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await _e.getSuperuserFileToken(s.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,d=!1)}function h(){t(5,u="")}const g=k=>{l&&(k.preventDefault(),a==null||a.show(f))};function _(k){ie[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,s=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=V.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":_e.files.getURL(s,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":_e.files.getURL(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,l,h,s,c,g,_]}class of extends Se{constructor(e){super(),we(this,e,DI,EI,ke,{record:9,filename:0,size:1})}}function v_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function w_(n,e,t){const i=n.slice();i[7]=e[t];const l=V.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function S_(n,e,t){const i=n.slice();return i[13]=e[t],i}function T_(n){let e,t;return e=new of({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[13]),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $_(n){let e=!V.isEmpty(n[13]),t,i,l=e&&T_(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),v(s,t,o),i=!0},p(s,o){o&3&&(e=!V.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&O(l,1)):(l=T_(s),l.c(),O(l,1),l.m(t.parentNode,t)):l&&(re(),D(l,1,1,()=>{l=null}),ae())},i(s){i||(O(l),i=!0)},o(s){D(l),i=!1},d(s){s&&y(t),l&&l.d(s)}}}function C_(n){let e,t,i=de(n[10]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;obe(e,"record",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};!t&&r&5&&(t=!0,a.record=n[0].expand[n[7].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function M_(n){let e,t,i,l,s,o=n[9]>0&&II();const r=[AI,LI],a=[];function u(f,c){var d;return f[7].type=="relation"&&((d=f[0].expand)!=null&&d[f[7].name])?0:1}return t=u(n),i=a[t]=r[t](n),{c(){o&&o.c(),e=C(),i.c(),l=ye()},m(f,c){o&&o.m(f,c),v(f,e,c),a[t].m(f,c),v(f,l,c),s=!0},p(f,c){let d=t;t=u(f),t===d?a[t].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),i=a[t],i?i.p(f,c):(i=a[t]=r[t](f),i.c()),O(i,1),i.m(l.parentNode,l))},i(f){s||(O(i),s=!0)},o(f){D(i),s=!1},d(f){f&&(y(e),y(l)),o&&o.d(f),a[t].d(f)}}}function PI(n){let e,t,i,l=de(n[1]),s=[];for(let c=0;cD(s[c],1,1,()=>{s[c]=null});let r=de(n[2]),a=[];for(let c=0;cD(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=O_(n)),{c(){for(let c=0;ct(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.fields)||[];if(t(1,o=f.filter(c=>!c.hidden&&c.presentable&&c.type=="file")),t(2,r=f.filter(c=>!c.hidden&&c.presentable&&c.type!="file")),!o.length&&!r.length){const c=f.find(d=>{var m;return!d.hidden&&d.type=="file"&&d.maxSelect==1&&((m=d.mimeTypes)==null?void 0:m.find(h=>h.startsWith("image/")))});c&&o.push(c)}}function u(f,c){n.$$.not_equal(s.expand[c.name],f)&&(s.expand[c.name]=f,t(0,s))}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l,u]}class wy extends Se{constructor(e){super(),we(this,e,NI,PI,ke,{record:0})}}function RI(n){let e,t,i,l,s,o,r,a,u,f;return t=new wy({props:{record:n[0]}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(l,"target","_blank"),p(l,"class","inline-flex link-hint"),p(l,"rel","noopener noreferrer"),p(e,"class","record-info svelte-69icne")},m(c,d){v(c,e,d),q(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Oe(r=qe.call(null,l,{text:`Open relation record in new tab: + `),R=b("i"),z=C(),U=B("."),J=C(),p(a,"class","txt-strikethrough txt-hint"),p(d,"class","ri-arrow-right-line txt-sm"),p(h,"class","txt"),p(r,"class","inline-flex m-l-5"),p(E,"class","txt-sm"),p(P,"class","txt-sm"),p(R,"class","ri-external-link-line txt-sm"),p(I,"href",F=n[13](n[27].name)),p(I,"target","_blank"),p(T,"class","txt-hint"),p(e,"class","svelte-xqpcsf")},m(Y,Z){v(Y,e,Z),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(r,c),w(r,d),w(r,m),w(r,h),w(h,_),w(e,k),w(e,S),w(e,$),w(e,T),w(T,O),w(T,E),w(T,L),w(T,I),w(I,A),w(I,P),w(I,N),w(I,R),w(I,z),w(T,U),w(e,J)},p(Y,Z){Z[0]&128&&l!==(l=Y[27].name+"")&&oe(s,l),Z[0]&128&&u!==(u=Y[27].oldHost+"")&&oe(f,u),Z[0]&128&&g!==(g=Y[27].newHost+"")&&oe(_,g),Z[0]&128&&F!==(F=Y[13](Y[27].name))&&p(I,"href",F)},d(Y){Y&&y(e)}}}function AD(n){let e,t,i=(n[5]||n[9].length||n[10].length)&&Mh(n),l=n[11]&&Dh(n);return{c(){i&&i.c(),e=C(),l&&l.c(),t=ye()},m(s,o){i&&i.m(s,o),v(s,e,o),l&&l.m(s,o),v(s,t,o)},p(s,o){s[5]||s[9].length||s[10].length?i?i.p(s,o):(i=Mh(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),s[11]?l?l.p(s,o):(l=Dh(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(s){s&&(y(e),y(t)),i&&i.d(s),l&&l.d(s)}}}function PD(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function ND(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=C(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),e.focus(),l||(s=[W(e,"click",n[15]),W(i,"click",n[16])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function RD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[ND],header:[PD],default:[AD]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&4030|s[1]&512&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[17](null),H(e,l)}}}function FD(n,e,t){let i,l,s,o,r,a,u;const f=kt();let c,d,m,h,g=[],_=[];async function k(F,U,J=!0){t(1,d=F),t(2,m=U),h=J,await O(),I(),await dn(),i||o.length||r.length||a.length||g.length||_.length?c==null||c.show():$()}function S(){c==null||c.hide()}function $(){S(),f("confirm",h)}const T=["oidc","oidc2","oidc3"];async function O(){var F,U,J,Y;t(7,g=[]);for(let Z of T){let G=(U=(F=d==null?void 0:d.oauth2)==null?void 0:F.providers)==null?void 0:U.find(Te=>Te.name==Z),pe=(Y=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:Y.find(Te=>Te.name==Z);if(!G||!pe)continue;let ce=new URL(G.authURL).host,ue=new URL(pe.authURL).host;ce!=ue&&await E(Z)&&g.push({name:Z,oldHost:ce,newHost:ue})}}async function E(F){try{return await _e.collection("_externalAuths").getFirstListItem(_e.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:m==null?void 0:m.id,provider:F})),!0}catch{}return!1}function L(F){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${m==null?void 0:m.id}%22+%26%26+provider%3D%22${F}%22`}function I(){if(t(3,_=[]),window.location.protocol!="https:")return;const F=["listRule","viewRule"];l||F.push("createRule","updateRule","deleteRule"),s&&F.push("manageRule","authRule");let U,J;for(let Y of F)U=d==null?void 0:d[Y],J=m==null?void 0:m[Y],U!==J&&_.push({prop:Y,oldRule:U,newRule:J})}const A=()=>S(),P=()=>$();function N(F){ie[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Pe.call(this,n,F)}function z(F){Pe.call(this,n,F)}return n.$$.update=()=>{var F,U,J;n.$$.dirty[0]&6&&t(5,i=(d==null?void 0:d.name)!=(m==null?void 0:m.name)),n.$$.dirty[0]&4&&t(4,l=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(s=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!l&&((F=m==null?void 0:m.fields)==null?void 0:F.filter(Y=>Y.id&&!Y._toDelete&&Y._originalName!=Y.name))||[]),n.$$.dirty[0]&20&&t(9,r=!l&&((U=m==null?void 0:m.fields)==null?void 0:U.filter(Y=>Y.id&&Y._toDelete))||[]),n.$$.dirty[0]&6&&t(8,a=((J=m==null?void 0:m.fields)==null?void 0:J.filter(Y=>{var G;const Z=(G=d==null?void 0:d.fields)==null?void 0:G.find(pe=>pe.id==Y.id);return Z?Z.maxSelect!=1&&Y.maxSelect==1:!1}))||[]),n.$$.dirty[0]&56&&t(11,u=!l||i||_.length)},[S,d,m,_,l,i,c,g,a,r,o,u,$,L,k,A,P,N,R,z]}class qD extends Se{constructor(e){super(),we(this,e,FD,RD,ke,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function qh(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function HD(n){let e,t,i;function l(o){n[44](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new bD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jD(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new TD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Hh(n){let e,t,i,l;function s(r){n[45](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new LD({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&y(e),H(t)}}}function jh(n){let e,t,i,l;function s(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new HO({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&ee(e,"active",r[3]===rs)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&y(e),H(t)}}}function zD(n){let e,t,i,l,s,o,r;const a=[jD,HD],u=[];function f(m,h){return m[17]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[15]&&n[3]===no&&Hh(n),d=n[18]&&jh(n);return{c(){e=b("div"),t=b("div"),l.c(),s=C(),c&&c.c(),o=C(),d&&d.c(),p(t,"class","tab-item"),ee(t,"active",n[3]===xi),p(e,"class","tabs-content svelte-xyiw1b")},m(m,h){v(m,e,h),w(e,t),u[i].m(t,null),w(e,s),c&&c.m(e,null),w(e,o),d&&d.m(e,null),r=!0},p(m,h){let g=i;i=f(m),i===g?u[i].p(m,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),l=u[i],l?l.p(m,h):(l=u[i]=a[i](m),l.c()),M(l,1),l.m(t,null)),(!r||h[0]&8)&&ee(t,"active",m[3]===xi),!m[15]&&m[3]===no?c?(c.p(m,h),h[0]&32776&&M(c,1)):(c=Hh(m),c.c(),M(c,1),c.m(e,o)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),m[18]?d?(d.p(m,h),h[0]&262144&&M(d,1)):(d=jh(m),d.c(),M(d,1),d.m(e,null)):d&&(re(),D(d,1,1,()=>{d=null}),ae())},i(m){r||(M(l),M(c),M(d),r=!0)},o(m){D(l),D(c),D(d),r=!1},d(m){m&&y(e),u[i].d(),c&&c.d(),d&&d.d()}}}function zh(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[UD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&131076|u[2]&2&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(y(e),y(t),y(i)),H(o)}}}function Uh(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=C(),i=b("hr"),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=W(e,"click",n[34]),l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,s()}}}function Vh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Truncate',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Bh(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){v(l,e,s),t||(i=W(e,"click",On(nt(n[36]))),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function UD(n){let e,t,i,l=!n[2].system&&Uh(n),s=!n[17]&&Vh(n),o=!n[2].system&&Bh(n);return{c(){l&&l.c(),e=C(),s&&s.c(),t=C(),o&&o.c(),i=ye()},m(r,a){l&&l.m(r,a),v(r,e,a),s&&s.m(r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a)},p(r,a){r[2].system?l&&(l.d(1),l=null):l?l.p(r,a):(l=Uh(r),l.c(),l.m(e.parentNode,e)),r[17]?s&&(s.d(1),s=null):s?s.p(r,a):(s=Vh(r),s.c(),s.m(t.parentNode,t)),r[2].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=Bh(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),l&&l.d(r),s&&s.d(r),o&&o.d(r)}}}function Wh(n){let e,t,i,l;return i=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[VD]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),j(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){v(s,e,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(y(e),y(t)),H(i,s)}}}function Yh(n){let e,t,i,l,s,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),l=C(),s=b("span"),r=B(o),a=B(" collection"),u=C(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),ee(e,"selected",n[59]==n[2].type)},m(m,h){v(m,e,h),w(e,t),w(e,l),w(e,s),w(s,r),w(s,a),w(e,u),f||(c=W(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=zs(V.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[60]+"")&&oe(r,o),h[0]&68&&ee(e,"selected",n[59]==n[2].type)},d(m){m&&y(e),f=!1,c()}}}function VD(n){let e,t=de(Object.entries(n[6])),i=[];for(let l=0;l{R=null}),ae()):R?(R.p(F,U),U[0]&4&&M(R,1)):(R=Wh(F),R.c(),M(R,1),R.m(d,null)),(!A||U[0]&4&&T!==(T=F[2].id?-1:0))&&p(d,"tabindex",T),(!A||U[0]&4&&O!==(O=F[2].id?"":"button"))&&p(d,"role",O),(!A||U[0]&4&&E!==(E="btn btn-sm p-r-10 p-l-10 "+(F[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",E),(!A||U[0]&4)&&ee(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=Kh(),z.c(),z.m(I.parentNode,I)):z&&(z.d(1),z=null)},i(F){A||(M(R),A=!0)},o(F){D(R),A=!1},d(F){F&&(y(e),y(l),y(s),y(f),y(c),y(L),y(I)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function Jh(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){v(r,e,a),l=!0,s||(o=Oe(t=qe.call(null,e,n[12])),s=!0)},p(r,a){t&&It(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,$t,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,$t,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&y(e),r&&i&&i.end(),s=!1,o()}}}function Zh(n){var a,u,f,c,d,m,h;let e,t,i,l=!V.isEmpty((a=n[5])==null?void 0:a.listRule)||!V.isEmpty((u=n[5])==null?void 0:u.viewRule)||!V.isEmpty((f=n[5])==null?void 0:f.createRule)||!V.isEmpty((c=n[5])==null?void 0:c.updateRule)||!V.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!V.isEmpty((m=n[5])==null?void 0:m.authRule)||!V.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Gh();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===no)},m(g,_){v(g,e,_),w(e,t),w(e,i),r&&r.m(e,null),s||(o=W(e,"click",n[41]),s=!0)},p(g,_){var k,S,$,T,O,E,L;_[0]&32&&(l=!V.isEmpty((k=g[5])==null?void 0:k.listRule)||!V.isEmpty((S=g[5])==null?void 0:S.viewRule)||!V.isEmpty(($=g[5])==null?void 0:$.createRule)||!V.isEmpty((T=g[5])==null?void 0:T.updateRule)||!V.isEmpty((O=g[5])==null?void 0:O.deleteRule)||!V.isEmpty((E=g[5])==null?void 0:E.authRule)||!V.isEmpty((L=g[5])==null?void 0:L.manageRule)),l?r?_[0]&32&&M(r,1):(r=Gh(),r.c(),M(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),_[0]&8&&ee(e,"active",g[3]===no)},d(g){g&&y(e),r&&r.d(),s=!1,o()}}}function Gh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function Xh(n){let e,t,i,l=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),s,o,r=l&&Qh();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(a,u){v(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=W(e,"click",n[42]),s=!0)},p(a,u){u[0]&8224&&(l=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),l?r?u[0]&8224&&M(r,1):(r=Qh(),r.c(),M(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u[0]&8&&ee(e,"active",a[3]===rs)},d(a){a&&y(e),r&&r.d(),s=!1,o()}}}function Qh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function WD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[17]?"Query":"Fields",g,_,k=!V.isEmpty(n[12]),S,$,T,O,E,L=!!n[2].id&&(!n[2].system||!n[17])&&zh(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[BD,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let I=k&&Jh(n),A=!n[15]&&Zh(n),P=n[18]&&Xh(n);return{c(){e=b("h4"),i=B(t),l=C(),L&&L.c(),s=C(),o=b("form"),j(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),g=B(h),_=C(),I&&I.c(),S=C(),A&&A.c(),$=C(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ee(d,"active",n[3]===xi),p(c,"class","tabs-header stretched")},m(N,R){v(N,e,R),w(e,i),v(N,l,R),L&&L.m(N,R),v(N,s,R),v(N,o,R),q(r,o,null),w(o,a),w(o,u),v(N,f,R),v(N,c,R),w(c,d),w(d,m),w(m,g),w(d,_),I&&I.m(d,null),w(c,S),A&&A.m(c,null),w(c,$),P&&P.m(c,null),T=!0,O||(E=[W(o,"submit",nt(n[39])),W(d,"click",n[40])],O=!0)},p(N,R){(!T||R[0]&4)&&t!==(t=N[2].id?"Edit collection":"New collection")&&oe(i,t),N[2].id&&(!N[2].system||!N[17])?L?(L.p(N,R),R[0]&131076&&M(L,1)):(L=zh(N),L.c(),M(L,1),L.m(s.parentNode,s)):L&&(re(),D(L,1,1,()=>{L=null}),ae());const z={};R[0]&327748|R[1]&134217728|R[2]&2&&(z.$$scope={dirty:R,ctx:N}),r.$set(z),(!T||R[0]&131072)&&h!==(h=N[17]?"Query":"Fields")&&oe(g,h),R[0]&4096&&(k=!V.isEmpty(N[12])),k?I?(I.p(N,R),R[0]&4096&&M(I,1)):(I=Jh(N),I.c(),M(I,1),I.m(d,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae()),(!T||R[0]&8)&&ee(d,"active",N[3]===xi),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=Zh(N),A.c(),A.m(c,$)),N[18]?P?P.p(N,R):(P=Xh(N),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(N){T||(M(L),M(r.$$.fragment,N),M(I),T=!0)},o(N){D(L),D(r.$$.fragment,N),D(I),T=!1},d(N){N&&(y(e),y(l),y(s),y(o),y(f),y(c)),L&&L.d(N),H(r),I&&I.d(),A&&A.d(),P&&P.d(),O=!1,Ie(E)}}}function xh(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[YD]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[14]||n[9]||n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&17920&&s!==(s=!r[14]||r[9]||r[10]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&y(e),H(l)}}}function YD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[33]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function KD(n){let e,t,i,l,s,o,r=n[2].id?"Save changes":"Create",a,u,f,c,d,m,h=n[2].id&&xh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("div"),s=b("button"),o=b("span"),a=B(r),f=C(),h&&h.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(s,"type","button"),p(s,"title","Save and close"),p(s,"class","btn"),s.disabled=u=!n[14]||n[9]||n[10],ee(s,"btn-expanded",!n[2].id),ee(s,"btn-expanded-sm",!!n[2].id),ee(s,"btn-loading",n[9]||n[10]),p(l,"class","btns-group no-gap")},m(g,_){v(g,e,_),w(e,t),v(g,i,_),v(g,l,_),w(l,s),w(s,o),w(o,a),w(l,f),h&&h.m(l,null),c=!0,d||(m=[W(e,"click",n[31]),W(s,"click",n[32])],d=!0)},p(g,_){(!c||_[0]&512)&&(e.disabled=g[9]),(!c||_[0]&4)&&r!==(r=g[2].id?"Save changes":"Create")&&oe(a,r),(!c||_[0]&17920&&u!==(u=!g[14]||g[9]||g[10]))&&(s.disabled=u),(!c||_[0]&4)&&ee(s,"btn-expanded",!g[2].id),(!c||_[0]&4)&&ee(s,"btn-expanded-sm",!!g[2].id),(!c||_[0]&1536)&&ee(s,"btn-loading",g[9]||g[10]),g[2].id?h?(h.p(g,_),_[0]&4&&M(h,1)):(h=xh(g),h.c(),M(h,1),h.m(l,null)):h&&(re(),D(h,1,1,()=>{h=null}),ae())},i(g){c||(M(h),c=!0)},o(g){D(h),c=!1},d(g){g&&(y(e),y(i),y(l)),h&&h.d(),d=!1,Ie(m)}}}function JD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[KD],header:[WD],default:[zD]},$$scope:{ctx:n}};e=new Qt({props:s}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new qD({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&2064&&(u.beforeHide=r[47]),a[0]&521836|a[2]&2&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&y(t),n[48](null),H(e,r),n[51](null),H(i,r)}}}const xi="schema",no="api_rules",rs="options",ZD="base",e_="auth",t_="view";function Aa(n){return JSON.stringify(n)}function GD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Du,Re=>t(30,u=Re)),Qe(n,ti,Re=>t(53,f=Re)),Qe(n,yn,Re=>t(5,c=Re));const d={};d[ZD]="Base",d[t_]="View",d[e_]="Auth";const m=kt();let h,g,_=null,k={},S=!1,$=!1,T=!1,O=xi,E=Aa(k),L="",I=[];function A(Re){t(3,O=Re)}function P(Re){return z(Re),t(11,T=!0),t(10,$=!1),t(9,S=!1),A(xi),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function R(){t(11,T=!1),N()}async function z(Re){Ut({}),typeof Re<"u"?(t(28,_=Re),t(2,k=structuredClone(Re))):(t(28,_=null),t(2,k=structuredClone(u.base)),k.fields.push({type:"autodate",name:"created",onCreate:!0}),k.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,k.fields=k.fields||[],k),t(2,k._originalName=k.name||"",k),await dn(),t(29,E=Aa(k))}async function F(Re=!0){if(!$){t(10,$=!0);try{k.id?await(g==null?void 0:g.show(_,k,Re)):await U(Re)}catch{}t(10,$=!1)}}function U(Re=!0){if(S)return;t(9,S=!0);const Ft=J(),Yt=!k.id;let vn;return Yt?vn=_e.collections.create(Ft):vn=_e.collections.update(k.id,Ft),vn.then(fn=>{Ls(),Ww(fn),Re?(t(11,T=!1),N()):z(fn),nn(k.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Yt,collection:fn}),Yt&&Rn(ti,f=fn,f)}).catch(fn=>{_e.error(fn)}).finally(()=>{t(9,S=!1)})}function J(){const Re=Object.assign({},k);Re.fields=Re.fields.slice(0);for(let Ft=Re.fields.length-1;Ft>=0;Ft--)Re.fields[Ft]._toDelete&&Re.fields.splice(Ft,1);return Re}function Y(){_!=null&&_.id&&_n(`Do you really want to delete all "${_.name}" records, including their cascade delete references and files?`,()=>_e.collections.truncate(_.id).then(()=>{R(),nn(`Successfully truncated collection "${_.name}".`),m("truncate")}).catch(Re=>{_e.error(Re)}))}function Z(){_!=null&&_.id&&_n(`Do you really want to delete collection "${_.name}" and all its records?`,()=>_e.collections.delete(_.id).then(()=>{R(),nn(`Successfully deleted collection "${_.name}".`),m("delete",_),Yw(_)}).catch(Re=>{_e.error(Re)}))}function G(Re){t(2,k.type=Re,k),t(2,k=Object.assign(structuredClone(u[Re]),k)),Yn("fields")}function pe(){r?_n("You have unsaved changes. Do you really want to discard them?",()=>{ce()}):ce()}async function ce(){const Re=_?structuredClone(_):null;if(Re){if(Re.id="",Re.created="",Re.updated="",Re.name+="_duplicate",!V.isEmpty(Re.fields))for(const Ft of Re.fields)Ft.id="";if(!V.isEmpty(Re.indexes))for(let Ft=0;FtN(),Ke=()=>F(),Je=()=>F(!1),ft=()=>pe(),et=()=>Y(),xe=()=>Z(),We=Re=>{t(2,k.name=V.slugify(Re.target.value),k),Re.target.value=k.name},at=Re=>G(Re),jt=()=>{a&&F()},Ve=()=>A(xi),Ee=()=>A(no),st=()=>A(rs);function De(Re){k=Re,t(2,k),t(28,_)}function Ye(Re){k=Re,t(2,k),t(28,_)}function ve(Re){k=Re,t(2,k),t(28,_)}function Ce(Re){k=Re,t(2,k),t(28,_)}const ct=()=>r&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function Ht(Re){ie[Re?"unshift":"push"](()=>{h=Re,t(7,h)})}function Le(Re){Pe.call(this,n,Re)}function ot(Re){Pe.call(this,n,Re)}function on(Re){ie[Re?"unshift":"push"](()=>{g=Re,t(8,g)})}const En=Re=>U(Re.detail);return n.$$.update=()=>{var Re;n.$$.dirty[0]&1073741824&&t(13,I=Object.keys(u.base||{})),n.$$.dirty[0]&4&&k.type==="view"&&(t(2,k.createRule=null,k),t(2,k.updateRule=null,k),t(2,k.deleteRule=null,k),t(2,k.indexes=[],k)),n.$$.dirty[0]&268435460&&k.name&&(_==null?void 0:_.name)!=k.name&&k.indexes.length>0&&t(2,k.indexes=(Re=k.indexes)==null?void 0:Re.map(Ft=>V.replaceIndexTableName(Ft,k.name)),k),n.$$.dirty[0]&4&&t(18,i=k.type===e_),n.$$.dirty[0]&4&&t(17,l=k.type===t_),n.$$.dirty[0]&32&&(c.fields||c.viewQuery||c.indexes?t(12,L=V.getNestedVal(c,"fields.message")||"Has errors"):t(12,L="")),n.$$.dirty[0]&4&&t(16,s=!!k.id&&k.system),n.$$.dirty[0]&4&&t(15,o=!!k.id&&k.system&&k.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=E!=Aa(k)),n.$$.dirty[0]&20&&t(14,a=!k.id||r),n.$$.dirty[0]&12&&O===rs&&k.type!=="auth"&&A(xi)},[A,N,k,O,r,c,d,h,g,S,$,T,L,I,a,o,s,l,i,F,U,Y,Z,G,pe,ue,P,R,_,E,u,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ve,Ce,ct,Ht,Le,ot,on,En]}class lf extends Se{constructor(e){super(),we(this,e,GD,JD,ke,{changeTab:0,show:26,hide:1,forceHide:27},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[26]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[27]}}function XD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),ee(e,"dragging",n[1])},m(l,s){v(l,e,s),n[4](e),t||(i=[W(e,"mousedown",n[5]),W(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&ee(e,"dragging",l[1])},i:te,o:te,d(l){l&&y(e),n[4](null),t=!1,Ie(i)}}}function QD(n,e,t){const i=kt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-s.offsetLeft,u=_.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let k=_.clientX-o,S=_.clientY-r,$=_.clientX-a,T=_.clientY-u;!f&&Math.abs($-s.offsetLeft){s=_,t(0,s)})}const g=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,l=_.tolerance)},[s,f,c,l,h,g]}class xD extends Se{constructor(e){super(),we(this,e,QD,XD,ke,{tolerance:3})}}function eI(n){let e,t,i,l,s;const o=n[5].default,r=Lt(o,n,n[4],null);return l=new xD({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),j(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){v(a,e,u),r&&r.m(e,null),n[6](e),v(a,i,u),q(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&Pt(r,o,a,a[4],s?At(o,a[4],u,null):Nt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(M(r,a),M(l.$$.fragment,a),s=!0)},o(a){D(r,a),D(l.$$.fragment,a),s=!1},d(a){a&&(y(e),y(i)),r&&r.d(a),n[6](null),H(l,a)}}}const n_="@superuserSidebarWidth";function tI(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(n_)||null;function u(m){ie[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{V.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(n_,a))},[s,o,a,r,l,i,u,f,c,d]}class vy extends Se{constructor(e){super(),we(this,e,tI,eI,ke,{class:0})}}function i_(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm link-hint"),p(e,"aria-hidden","true")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(l){l&&y(e),t=!1,i()}}}function nI(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function iI(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function lI(n){var T,O;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,g,_=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((O=n[0].oauth2.providers)!=null&&O.length)&&i_();function k(E,L){return E[1]?iI:nI}let S=k(n),$=S(n);return{c(){var E;e=b("a"),t=b("i"),l=C(),s=b("span"),r=B(o),a=C(),_&&_.c(),u=C(),f=b("span"),$.c(),p(t,"class",i=zs(V.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent btn-pin-collection m-l-auto svelte-5oh3nd"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",d="/collections?collection="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),ee(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,L){v(E,e,L),w(e,t),w(e,l),w(e,s),w(s,r),w(e,a),_&&_.m(e,null),w(e,u),w(e,f),$.m(f,null),h||(g=[Oe(c=qe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),W(f,"click",On(nt(n[5]))),Oe(Bn.call(null,e))],h=!0)},p(E,[L]){var I,A,P;L&1&&i!==(i=zs(V.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=E[0].name+"")&&oe(r,o),E[0].type=="auth"&&((I=E[0].oauth2)!=null&&I.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?_||(_=i_(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=k(E))&&($.d(1),$=S(E),$&&($.c(),$.m(f,null))),c&&It(c.update)&&L&2&&c.update.call(null,{position:"right",text:(E[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collection="+E[0].id)&&p(e,"href",d),L&1&&m!==(m=E[0].name)&&p(e,"title",m),L&5&&ee(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&y(e),_&&_.d(),$.d(),h=!1,Ie(g)}}}function sI(n,e,t){let i,l;Qe(n,ti,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?V.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class sf extends Se{constructor(e){super(),we(this,e,sI,lI,ke,{collection:0,pinnedIds:4})}}function l_(n,e,t){const i=n.slice();return i[25]=e[t],i}function s_(n,e,t){const i=n.slice();return i[25]=e[t],i}function o_(n,e,t){const i=n.slice();return i[25]=e[t],i}function r_(n){let e,t,i=[],l=new Map,s,o,r=de(n[2]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function u_(n){let e,t=[],i=new Map,l,s,o=n[2].length&&f_(),r=de(n[8]);const a=u=>u[25].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function d_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&p_(n),m=(n[6]||n[4].length)&&m_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","sidebar-title m-b-xs"),p(e,"aria-label",l=n[6]?"Expand system collections":"Collapse system collections"),p(e,"aria-expanded",s=n[6]||n[4].length),e.disabled=o=n[4].length,ee(e,"link-hint",!n[4].length)},m(h,g){v(h,e,g),w(e,t),w(e,i),d&&d.m(e,null),v(h,r,g),m&&m.m(h,g),v(h,a,g),u=!0,f||(c=W(e,"click",n[19]),f=!0)},p(h,g){h[4].length?d&&(d.d(1),d=null):d?d.p(h,g):(d=p_(h),d.c(),d.m(e,null)),(!u||g[0]&64&&l!==(l=h[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",l),(!u||g[0]&80&&s!==(s=h[6]||h[4].length))&&p(e,"aria-expanded",s),(!u||g[0]&16&&o!==(o=h[4].length))&&(e.disabled=o),(!u||g[0]&16)&&ee(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,g),g[0]&80&&M(m,1)):(m=m_(h),m.c(),M(m,1),m.m(a.parentNode,a)):m&&(re(),D(m,1,1,()=>{m=null}),ae())},i(h){u||(M(m),u=!0)},o(h){D(m),u=!1},d(h){h&&(y(e),y(r),y(a)),d&&d.d(),m&&m.d(h),f=!1,c()}}}function p_(n){let e,t;return{c(){e=b("i"),p(e,"class",t="ri-arrow-"+(n[6]?"up":"down")+"-s-line"),p(e,"aria-hidden","true")},m(i,l){v(i,e,l)},p(i,l){l[0]&64&&t!==(t="ri-arrow-"+(i[6]?"up":"down")+"-s-line")&&p(e,"class",t)},d(i){i&&y(e)}}}function m_(n){let e=[],t=new Map,i,l,s=de(n[7]);const o=r=>r[25].id;for(let r=0;rbe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function __(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function g_(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",n[21]),i=!0)},p:te,d(s){s&&y(e),i=!1,l()}}}function oI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[2].length&&r_(n),T=n[8].length&&u_(n),O=n[7].length&&d_(n),E=n[4].length&&!n[3].length&&__(),L=!n[11]&&g_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),$&&$.c(),c=C(),T&&T.c(),d=C(),O&&O.c(),m=C(),E&&E.c(),h=C(),L&&L.c(),g=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),ee(l,"hidden",!n[9]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),ee(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),ee(f,"fade",n[10]),ee(f,"sidebar-content-compact",n[3].length>20)},m(I,A){v(I,e,A),w(e,t),w(t,i),w(i,l),w(t,s),w(t,o),he(o,n[0]),v(I,r,A),v(I,a,A),v(I,u,A),v(I,f,A),$&&$.m(f,null),w(f,c),T&&T.m(f,null),w(f,d),O&&O.m(f,null),w(f,m),E&&E.m(f,null),v(I,h,A),L&&L.m(I,A),v(I,g,A),_=!0,k||(S=[W(l,"click",n[15]),W(o,"input",n[16])],k=!0)},p(I,A){(!_||A[0]&512)&&ee(l,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&he(o,I[0]),(!_||A[0]&512)&&ee(t,"active",I[9]),I[2].length?$?($.p(I,A),A[0]&4&&M($,1)):($=r_(I),$.c(),M($,1),$.m(f,c)):$&&(re(),D($,1,1,()=>{$=null}),ae()),I[8].length?T?(T.p(I,A),A[0]&256&&M(T,1)):(T=u_(I),T.c(),M(T,1),T.m(f,d)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),I[7].length?O?(O.p(I,A),A[0]&128&&M(O,1)):(O=d_(I),O.c(),M(O,1),O.m(f,m)):O&&(re(),D(O,1,1,()=>{O=null}),ae()),I[4].length&&!I[3].length?E||(E=__(),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!_||A[0]&1024)&&ee(f,"fade",I[10]),(!_||A[0]&8)&&ee(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=g_(I),L.c(),L.m(g.parentNode,g))},i(I){_||(M($),M(T),M(O),_=!0)},o(I){D($),D(T),D(O),_=!1},d(I){I&&(y(e),y(r),y(a),y(u),y(f),y(h),y(g)),$&&$.d(),T&&T.d(),O&&O.d(),E&&E.d(),L&&L.d(I),k=!1,Ie(S)}}}function rI(n){let e,t,i,l;e=new vy({props:{class:"collection-sidebar",$$slots:{default:[oI]},$$scope:{ctx:n}}});let s={};return i=new lf({props:s}),n[22](i),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,r){const a={};r[0]&4095|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&y(t),H(e,o),n[22](null),H(i,o)}}}const b_="@pinnedCollections";function aI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function uI(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,Mn,R=>t(13,u=R)),Qe(n,ti,R=>t(14,f=R)),Qe(n,Js,R=>t(10,c=R)),Qe(n,Dl,R=>t(11,d=R));let m,h="",g=[],_=!1,k;S();function S(){t(1,g=[]);try{const R=localStorage.getItem(b_);R&&t(1,g=JSON.parse(R)||[])}catch{}}function $(){t(1,g=g.filter(R=>!!u.find(z=>z.id==R)))}const T=()=>t(0,h="");function O(){h=this.value,t(0,h)}function E(R){g=R,t(1,g)}function L(R){g=R,t(1,g)}const I=()=>{i.length||t(6,_=!_)};function A(R){g=R,t(1,g)}const P=()=>m==null?void 0:m.show();function N(R){ie[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&($(),aI()),n.$$.dirty[0]&1&&t(4,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,l=h!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(b_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,s=u.filter(R=>{var z,F,U;return R.id==h||((U=(F=(z=R.name)==null?void 0:z.replace(/\s+/g,""))==null?void 0:F.toLowerCase())==null?void 0:U.includes(i))})),n.$$.dirty[0]&10&&t(2,o=s.filter(R=>g.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(R=>!R.system&&!g.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(R=>R.system&&!g.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&k!=f.id&&(t(12,k=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,_=!0):t(6,_=!1))},[h,g,o,s,i,m,_,a,r,l,c,d,k,u,f,T,O,E,L,I,A,P,N]}class fI extends Se{constructor(e){super(),we(this,e,uI,rI,ke,{},null,[-1,-1])}}function cI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function dI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=B(n[2]),l=C(),s=b("div"),o=B(n[1]),r=B(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(e,l),w(e,s),w(s,o),w(s,r),a||(u=Oe(qe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&oe(i,f[2]),c&2&&oe(o,f[1])},d(f){f&&y(e),a=!1,u()}}}function pI(n){let e;function t(s,o){return s[0]?dI:cI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function mI(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return V.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class hI extends Se{constructor(e){super(),we(this,e,mI,pI,ke,{date:0})}}function k_(n){let e;function t(s,o){return s[4]==="image"?gI:_I}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function _I(n){let e,t;return{c(){e=b("object"),t=B("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&y(e)}}}function gI(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){v(l,e,s)},p(l,s){s&2&&!bn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&y(e)}}}function bI(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&k_(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),v(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=k_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&y(t),i&&i.d(s)}}}function kI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[0])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function yI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=B(n[2]),i=C(),l=b("i"),s=C(),o=b("div"),r=C(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,s,d),v(c,o,d),v(c,r,d),v(c,a,d),u||(f=W(a,"click",n[0]),u=!0)},p(c,d){d&4&&oe(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(y(e),y(s),y(o),y(r),y(a)),u=!1,f()}}}function vI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[yI],header:[kI],default:[bI]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[7](null),H(e,l)}}}function wI(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){ie[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=V.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class SI extends Se{constructor(e){super(),we(this,e,wI,vI,ke,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function TI(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?MI:u[3]==="video"||u[3]==="audio"?OI:CI}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){v(u,e,f),a.m(e,null),l||(s=W(e,"click",On(n[11])),l=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&y(e),a.d(),l=!1,s()}}}function $I(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&y(e)}}}function CI(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function OI(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function MI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),bn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){v(o,e,r),l||(s=W(e,"error",n[8]),l=!0)},p(o,r){r&32&&!bn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&y(e),l=!1,s()}}}function y_(n){let e,t,i={};return e=new SI({props:i}),n[12](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[12](null),H(e,l)}}}function EI(n){let e,t,i;function l(a,u){return a[2]?$I:TI}let s=l(n),o=s(n),r=n[7]&&y_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ye()},m(a,u){o.m(a,u),v(a,e,u),r&&r.m(a,u),v(a,t,u),i=!0},p(a,[u]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&M(r,1)):(r=y_(a),r.c(),M(r,1),r.m(t.parentNode,t)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){i||(M(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(y(e),y(t)),o.d(a),r&&r.d(a)}}}function DI(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await _e.getSuperuserFileToken(s.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,d=!1)}function h(){t(5,u="")}const g=k=>{l&&(k.preventDefault(),a==null||a.show(f))};function _(k){ie[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,s=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=V.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":_e.files.getURL(s,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":_e.files.getURL(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,l,h,s,c,g,_]}class of extends Se{constructor(e){super(),we(this,e,DI,EI,ke,{record:9,filename:0,size:1})}}function v_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function w_(n,e,t){const i=n.slice();i[7]=e[t];const l=V.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function S_(n,e,t){const i=n.slice();return i[13]=e[t],i}function T_(n){let e,t;return e=new of({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[13]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $_(n){let e=!V.isEmpty(n[13]),t,i,l=e&&T_(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),v(s,t,o),i=!0},p(s,o){o&3&&(e=!V.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&M(l,1)):(l=T_(s),l.c(),M(l,1),l.m(t.parentNode,t)):l&&(re(),D(l,1,1,()=>{l=null}),ae())},i(s){i||(M(l),i=!0)},o(s){D(l),i=!1},d(s){s&&y(t),l&&l.d(s)}}}function C_(n){let e,t,i=de(n[10]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;obe(e,"record",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};!t&&r&5&&(t=!0,a.record=n[0].expand[n[7].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function M_(n){let e,t,i,l,s,o=n[9]>0&&II();const r=[AI,LI],a=[];function u(f,c){var d;return f[7].type=="relation"&&((d=f[0].expand)!=null&&d[f[7].name])?0:1}return t=u(n),i=a[t]=r[t](n),{c(){o&&o.c(),e=C(),i.c(),l=ye()},m(f,c){o&&o.m(f,c),v(f,e,c),a[t].m(f,c),v(f,l,c),s=!0},p(f,c){let d=t;t=u(f),t===d?a[t].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),i=a[t],i?i.p(f,c):(i=a[t]=r[t](f),i.c()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&(y(e),y(l)),o&&o.d(f),a[t].d(f)}}}function PI(n){let e,t,i,l=de(n[1]),s=[];for(let c=0;cD(s[c],1,1,()=>{s[c]=null});let r=de(n[2]),a=[];for(let c=0;cD(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=O_(n)),{c(){for(let c=0;ct(4,l=f));let{record:s}=e,o=[],r=[];function a(){const f=(i==null?void 0:i.fields)||[];if(t(1,o=f.filter(c=>!c.hidden&&c.presentable&&c.type=="file")),t(2,r=f.filter(c=>!c.hidden&&c.presentable&&c.type!="file")),!o.length&&!r.length){const c=f.find(d=>{var m;return!d.hidden&&d.type=="file"&&d.maxSelect==1&&((m=d.mimeTypes)==null?void 0:m.find(h=>h.startsWith("image/")))});c&&o.push(c)}}function u(f,c){n.$$.not_equal(s.expand[c.name],f)&&(s.expand[c.name]=f,t(0,s))}return n.$$set=f=>{"record"in f&&t(0,s=f.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(f=>f.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l,u]}class wy extends Se{constructor(e){super(),we(this,e,NI,PI,ke,{record:0})}}function RI(n){let e,t,i,l,s,o,r,a,u,f;return t=new wy({props:{record:n[0]}}),{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(l,"target","_blank"),p(l,"class","inline-flex link-hint"),p(l,"rel","noopener noreferrer"),p(e,"class","record-info svelte-69icne")},m(c,d){v(c,e,d),q(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Oe(r=qe.call(null,l,{text:`Open relation record in new tab: `+V.truncate(JSON.stringify(V.truncateObject(E_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),W(l,"click",On(n[1])),W(l,"keydown",On(n[2]))],u=!0)},p(c,[d]){const m={};d&1&&(m.record=c[0]),t.$set(m),(!a||d&1&&o!==(o="#/collections?collection="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&It(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab: -`+V.truncate(JSON.stringify(V.truncateObject(E_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(O(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&y(e),H(t),u=!1,Ie(f)}}}function E_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function FI(n,e,t){let{record:i}=e;function l(o){Pe.call(this,n,o)}function s(o){Pe.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,l,s]}class Ur extends Se{constructor(e){super(),we(this,e,FI,RI,ke,{record:0})}}function D_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function I_(n,e,t){const i=n.slice();return i[14]=e[t],i}function L_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function A_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function qI(n){const e=n.slice(),t=V.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function HI(n){var s,o;const e=n.slice(),t=V.toArray(e[3]);e[10]=t;const i=V.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[11]=i;const l=e[2]?20:500;return e[12]=l,e}function jI(n){const e=n.slice(),t=V.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function zI(n){let e,t;return{c(){e=b("div"),t=B(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function UI(n){let e,t=V.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=V.truncate(n[3]))},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=V.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=V.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&y(e)}}}function VI(n){let e,t=[],i=new Map,l,s,o=de(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;un[18]&&N_();return{c(){e=b("div");for(let u=0;uu[18]?a||(a=N_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&ee(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;fn[12]&&q_();return{c(){e=b("div"),i.c(),l=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){v(f,e,c),r[t].m(e,null),w(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),O(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=q_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(O(i),s=!0)},o(f){D(i),s=!1},d(f){f&&y(e),r[t].d(),u&&u.d()}}}function WI(n){let e,t=[],i=new Map,l=de(V.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function JI(n){let e,t=V.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=B(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){v(o,e,r),w(e,i),l||(s=[Oe(qe.call(null,e,"Open in new tab")),W(e,"click",On(n[5]))],l=!0)},p(o,r){r&8&&t!==(t=V.truncate(o[3])+"")&&oe(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&y(e),l=!1,Ie(s)}}}function ZI(n){let e,t;return{c(){e=b("span"),t=B(n[3]),p(e,"class","txt")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function GI(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=B(t),p(e,"class","label"),ee(e,"label-success",!!n[3])},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&oe(i,t),s&8&&ee(e,"label-success",!!l[3])},i:te,o:te,d(l){l&&y(e)}}}function XI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function QI(n){let e,t,i,l;const s=[sL,lL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function xI(n){let e,t,i,l,s,o,r,a;t=new $i({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&z_();return{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),s=B(n[3]),o=C(),u&&u.c(),r=ye(),p(l,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),w(l,s),v(f,o,c),u&&u.m(f,c),v(f,r,c),a=!0},p(f,c){const d={};c&8&&(d.value=f[3]),t.$set(d),(!a||c&8)&&oe(s,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=z_(),u.c(),u.m(r.parentNode,r)):u&&(u.d(1),u=null)},i(f){a||(O(t.$$.fragment,f),a=!0)},o(f){D(t.$$.fragment,f),a=!1},d(f){f&&(y(e),y(o),y(r)),H(t),u&&u.d(f)}}}function P_(n,e){let t,i,l;return i=new of({props:{record:e[0],filename:e[19],size:"sm"}}),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(s){l||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(i,s)}}}function N_(n){let e;return{c(){e=B("...")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function eL(n){let e,t=de(n[10].slice(0,n[12])),i=[];for(let l=0;lr[9]+r[7];for(let r=0;r500&&j_(n);return{c(){e=b("span"),i=B(t),l=C(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),r&&r.m(a,u),v(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=V.truncate(a[6],500,!0)+"")&&oe(i,t),a[6].length>500?r?(r.p(a,u),u&8&&O(r,1)):(r=j_(a),r.c(),O(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){o||(O(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(y(e),y(l),y(s)),r&&r.d(a)}}}function sL(n){let e,t=V.truncate(n[6])+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=V.truncate(l[6])+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function j_(n){let e,t;return e=new $i({props:{value:JSON.stringify(n[3],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function z_(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function oL(n){let e,t,i,l,s;const o=[xI,QI,XI,GI,ZI,JI,KI,YI,WI,BI,VI,UI,zI],r=[];function a(f,c){return c&8&&(e=null),f[1].primaryKey?0:f[1].type==="json"?1:(e==null&&(e=!!V.isEmpty(f[3])),e?2:f[1].type==="bool"?3:f[1].type==="number"?4:f[1].type==="url"?5:f[1].type==="editor"?6:f[1].type==="date"||f[1].type==="autodate"?7:f[1].type==="select"?8:f[1].type==="relation"?9:f[1].type==="file"?10:f[2]?11:12)}function u(f,c){return c===1?jI(f):c===9?HI(f):c===10?qI(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ye()},m(f,c){r[t].m(f,c),v(f,l,c),s=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),O(i,1),i.m(l.parentNode,l))},i(f){s||(O(i),s=!0)},o(f){D(i),s=!1},d(f){f&&y(l),r[t].d(f)}}}function rL(n,e,t){let i,l;Qe(n,Rr,u=>t(4,l=u));let{record:s}=e,{field:o}=e,{short:r=!1}=e;function a(u){Pe.call(this,n,u)}return n.$$set=u=>{"record"in u&&t(0,s=u.record),"field"in u&&t(1,o=u.field),"short"in u&&t(2,r=u.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[o.name])},[s,o,r,i,l,a]}class Sy extends Se{constructor(e){super(),we(this,e,rL,oL,ke,{record:0,field:1,short:2})}}function U_(n,e,t){const i=n.slice();return i[13]=e[t],i}function V_(n){let e,t,i=n[13].name+"",l,s,o,r,a,u;return r=new Sy({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=B(i),s=C(),o=b("td"),j(r.$$.fragment),a=C(),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,c){v(f,e,c),w(e,t),w(t,l),w(e,s),w(e,o),q(r,o,null),w(e,a),u=!0},p(f,c){(!u||c&1)&&i!==(i=f[13].name+"")&&oe(l,i);const d={};c&1&&(d.field=f[13]),c&8&&(d.record=f[3]),r.$set(d)},i(f){u||(O(r.$$.fragment,f),u=!0)},o(f){D(r.$$.fragment,f),u=!1},d(f){f&&y(e),H(r)}}}function aL(n){var r;let e,t,i,l=de((r=n[0])==null?void 0:r.fields),s=[];for(let a=0;aD(s[a],1,1,()=>{s[a]=null});return{c(){e=b("table"),t=b("tbody");for(let a=0;aClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[7]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function cL(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[fL],header:[uL],default:[aL]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function dL(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(_){return f(_),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.hide()}async function f(_){t(3,o={}),t(4,r=!0),t(3,o=await c(_)||{}),t(4,r=!1)}async function c(_){if(_&&typeof _=="string"){try{return await _e.collection(l.id).getOne(_)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),Ci(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function m(_){ie[_?"unshift":"push"](()=>{s=_,t(2,s)})}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,l=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=l==null?void 0:l.fields)!=null&&_.find(k=>k.type==="editor")))},[l,u,s,o,r,i,a,d,m,h,g]}class pL extends Se{constructor(e){super(),we(this,e,dL,cL,ke,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function mL(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){v(s,e,o),i||(l=Oe(t=qe.call(null,e,{text:n[0].join(` +`+V.truncate(JSON.stringify(V.truncateObject(E_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(M(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&y(e),H(t),u=!1,Ie(f)}}}function E_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function FI(n,e,t){let{record:i}=e;function l(o){Pe.call(this,n,o)}function s(o){Pe.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,l,s]}class Ur extends Se{constructor(e){super(),we(this,e,FI,RI,ke,{record:0})}}function D_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function I_(n,e,t){const i=n.slice();return i[14]=e[t],i}function L_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function A_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function qI(n){const e=n.slice(),t=V.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function HI(n){var s,o;const e=n.slice(),t=V.toArray(e[3]);e[10]=t;const i=V.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[11]=i;const l=e[2]?20:500;return e[12]=l,e}function jI(n){const e=n.slice(),t=V.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function zI(n){let e,t;return{c(){e=b("div"),t=B(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function UI(n){let e,t=V.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=V.truncate(n[3]))},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=V.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=V.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&y(e)}}}function VI(n){let e,t=[],i=new Map,l,s,o=de(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;un[18]&&N_();return{c(){e=b("div");for(let u=0;uu[18]?a||(a=N_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&ee(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;fn[12]&&q_();return{c(){e=b("div"),i.c(),l=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){v(f,e,c),r[t].m(e,null),w(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),M(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=q_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&y(e),r[t].d(),u&&u.d()}}}function WI(n){let e,t=[],i=new Map,l=de(V.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function JI(n){let e,t=V.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=B(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){v(o,e,r),w(e,i),l||(s=[Oe(qe.call(null,e,"Open in new tab")),W(e,"click",On(n[5]))],l=!0)},p(o,r){r&8&&t!==(t=V.truncate(o[3])+"")&&oe(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&y(e),l=!1,Ie(s)}}}function ZI(n){let e,t;return{c(){e=b("span"),t=B(n[3]),p(e,"class","txt")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function GI(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=B(t),p(e,"class","label"),ee(e,"label-success",!!n[3])},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&oe(i,t),s&8&&ee(e,"label-success",!!l[3])},i:te,o:te,d(l){l&&y(e)}}}function XI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function QI(n){let e,t,i,l;const s=[sL,lL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function xI(n){let e,t,i,l,s,o,r,a;t=new $i({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&z_();return{c(){e=b("div"),j(t.$$.fragment),i=C(),l=b("div"),s=B(n[3]),o=C(),u&&u.c(),r=ye(),p(l,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),w(l,s),v(f,o,c),u&&u.m(f,c),v(f,r,c),a=!0},p(f,c){const d={};c&8&&(d.value=f[3]),t.$set(d),(!a||c&8)&&oe(s,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=z_(),u.c(),u.m(r.parentNode,r)):u&&(u.d(1),u=null)},i(f){a||(M(t.$$.fragment,f),a=!0)},o(f){D(t.$$.fragment,f),a=!1},d(f){f&&(y(e),y(o),y(r)),H(t),u&&u.d(f)}}}function P_(n,e){let t,i,l;return i=new of({props:{record:e[0],filename:e[19],size:"sm"}}),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(i,s)}}}function N_(n){let e;return{c(){e=B("...")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function eL(n){let e,t=de(n[10].slice(0,n[12])),i=[];for(let l=0;lr[9]+r[7];for(let r=0;r500&&j_(n);return{c(){e=b("span"),i=B(t),l=C(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),r&&r.m(a,u),v(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=V.truncate(a[6],500,!0)+"")&&oe(i,t),a[6].length>500?r?(r.p(a,u),u&8&&M(r,1)):(r=j_(a),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){o||(M(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(y(e),y(l),y(s)),r&&r.d(a)}}}function sL(n){let e,t=V.truncate(n[6])+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=V.truncate(l[6])+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function j_(n){let e,t;return e=new $i({props:{value:JSON.stringify(n[3],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function z_(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function oL(n){let e,t,i,l,s;const o=[xI,QI,XI,GI,ZI,JI,KI,YI,WI,BI,VI,UI,zI],r=[];function a(f,c){return c&8&&(e=null),f[1].primaryKey?0:f[1].type==="json"?1:(e==null&&(e=!!V.isEmpty(f[3])),e?2:f[1].type==="bool"?3:f[1].type==="number"?4:f[1].type==="url"?5:f[1].type==="editor"?6:f[1].type==="date"||f[1].type==="autodate"?7:f[1].type==="select"?8:f[1].type==="relation"?9:f[1].type==="file"?10:f[2]?11:12)}function u(f,c){return c===1?jI(f):c===9?HI(f):c===10?qI(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ye()},m(f,c){r[t].m(f,c),v(f,l,c),s=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&y(l),r[t].d(f)}}}function rL(n,e,t){let i,l;Qe(n,Rr,u=>t(4,l=u));let{record:s}=e,{field:o}=e,{short:r=!1}=e;function a(u){Pe.call(this,n,u)}return n.$$set=u=>{"record"in u&&t(0,s=u.record),"field"in u&&t(1,o=u.field),"short"in u&&t(2,r=u.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[o.name])},[s,o,r,i,l,a]}class Sy extends Se{constructor(e){super(),we(this,e,rL,oL,ke,{record:0,field:1,short:2})}}function U_(n,e,t){const i=n.slice();return i[13]=e[t],i}function V_(n){let e,t,i=n[13].name+"",l,s,o,r,a,u;return r=new Sy({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=B(i),s=C(),o=b("td"),j(r.$$.fragment),a=C(),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,c){v(f,e,c),w(e,t),w(t,l),w(e,s),w(e,o),q(r,o,null),w(e,a),u=!0},p(f,c){(!u||c&1)&&i!==(i=f[13].name+"")&&oe(l,i);const d={};c&1&&(d.field=f[13]),c&8&&(d.record=f[3]),r.$set(d)},i(f){u||(M(r.$$.fragment,f),u=!0)},o(f){D(r.$$.fragment,f),u=!1},d(f){f&&y(e),H(r)}}}function aL(n){var r;let e,t,i,l=de((r=n[0])==null?void 0:r.fields),s=[];for(let a=0;aD(s[a],1,1,()=>{s[a]=null});return{c(){e=b("table"),t=b("tbody");for(let a=0;aClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[7]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function cL(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[fL],header:[uL],default:[aL]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function dL(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(_){return f(_),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.hide()}async function f(_){t(3,o={}),t(4,r=!0),t(3,o=await c(_)||{}),t(4,r=!1)}async function c(_){if(_&&typeof _=="string"){try{return await _e.collection(l.id).getOne(_)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),Ci(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function m(_){ie[_?"unshift":"push"](()=>{s=_,t(2,s)})}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,l=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=l==null?void 0:l.fields)!=null&&_.find(k=>k.type==="editor")))},[l,u,s,o,r,i,a,d,m,h,g]}class pL extends Se{constructor(e){super(),we(this,e,dL,cL,ke,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function mL(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){v(s,e,o),i||(l=Oe(t=qe.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(s,[o]){t&&It(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:te,o:te,d(s){s&&y(e),i=!1,l()}}}const hL="yyyy-MM-dd HH:mm:ss.SSS";function _L(n,e,t){let i,l;Qe(n,Mn,a=>t(2,l=a));let{record:s}=e,o=[];function r(){t(0,o=[]);const a=i.fields||[];for(let u of a)u.type=="autodate"&&o.push(u.name+": "+V.formatToLocalDate(s[u.name],hL)+" Local")}return n.$$set=a=>{"record"in a&&t(1,s=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=s&&l.find(a=>a.id==s.collectionId)),n.$$.dirty&2&&s&&r()},[o,s,l]}class gL extends Se{constructor(e){super(),we(this,e,_L,mL,ke,{record:1})}}function B_(n,e,t){const i=n.slice();return i[9]=e[t],i}function bL(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function kL(n){let e,t=de(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function W_(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,g,_,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=C(),o=b("span"),a=B(r),u=C(),f=b("div"),c=B("ID: "),m=B(d),h=C(),g=b("button"),g.innerHTML='',_=C(),bn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,M){v(T,e,M),w(e,t),w(t,i),w(e,s),w(e,o),w(o,a),w(e,u),w(e,f),w(f,c),w(f,m),w(e,h),w(e,g),w(e,_),k||(S=W(g,"click",$),k=!0)},p(T,M){var E;n=T,M&2&&!bn(i.src,l="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",l),M&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),M&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d(T){T&&y(e),k=!1,S()}}}function vL(n){let e;function t(s,o){var r;return s[2]?yL:(r=s[0])!=null&&r.id&&s[1].length?kL:bL}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function wL(n,e,t){const i=kt();let{record:l}=e,s=[],o=!1;function r(d){return tf.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||V.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await _e.collection("_externalAuths").getFullList({filter:_e.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){_e.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||_n(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>_e.collection("_externalAuths").delete(d.id).then(()=>{nn(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{_e.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class SL extends Se{constructor(e){super(),we(this,e,wL,vL,ke,{record:0})}}function TL(n){let e,t,i,l,s,o,r,a,u,f;return s=new $i({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=B(n[1]),l=C(),j(s.$$.fragment),o=C(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){v(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),q(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Oe(qe.call(null,r,"Refresh")),W(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(O(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&y(e),n[6](null),H(s),u=!1,Ie(f)}}}function $L(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[TL]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new jn({props:d}),ie.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){v(m,e,h),w(e,t),w(e,i),q(l,e,null),a=!0,u||(f=Oe(r=qe.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const g={};h&518&&(g.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,g.active=m[3],$e(()=>s=!1)),l.$set(g),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&It(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(O(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&y(e),H(l),u=!1,f()}}}function CL(n,e,t){const i=kt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=V.randomSecret(s)),i("generate",o),await dn(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){ie[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class OL extends Se{constructor(e){super(),we(this,e,CL,$L,ke,{class:0,length:5})}}function Y_(n){let e,t,i,l,s=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),l=B("Public: "),o=B(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class",r="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(e,"class","form-field-addon email-visibility-addon svelte-1751a4d")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Oe(qe.call(null,t,{text:"Make email public or private",position:"top-right"})),W(t,"click",nt(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&oe(o,s),c&1&&r!==(r="btn btn-sm btn-transparent "+(f[0].emailVisibility?"btn-success":"btn-hint"))&&p(t,"class",r)},d(f){f&&y(e),a=!1,Ie(u)}}}function ML(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&Y_(n);return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="email",o=C(),m&&m.c(),r=C(),a=b("input"),p(t,"class",V.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[14]),p(a,"type","email"),a.autofocus=n[1],p(a,"autocomplete","off"),p(a,"id",u=n[14]),a.required=f=n[4].required,p(a,"class","svelte-1751a4d")},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),m&&m.m(h,g),v(h,r,g),v(h,a,g),he(a,n[0].email),n[1]&&a.focus(),c||(d=W(a,"input",n[8]),c=!0)},p(h,g){g&16384&&s!==(s=h[14])&&p(e,"for",s),h[5]?m&&(m.d(1),m=null):m?m.p(h,g):(m=Y_(h),m.c(),m.m(r.parentNode,r)),g&2&&(a.autofocus=h[1]),g&16384&&u!==(u=h[14])&&p(a,"id",u),g&16&&f!==(f=h[4].required)&&(a.required=f),g&1&&a.value!==h[0].email&&he(a,h[0].email)},d(h){h&&(y(e),y(o),y(r),y(a)),m&&m.d(h),c=!1,d()}}}function K_(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[EL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function EL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function J_(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[DL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[IL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),ee(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&ee(t,"p-t-xs",f[2])},i(f){u||(O(l.$$.fragment,f),O(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),H(l),H(r),f&&a&&a.end()}}}function DL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new OL({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password",o=C(),r=b("input"),u=C(),f=b("div"),j(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0,p(f,"class","form-field-addon")},m(g,_){v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,o,_),v(g,r,_),he(r,n[0].password),v(g,u,_),v(g,f,_),q(c,f,null),d=!0,m||(h=W(r,"input",n[10]),m=!0)},p(g,_){(!d||_&16384&&s!==(s=g[14]))&&p(e,"for",s),(!d||_&16384&&a!==(a=g[14]))&&p(r,"id",a),_&1&&r.value!==g[0].password&&he(r,g[0].password);const k={};_&8&&(k.length=Math.max(15,g[3].min||0)),c.$set(k)},i(g){d||(O(c.$$.fragment,g),d=!0)},o(g){D(c.$$.fragment,g),d=!1},d(g){g&&(y(e),y(o),y(r),y(u),y(f)),H(c),m=!1,h()}}}function IL(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password confirm",o=C(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].passwordConfirm),u||(f=W(r,"input",n[11]),u=!0)},p(c,d){d&16384&&s!==(s=c[14])&&p(e,"for",s),d&16384&&a!==(a=c[14])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&he(r,c[0].passwordConfirm)},d(c){c&&(y(e),y(o),y(r)),u=!1,f()}}}function Z_(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[LL,({uniqueId:l})=>({14:l}),({uniqueId:l})=>l?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function LL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[0].verified,v(u,i,f),v(u,l,f),w(l,s),r||(a=[W(e,"change",n[12]),W(e,"change",nt(n[13]))],r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,Ie(a)}}}function AL(n){var d;let e,t,i,l,s,o,r,a;i=new fe({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[ML,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&K_(n),f=(n[1]||n[2])&&J_(n),c=!n[5]&&Z_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),u&&u.c(),o=C(),f&&f.c(),r=C(),c&&c.c(),p(t,"class","col-lg-12"),p(s,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(m,h){v(m,e,h),w(e,t),q(i,t,null),w(e,l),w(e,s),u&&u.m(s,null),w(s,o),f&&f.m(s,null),w(e,r),c&&c.m(e,null),a=!0},p(m,[h]){var _;const g={};h&16&&(g.class="form-field "+((_=m[4])!=null&&_.required?"required":"")),h&49203&&(g.$$scope={dirty:h,ctx:m}),i.$set(g),m[1]?u&&(re(),D(u,1,1,()=>{u=null}),ae()):u?(u.p(m,h),h&2&&O(u,1)):(u=K_(m),u.c(),O(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&O(f,1)):(f=J_(m),f.c(),O(f,1),f.m(s,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),m[5]?c&&(re(),D(c,1,1,()=>{c=null}),ae()):c?(c.p(m,h),h&32&&O(c,1)):(c=Z_(m),c.c(),O(c,1),c.m(e,null))},i(m){a||(O(i.$$.fragment,m),O(u),O(f),O(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&y(e),H(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function PL(n,e,t){let i,l,s,{record:o}=e,{collection:r}=e,{isNew:a=!(o!=null&&o.id)}=e,u=!1;const f=()=>t(0,o.emailVisibility=!o.emailVisibility,o);function c(){o.email=this.value,t(0,o),t(2,u)}function d(){u=this.checked,t(2,u)}function m(){o.password=this.value,t(0,o),t(2,u)}function h(){o.passwordConfirm=this.value,t(0,o),t(2,u)}function g(){o.verified=this.checked,t(0,o),t(2,u)}const _=k=>{a||_n("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!k.target.checked,o)})};return n.$$set=k=>{"record"in k&&t(0,o=k.record),"collection"in k&&t(6,r=k.collection),"isNew"in k&&t(1,a=k.isNew)},n.$$.update=()=>{var k,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,l=((k=r==null?void 0:r.fields)==null?void 0:k.find($=>$.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find($=>$.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),Yn("password"),Yn("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,g,_]}class NL extends Se{constructor(e){super(),we(this,e,PL,AL,ke,{record:0,collection:6,isNew:1})}}function G_(n){let e;function t(s,o){return s[1].primaryKey?FL:RL}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function RL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[1].type))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t=V.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function FL(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function X_(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function qL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&G_(n),f=n[1].hidden&&X_();const c=n[4].default,d=Lt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),s=B(l),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,h){v(m,e,h),u&&u.m(e,null),w(e,t),w(e,i),w(i,s),w(e,o),f&&f.m(e,null),w(e,r),d&&d.m(e,null),a=!0},p(m,[h]){m[2]?u?u.p(m,h):(u=G_(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&l!==(l=m[1].name+"")&&oe(s,l),m[1].hidden?f||(f=X_(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||h&8)&&Pt(d,c,m,m[3],a?At(c,m[3],h,null):Nt(m[3]),null),(!a||h&1)&&p(e,"for",m[0])},i(m){a||(O(d,m),a=!0)},o(m){D(d,m),a=!1},d(m){m&&y(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function HL(n,e,t){let{$$slots:i={},$$scope:l}=e,{uniqueId:s}=e,{field:o}=e,{icon:r=!0}=e;return n.$$set=a=>{"uniqueId"in a&&t(0,s=a.uniqueId),"field"in a&&t(1,o=a.field),"icon"in a&&t(2,r=a.icon),"$$scope"in a&&t(3,l=a.$$scope)},[s,o,r,l,i]}class ii extends Se{constructor(e){super(),we(this,e,HL,qL,ke,{uniqueId:0,field:1,icon:2})}}function jL(n){let e,t,i,l,s,o,r;return l=new ii({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),j(l.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){v(a,e,u),e.checked=n[0],v(a,i,u),q(l,a,u),s=!0,o||(r=W(e,"change",n[2]),o=!0)},p(a,u){(!s||u&8&&t!==(t=a[3]))&&p(e,"id",t),u&1&&(e.checked=a[0]);const f={};u&8&&(f.uniqueId=a[3]),u&2&&(f.field=a[1]),l.$set(f)},i(a){s||(O(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(y(e),y(i)),H(l,a),o=!1,r()}}}function zL(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UL(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class VL extends Se{constructor(e){super(),we(this,e,UL,zL,ke,{field:1,value:0})}}function Q_(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){v(s,e,o),w(e,t),i||(l=[Oe(qe.call(null,t,"Clear")),W(t,"click",n[5])],i=!0)},p:te,d(s){s&&y(e),i=!1,Ie(l)}}}function BL(n){let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&Q_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0]!==void 0&&(c.formattedValue=n[0]),l=new nf({props:c}),ie.push(()=>be(l,"value",u)),ie.push(()=>be(l,"formattedValue",f)),l.$on("close",n[3]),{c(){j(e.$$.fragment),t=C(),a&&a.c(),i=C(),j(l.$$.fragment)},m(d,m){q(e,d,m),v(d,t,m),a&&a.m(d,m),v(d,i,m),q(l,d,m),r=!0},p(d,m){const h={};m&256&&(h.uniqueId=d[8]),m&2&&(h.field=d[1]),e.$set(h),d[0]&&!d[1].required?a?a.p(d,m):(a=Q_(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const g={};m&256&&(g.id=d[8]),!s&&m&4&&(s=!0,g.value=d[2],$e(()=>s=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],$e(()=>o=!1)),l.$set(g)},i(d){r||(O(e.$$.fragment,d),O(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(y(t),y(i)),H(e,d),a&&a.d(d),H(l,d)}}}function WL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BL,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YL(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class KL extends Se{constructor(e){super(),we(this,e,YL,WL,ke,{field:1,value:0})}}function x_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function eg(n,e,t){const i=n.slice();return i[48]=e[t],i}function tg(n,e,t){const i=n.slice();return i[51]=e[t],i}function JL(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,g,_=de(n[7]);const k=S=>S[51].id;for(let S=0;S<_.length;S+=1){let $=tg(n,_,S),T=k($);l.set(T,i[S]=ng(T,$))}return a=new Hr({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Nu({props:{class:"files-list",vThreshold:100,$$slots:{default:[eA]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;SNew record',c=C(),j(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,$){v(S,e,$),w(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function ng(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=B(i),s=C(),p(t,"type","button"),p(t,"class","sidebar-item"),ee(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){v(u,t,f),w(t,l),w(t,s),o||(r=W(t,"click",nt(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&oe(l,i),f[0]&384&&ee(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&y(t),o=!1,r()}}}function GL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&ig(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){v(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=ig(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function XL(n){let e=[],t=new Map,i,l=de(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[17])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function QL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function xL(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),bn(e.src,t=_e.files.getURL(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){v(l,e,s)},p(l,s){s[0]&32&&!bn(e.src,t=_e.files.getURL(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&y(e)}}}function lg(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!V.hasImageExtension(f[48])),t?xL:QL}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=C(),p(e,"type","button"),p(e,"class","thumb handle"),ee(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){v(f,e,c),u.m(e,null),w(e,i),s||(o=[Oe(l=qe.call(null,e,n[48]+` +`),position:"left"})},i:te,o:te,d(s){s&&y(e),i=!1,l()}}}const hL="yyyy-MM-dd HH:mm:ss.SSS";function _L(n,e,t){let i,l;Qe(n,Mn,a=>t(2,l=a));let{record:s}=e,o=[];function r(){t(0,o=[]);const a=i.fields||[];for(let u of a)u.type=="autodate"&&o.push(u.name+": "+V.formatToLocalDate(s[u.name],hL)+" Local")}return n.$$set=a=>{"record"in a&&t(1,s=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=s&&l.find(a=>a.id==s.collectionId)),n.$$.dirty&2&&s&&r()},[o,s,l]}class gL extends Se{constructor(e){super(),we(this,e,_L,mL,ke,{record:1})}}function B_(n,e,t){const i=n.slice();return i[9]=e[t],i}function bL(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function kL(n){let e,t=de(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function W_(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,g,_,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=C(),o=b("span"),a=B(r),u=C(),f=b("div"),c=B("ID: "),m=B(d),h=C(),g=b("button"),g.innerHTML='',_=C(),bn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(e,s),w(e,o),w(o,a),w(e,u),w(e,f),w(f,c),w(f,m),w(e,h),w(e,g),w(e,_),k||(S=W(g,"click",$),k=!0)},p(T,O){var E;n=T,O&2&&!bn(i.src,l="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",l),O&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),O&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d(T){T&&y(e),k=!1,S()}}}function vL(n){let e;function t(s,o){var r;return s[2]?yL:(r=s[0])!=null&&r.id&&s[1].length?kL:bL}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function wL(n,e,t){const i=kt();let{record:l}=e,s=[],o=!1;function r(d){return tf.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||V.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await _e.collection("_externalAuths").getFullList({filter:_e.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){_e.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||_n(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>_e.collection("_externalAuths").delete(d.id).then(()=>{nn(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{_e.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class SL extends Se{constructor(e){super(),we(this,e,wL,vL,ke,{record:0})}}function TL(n){let e,t,i,l,s,o,r,a,u,f;return s=new $i({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=B(n[1]),l=C(),j(s.$$.fragment),o=C(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){v(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),q(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Oe(qe.call(null,r,"Refresh")),W(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(M(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&y(e),n[6](null),H(s),u=!1,Ie(f)}}}function $L(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[TL]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new jn({props:d}),ie.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){v(m,e,h),w(e,t),w(e,i),q(l,e,null),a=!0,u||(f=Oe(r=qe.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const g={};h&518&&(g.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,g.active=m[3],$e(()=>s=!1)),l.$set(g),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&It(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(M(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&y(e),H(l),u=!1,f()}}}function CL(n,e,t){const i=kt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=V.randomSecret(s)),i("generate",o),await dn(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){ie[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class OL extends Se{constructor(e){super(),we(this,e,CL,$L,ke,{class:0,length:5})}}function Y_(n){let e,t,i,l,s=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),l=B("Public: "),o=B(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class",r="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(e,"class","form-field-addon email-visibility-addon svelte-1751a4d")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Oe(qe.call(null,t,{text:"Make email public or private",position:"top-right"})),W(t,"click",nt(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&oe(o,s),c&1&&r!==(r="btn btn-sm btn-transparent "+(f[0].emailVisibility?"btn-success":"btn-hint"))&&p(t,"class",r)},d(f){f&&y(e),a=!1,Ie(u)}}}function ML(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&Y_(n);return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="email",o=C(),m&&m.c(),r=C(),a=b("input"),p(t,"class",V.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[14]),p(a,"type","email"),a.autofocus=n[1],p(a,"autocomplete","off"),p(a,"id",u=n[14]),a.required=f=n[4].required,p(a,"class","svelte-1751a4d")},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),m&&m.m(h,g),v(h,r,g),v(h,a,g),he(a,n[0].email),n[1]&&a.focus(),c||(d=W(a,"input",n[8]),c=!0)},p(h,g){g&16384&&s!==(s=h[14])&&p(e,"for",s),h[5]?m&&(m.d(1),m=null):m?m.p(h,g):(m=Y_(h),m.c(),m.m(r.parentNode,r)),g&2&&(a.autofocus=h[1]),g&16384&&u!==(u=h[14])&&p(a,"id",u),g&16&&f!==(f=h[4].required)&&(a.required=f),g&1&&a.value!==h[0].email&&he(a,h[0].email)},d(h){h&&(y(e),y(o),y(r),y(a)),m&&m.d(h),c=!1,d()}}}function K_(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[EL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function EL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function J_(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[DL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[IL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),ee(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&ee(t,"p-t-xs",f[2])},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),H(l),H(r),f&&a&&a.end()}}}function DL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new OL({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password",o=C(),r=b("input"),u=C(),f=b("div"),j(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0,p(f,"class","form-field-addon")},m(g,_){v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,o,_),v(g,r,_),he(r,n[0].password),v(g,u,_),v(g,f,_),q(c,f,null),d=!0,m||(h=W(r,"input",n[10]),m=!0)},p(g,_){(!d||_&16384&&s!==(s=g[14]))&&p(e,"for",s),(!d||_&16384&&a!==(a=g[14]))&&p(r,"id",a),_&1&&r.value!==g[0].password&&he(r,g[0].password);const k={};_&8&&(k.length=Math.max(15,g[3].min||0)),c.$set(k)},i(g){d||(M(c.$$.fragment,g),d=!0)},o(g){D(c.$$.fragment,g),d=!1},d(g){g&&(y(e),y(o),y(r),y(u),y(f)),H(c),m=!1,h()}}}function IL(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="Password confirm",o=C(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].passwordConfirm),u||(f=W(r,"input",n[11]),u=!0)},p(c,d){d&16384&&s!==(s=c[14])&&p(e,"for",s),d&16384&&a!==(a=c[14])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&he(r,c[0].passwordConfirm)},d(c){c&&(y(e),y(o),y(r)),u=!1,f()}}}function Z_(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[LL,({uniqueId:l})=>({14:l}),({uniqueId:l})=>l?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function LL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[0].verified,v(u,i,f),v(u,l,f),w(l,s),r||(a=[W(e,"change",n[12]),W(e,"change",nt(n[13]))],r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&16384&&o!==(o=u[14])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,Ie(a)}}}function AL(n){var d;let e,t,i,l,s,o,r,a;i=new fe({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[ML,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&K_(n),f=(n[1]||n[2])&&J_(n),c=!n[5]&&Z_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),u&&u.c(),o=C(),f&&f.c(),r=C(),c&&c.c(),p(t,"class","col-lg-12"),p(s,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(m,h){v(m,e,h),w(e,t),q(i,t,null),w(e,l),w(e,s),u&&u.m(s,null),w(s,o),f&&f.m(s,null),w(e,r),c&&c.m(e,null),a=!0},p(m,[h]){var _;const g={};h&16&&(g.class="form-field "+((_=m[4])!=null&&_.required?"required":"")),h&49203&&(g.$$scope={dirty:h,ctx:m}),i.$set(g),m[1]?u&&(re(),D(u,1,1,()=>{u=null}),ae()):u?(u.p(m,h),h&2&&M(u,1)):(u=K_(m),u.c(),M(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&M(f,1)):(f=J_(m),f.c(),M(f,1),f.m(s,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),m[5]?c&&(re(),D(c,1,1,()=>{c=null}),ae()):c?(c.p(m,h),h&32&&M(c,1)):(c=Z_(m),c.c(),M(c,1),c.m(e,null))},i(m){a||(M(i.$$.fragment,m),M(u),M(f),M(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&y(e),H(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function PL(n,e,t){let i,l,s,{record:o}=e,{collection:r}=e,{isNew:a=!(o!=null&&o.id)}=e,u=!1;const f=()=>t(0,o.emailVisibility=!o.emailVisibility,o);function c(){o.email=this.value,t(0,o),t(2,u)}function d(){u=this.checked,t(2,u)}function m(){o.password=this.value,t(0,o),t(2,u)}function h(){o.passwordConfirm=this.value,t(0,o),t(2,u)}function g(){o.verified=this.checked,t(0,o),t(2,u)}const _=k=>{a||_n("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!k.target.checked,o)})};return n.$$set=k=>{"record"in k&&t(0,o=k.record),"collection"in k&&t(6,r=k.collection),"isNew"in k&&t(1,a=k.isNew)},n.$$.update=()=>{var k,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,l=((k=r==null?void 0:r.fields)==null?void 0:k.find($=>$.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find($=>$.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),Yn("password"),Yn("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,g,_]}class NL extends Se{constructor(e){super(),we(this,e,PL,AL,ke,{record:0,collection:6,isNew:1})}}function G_(n){let e;function t(s,o){return s[1].primaryKey?FL:RL}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function RL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[1].type))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t=V.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function FL(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function X_(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function qL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&G_(n),f=n[1].hidden&&X_();const c=n[4].default,d=Lt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),s=B(l),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,h){v(m,e,h),u&&u.m(e,null),w(e,t),w(e,i),w(i,s),w(e,o),f&&f.m(e,null),w(e,r),d&&d.m(e,null),a=!0},p(m,[h]){m[2]?u?u.p(m,h):(u=G_(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&l!==(l=m[1].name+"")&&oe(s,l),m[1].hidden?f||(f=X_(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||h&8)&&Pt(d,c,m,m[3],a?At(c,m[3],h,null):Nt(m[3]),null),(!a||h&1)&&p(e,"for",m[0])},i(m){a||(M(d,m),a=!0)},o(m){D(d,m),a=!1},d(m){m&&y(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function HL(n,e,t){let{$$slots:i={},$$scope:l}=e,{uniqueId:s}=e,{field:o}=e,{icon:r=!0}=e;return n.$$set=a=>{"uniqueId"in a&&t(0,s=a.uniqueId),"field"in a&&t(1,o=a.field),"icon"in a&&t(2,r=a.icon),"$$scope"in a&&t(3,l=a.$$scope)},[s,o,r,l,i]}class ii extends Se{constructor(e){super(),we(this,e,HL,qL,ke,{uniqueId:0,field:1,icon:2})}}function jL(n){let e,t,i,l,s,o,r;return l=new ii({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),j(l.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){v(a,e,u),e.checked=n[0],v(a,i,u),q(l,a,u),s=!0,o||(r=W(e,"change",n[2]),o=!0)},p(a,u){(!s||u&8&&t!==(t=a[3]))&&p(e,"id",t),u&1&&(e.checked=a[0]);const f={};u&8&&(f.uniqueId=a[3]),u&2&&(f.field=a[1]),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(y(e),y(i)),H(l,a),o=!1,r()}}}function zL(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UL(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class VL extends Se{constructor(e){super(),we(this,e,UL,zL,ke,{field:1,value:0})}}function Q_(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){v(s,e,o),w(e,t),i||(l=[Oe(qe.call(null,t,"Clear")),W(t,"click",n[5])],i=!0)},p:te,d(s){s&&y(e),i=!1,Ie(l)}}}function BL(n){let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&Q_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0]!==void 0&&(c.formattedValue=n[0]),l=new nf({props:c}),ie.push(()=>be(l,"value",u)),ie.push(()=>be(l,"formattedValue",f)),l.$on("close",n[3]),{c(){j(e.$$.fragment),t=C(),a&&a.c(),i=C(),j(l.$$.fragment)},m(d,m){q(e,d,m),v(d,t,m),a&&a.m(d,m),v(d,i,m),q(l,d,m),r=!0},p(d,m){const h={};m&256&&(h.uniqueId=d[8]),m&2&&(h.field=d[1]),e.$set(h),d[0]&&!d[1].required?a?a.p(d,m):(a=Q_(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const g={};m&256&&(g.id=d[8]),!s&&m&4&&(s=!0,g.value=d[2],$e(()=>s=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],$e(()=>o=!1)),l.$set(g)},i(d){r||(M(e.$$.fragment,d),M(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(y(t),y(i)),H(e,d),a&&a.d(d),H(l,d)}}}function WL(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BL,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YL(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class KL extends Se{constructor(e){super(),we(this,e,YL,WL,ke,{field:1,value:0})}}function x_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function eg(n,e,t){const i=n.slice();return i[48]=e[t],i}function tg(n,e,t){const i=n.slice();return i[51]=e[t],i}function JL(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,g,_=de(n[7]);const k=S=>S[51].id;for(let S=0;S<_.length;S+=1){let $=tg(n,_,S),T=k($);l.set(T,i[S]=ng(T,$))}return a=new Hr({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Nu({props:{class:"files-list",vThreshold:100,$$slots:{default:[eA]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;SNew record',c=C(),j(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,$){v(S,e,$),w(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function ng(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=B(i),s=C(),p(t,"type","button"),p(t,"class","sidebar-item"),ee(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){v(u,t,f),w(t,l),w(t,s),o||(r=W(t,"click",nt(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&oe(l,i),f[0]&384&&ee(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&y(t),o=!1,r()}}}function GL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&ig(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){v(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=ig(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function XL(n){let e=[],t=new Map,i,l=de(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[17])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function QL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function xL(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),bn(e.src,t=_e.files.getURL(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){v(l,e,s)},p(l,s){s[0]&32&&!bn(e.src,t=_e.files.getURL(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&y(e)}}}function lg(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!V.hasImageExtension(f[48])),t?xL:QL}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=C(),p(e,"type","button"),p(e,"class","thumb handle"),ee(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){v(f,e,c),u.m(e,null),w(e,i),s||(o=[Oe(l=qe.call(null,e,n[48]+` (record: `+n[44].id+")")),W(e,"click",nt(function(){It(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&It(l.update)&&c[0]&32&&l.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&ee(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&y(e),u.d(),s=!1,Ie(o)}}}function sg(n,e){let t,i,l=de(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function eA(n){let e,t;function i(r,a){if(r[15])return XL;if(!r[6])return GL}let l=i(n),s=l&&l(n),o=n[6]&&og();return{c(){s&&s.c(),e=C(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),v(r,e,a),o&&o.m(r,a),v(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=og(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(y(e),y(t)),s&&s.d(r),o&&o.d(r)}}}function tA(n){let e,t,i,l;const s=[ZL,JL],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function nA(n){let e,t;return{c(){e=b("h4"),t=B(n[0])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&y(e)}}}function rg(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[iA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function iA(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function lA(n){var h;let e,t,i,l=V.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&rg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),m&&m.c(),s=C(),o=b("button"),r=b("span"),a=B(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){v(g,e,_),w(e,t),v(g,i,_),m&&m.m(g,_),v(g,s,_),v(g,o,_),w(o,r),w(r,a),f=!0,c||(d=[W(e,"click",n[2]),W(o,"click",n[21])],c=!0)},p(g,_){var k;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=V.hasImageExtension((k=g[9])==null?void 0:k.name)),l?m?(m.p(g,_),_[0]&512&&O(m,1)):(m=rg(g),m.c(),O(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&oe(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(O(m),f=!0)},o(g){D(m),f=!1},d(g){g&&(y(e),y(i),y(s),y(o)),m&&m.d(g),c=!1,Ie(d)}}}function sA(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[lA],header:[nA],default:[tA]},$$scope:{ctx:n}};for(let a=0;at(27,u=Ve));const f=kt(),c="file_picker_"+V.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,g,_,k="",S=[],$=1,T=0,M=!1,E=[],L=[],I=[],A={},P={},N="";function R(){return J(!0),g==null?void 0:g.show()}function z(){return g==null?void 0:g.hide()}function F(){t(5,S=[]),t(9,P={}),t(12,N="")}function U(){t(4,k="")}async function J(Ve=!1){if(A!=null&&A.id){t(6,M=!0),Ve&&F();try{const Ee=Ve?1:$+1,st=V.getAllCollectionIdentifiers(A);let De=V.normalizeSearchFilter(k,st)||"";De&&(De+=" && "),De+="("+L.map(Ce=>`${Ce.name}:length>0`).join("||")+")";let Ye="";A.type!="view"&&(Ye="-@rowid");const ve=await _e.collection(A.id).getList(Ee,ag,{filter:De,sort:Ye,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=V.filterDuplicatesByKey(S.concat(ve.items))),$=ve.page,t(26,T=ve.items.length),t(6,M=!1)}catch(Ee){Ee.isAbort||(_e.error(Ee),t(6,M=!1))}}}function Y(){var Ee;let Ve=["100x100"];if((Ee=P==null?void 0:P.record)!=null&&Ee.id){for(const st of L)if(V.toArray(P.record[st.name]).includes(P.name)){Ve=Ve.concat(V.toArray(st.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const st of Ve)I.push({label:`${st} thumb`,value:st});N&&!Ve.includes(N)&&t(12,N="")}function Z(Ve){let Ee=[];for(const st of L){const De=V.toArray(Ve[st.name]);for(const Ye of De)h.includes(V.getFileType(Ye))&&Ee.push(Ye)}return Ee}function G(Ve,Ee){t(9,P={record:Ve,name:Ee})}function pe(){o&&(f("submit",Object.assign({size:N},P)),z())}function ce(Ve){N=Ve,t(12,N)}const ue=Ve=>{t(8,A=Ve)},Te=Ve=>t(4,k=Ve.detail),Ke=()=>_==null?void 0:_.show(),Je=()=>{s&&J()};function ft(Ve){ie[Ve?"unshift":"push"](()=>{g=Ve,t(3,g)})}function et(Ve){Pe.call(this,n,Ve)}function xe(Ve){Pe.call(this,n,Ve)}function We(Ve){ie[Ve?"unshift":"push"](()=>{_=Ve,t(10,_)})}const at=Ve=>{V.removeByKey(S,"id",Ve.detail.record.id),S.unshift(Ve.detail.record),t(5,S);const Ee=Z(Ve.detail.record);Ee.length>0&&G(Ve.detail.record,Ee[0])},jt=Ve=>{var Ee;((Ee=P==null?void 0:P.record)==null?void 0:Ee.id)==Ve.detail.id&&t(9,P={}),V.removeByKey(S,"id",Ve.detail.id),t(5,S)};return n.$$set=Ve=>{e=je(je({},e),Wt(Ve)),t(22,a=lt(e,r)),"title"in Ve&&t(0,d=Ve.title),"submitText"in Ve&&t(1,m=Ve.submitText),"fileTypes"in Ve&&t(24,h=Ve.fileTypes)},n.$$.update=()=>{var Ve;n.$$.dirty[0]&134217728&&t(7,E=u.filter(Ee=>Ee.type!=="view"&&!!V.toArray(Ee.fields).find(st=>{var De,Ye;return st.type==="file"&&!st.protected&&(!((De=st.mimeTypes)!=null&&De.length)||!!((Ye=st.mimeTypes)!=null&&Ye.find(ve=>ve.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&E.length>0&&t(8,A=E[0]),n.$$.dirty[0]&256&&(L=(Ve=A==null?void 0:A.fields)==null?void 0:Ve.filter(Ee=>Ee.type==="file"&&!Ee.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(U(),Y()),n.$$.dirty[0]&512&&P!=null&&P.name&&Y(),n.$$.dirty[0]&280&&typeof k<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(Ee,st)=>{var De;return(P==null?void 0:P.name)==st&&((De=P==null?void 0:P.record)==null?void 0:De.id)==Ee.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Ee=>Z(Ee).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!M&&T==ag),n.$$.dirty[0]&576&&t(13,o=!M&&!!(P!=null&&P.name))},[d,m,z,g,k,S,M,E,A,P,_,I,N,o,s,l,i,U,J,Z,G,pe,a,c,h,R,T,u,ce,ue,Te,Ke,Je,ft,et,xe,We,at,jt]}class rA extends Se{constructor(e){super(),we(this,e,oA,sA,ke,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function aA(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function uA(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Cu({props:s}),ie.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function fA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[11],field:n[1]}});const r=[uA,aA],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ye()},m(f,c){q(e,f,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){const d={};c&2048&&(d.uniqueId=f[11]),c&2&&(d.field=f[1]),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(e.$$.fragment,f),O(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(y(t),y(s)),H(e,f),a[i].d(f)}}}function cA(n){let e,t,i,l;e=new fe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fA,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new rA({props:s}),n[8](i),i.$on("submit",n[9]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(O(e.$$.fragment,o),O(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&y(t),H(e,o),n[8](null),H(i,o)}}}function dA(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Xt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ie[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,_e.files.getURL(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=Object.assign(V.defaultEditorOptions(),{convert_urls:l.convertURLs,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class pA extends Se{constructor(e){super(),we(this,e,dA,cA,ke,{field:1,value:0})}}function mA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","email"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function hA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[mA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _A(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class gA extends Se{constructor(e){super(),we(this,e,_A,hA,ke,{field:1,value:0})}}function bA(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&y(e)}}}function kA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),bn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){v(l,e,s)},p(l,s){s&4&&!bn(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&y(e)}}}function yA(n){let e;function t(s,o){return s[2]?kA:bA}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function vA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){V.hasImageExtension(l==null?void 0:l.name)?V.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class wA extends Se{constructor(e){super(),we(this,e,vA,yA,ke,{file:0,size:1})}}function ug(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function fg(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function SA(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,"Remove file")),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function TA(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){v(s,e,o),t||(i=W(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,i()}}}function $A(n){let e,t,i,l,s,o,r=n[34]+"",a,u,f,c,d,m;i=new of({props:{record:n[3],filename:n[34]}});function h(k,S){return k[35]?TA:SA}let g=h(n),_=g(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("a"),a=B(r),c=C(),d=b("div"),_.c(),ee(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=_e.files.getURL(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[32]),ee(e,"dragover",n[33])},m(k,S){v(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,c),w(e,d),_.m(d,null),m=!0},p(k,S){const $={};S[0]&8&&($.record=k[3]),S[0]&32&&($.filename=k[34]),i.$set($),(!m||S[0]&36)&&ee(t,"fade",k[35]),(!m||S[0]&32)&&r!==(r=k[34]+"")&&oe(a,r),(!m||S[0]&1064&&u!==(u=_e.files.getURL(k[3],k[34],{token:k[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(k[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),g===(g=h(k))&&_?_.p(k,S):(_.d(1),_=g(k),_&&(_.c(),_.m(d,null))),(!m||S[1]&2)&&ee(e,"dragging",k[32]),(!m||S[1]&4)&&ee(e,"dragover",k[33])},i(k){m||(O(i.$$.fragment,k),m=!0)},o(k){D(i.$$.fragment,k),m=!1},d(k){k&&y(e),H(i),_.d()}}}function cg(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[$A,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.list=e[0],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function CA(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,h,g,_;i=new wA({props:{file:n[29]}});function k(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),j(i.$$.fragment),l=C(),s=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=B(u),d=C(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),ee(e,"dragging",n[32]),ee(e,"dragover",n[33])},m(S,$){v(S,e,$),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(s,r),w(s,a),w(a,f),w(e,d),w(e,m),h=!0,g||(_=[Oe(qe.call(null,m,"Remove file")),W(m,"click",k)],g=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[29]),i.$set(T),(!h||$[0]&2)&&u!==(u=n[29].name+"")&&oe(f,u),(!h||$[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||$[1]&2)&&ee(e,"dragging",n[32]),(!h||$[1]&4)&&ee(e,"dragover",n[33])},i(S){h||(O(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&y(e),H(i),g=!1,Ie(_)}}}function dg(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[CA,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&2&&(l=!0,f.list=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function OA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,g,_,k,S,$,T;e=new ii({props:{uniqueId:n[28],field:n[4]}});let M=de(n[5]);const E=A=>A[34]+A[3].id;for(let A=0;AA[29].name+A[31];for(let A=0;A',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function eA(n){let e,t;function i(r,a){if(r[15])return XL;if(!r[6])return GL}let l=i(n),s=l&&l(n),o=n[6]&&og();return{c(){s&&s.c(),e=C(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),v(r,e,a),o&&o.m(r,a),v(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=og(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(y(e),y(t)),s&&s.d(r),o&&o.d(r)}}}function tA(n){let e,t,i,l;const s=[ZL,JL],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function nA(n){let e,t;return{c(){e=b("h4"),t=B(n[0])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&y(e)}}}function rg(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[iA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function iA(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function lA(n){var h;let e,t,i,l=V.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&rg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),m&&m.c(),s=C(),o=b("button"),r=b("span"),a=B(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){v(g,e,_),w(e,t),v(g,i,_),m&&m.m(g,_),v(g,s,_),v(g,o,_),w(o,r),w(r,a),f=!0,c||(d=[W(e,"click",n[2]),W(o,"click",n[21])],c=!0)},p(g,_){var k;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=V.hasImageExtension((k=g[9])==null?void 0:k.name)),l?m?(m.p(g,_),_[0]&512&&M(m,1)):(m=rg(g),m.c(),M(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&oe(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(M(m),f=!0)},o(g){D(m),f=!1},d(g){g&&(y(e),y(i),y(s),y(o)),m&&m.d(g),c=!1,Ie(d)}}}function sA(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[lA],header:[nA],default:[tA]},$$scope:{ctx:n}};for(let a=0;at(27,u=Ve));const f=kt(),c="file_picker_"+V.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,g,_,k="",S=[],$=1,T=0,O=!1,E=[],L=[],I=[],A={},P={},N="";function R(){return J(!0),g==null?void 0:g.show()}function z(){return g==null?void 0:g.hide()}function F(){t(5,S=[]),t(9,P={}),t(12,N="")}function U(){t(4,k="")}async function J(Ve=!1){if(A!=null&&A.id){t(6,O=!0),Ve&&F();try{const Ee=Ve?1:$+1,st=V.getAllCollectionIdentifiers(A);let De=V.normalizeSearchFilter(k,st)||"";De&&(De+=" && "),De+="("+L.map(Ce=>`${Ce.name}:length>0`).join("||")+")";let Ye="";A.type!="view"&&(Ye="-@rowid");const ve=await _e.collection(A.id).getList(Ee,ag,{filter:De,sort:Ye,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=V.filterDuplicatesByKey(S.concat(ve.items))),$=ve.page,t(26,T=ve.items.length),t(6,O=!1)}catch(Ee){Ee.isAbort||(_e.error(Ee),t(6,O=!1))}}}function Y(){var Ee;let Ve=["100x100"];if((Ee=P==null?void 0:P.record)!=null&&Ee.id){for(const st of L)if(V.toArray(P.record[st.name]).includes(P.name)){Ve=Ve.concat(V.toArray(st.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const st of Ve)I.push({label:`${st} thumb`,value:st});N&&!Ve.includes(N)&&t(12,N="")}function Z(Ve){let Ee=[];for(const st of L){const De=V.toArray(Ve[st.name]);for(const Ye of De)h.includes(V.getFileType(Ye))&&Ee.push(Ye)}return Ee}function G(Ve,Ee){t(9,P={record:Ve,name:Ee})}function pe(){o&&(f("submit",Object.assign({size:N},P)),z())}function ce(Ve){N=Ve,t(12,N)}const ue=Ve=>{t(8,A=Ve)},Te=Ve=>t(4,k=Ve.detail),Ke=()=>_==null?void 0:_.show(),Je=()=>{s&&J()};function ft(Ve){ie[Ve?"unshift":"push"](()=>{g=Ve,t(3,g)})}function et(Ve){Pe.call(this,n,Ve)}function xe(Ve){Pe.call(this,n,Ve)}function We(Ve){ie[Ve?"unshift":"push"](()=>{_=Ve,t(10,_)})}const at=Ve=>{V.removeByKey(S,"id",Ve.detail.record.id),S.unshift(Ve.detail.record),t(5,S);const Ee=Z(Ve.detail.record);Ee.length>0&&G(Ve.detail.record,Ee[0])},jt=Ve=>{var Ee;((Ee=P==null?void 0:P.record)==null?void 0:Ee.id)==Ve.detail.id&&t(9,P={}),V.removeByKey(S,"id",Ve.detail.id),t(5,S)};return n.$$set=Ve=>{e=je(je({},e),Wt(Ve)),t(22,a=lt(e,r)),"title"in Ve&&t(0,d=Ve.title),"submitText"in Ve&&t(1,m=Ve.submitText),"fileTypes"in Ve&&t(24,h=Ve.fileTypes)},n.$$.update=()=>{var Ve;n.$$.dirty[0]&134217728&&t(7,E=u.filter(Ee=>Ee.type!=="view"&&!!V.toArray(Ee.fields).find(st=>{var De,Ye;return st.type==="file"&&!st.protected&&(!((De=st.mimeTypes)!=null&&De.length)||!!((Ye=st.mimeTypes)!=null&&Ye.find(ve=>ve.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&E.length>0&&t(8,A=E[0]),n.$$.dirty[0]&256&&(L=(Ve=A==null?void 0:A.fields)==null?void 0:Ve.filter(Ee=>Ee.type==="file"&&!Ee.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(U(),Y()),n.$$.dirty[0]&512&&P!=null&&P.name&&Y(),n.$$.dirty[0]&280&&typeof k<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(Ee,st)=>{var De;return(P==null?void 0:P.name)==st&&((De=P==null?void 0:P.record)==null?void 0:De.id)==Ee.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Ee=>Z(Ee).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!O&&T==ag),n.$$.dirty[0]&576&&t(13,o=!O&&!!(P!=null&&P.name))},[d,m,z,g,k,S,O,E,A,P,_,I,N,o,s,l,i,U,J,Z,G,pe,a,c,h,R,T,u,ce,ue,Te,Ke,Je,ft,et,xe,We,at,jt]}class rA extends Se{constructor(e){super(),we(this,e,oA,sA,ke,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function aA(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function uA(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Cu({props:s}),ie.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function fA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[11],field:n[1]}});const r=[uA,aA],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ye()},m(f,c){q(e,f,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){const d={};c&2048&&(d.uniqueId=f[11]),c&2&&(d.field=f[1]),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(y(t),y(s)),H(e,f),a[i].d(f)}}}function cA(n){let e,t,i,l;e=new fe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fA,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new rA({props:s}),n[8](i),i.$on("submit",n[9]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&y(t),H(e,o),n[8](null),H(i,o)}}}function dA(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Xt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ie[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,_e.files.getURL(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=Object.assign(V.defaultEditorOptions(),{convert_urls:l.convertURLs,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class pA extends Se{constructor(e){super(),we(this,e,dA,cA,ke,{field:1,value:0})}}function mA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","email"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function hA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[mA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _A(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class gA extends Se{constructor(e){super(),we(this,e,_A,hA,ke,{field:1,value:0})}}function bA(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&y(e)}}}function kA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),bn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){v(l,e,s)},p(l,s){s&4&&!bn(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&y(e)}}}function yA(n){let e;function t(s,o){return s[2]?kA:bA}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function vA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){V.hasImageExtension(l==null?void 0:l.name)?V.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class wA extends Se{constructor(e){super(),we(this,e,vA,yA,ke,{file:0,size:1})}}function ug(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function fg(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function SA(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,"Remove file")),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function TA(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){v(s,e,o),t||(i=W(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,i()}}}function $A(n){let e,t,i,l,s,o,r=n[34]+"",a,u,f,c,d,m;i=new of({props:{record:n[3],filename:n[34]}});function h(k,S){return k[35]?TA:SA}let g=h(n),_=g(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("a"),a=B(r),c=C(),d=b("div"),_.c(),ee(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=_e.files.getURL(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[32]),ee(e,"dragover",n[33])},m(k,S){v(k,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,c),w(e,d),_.m(d,null),m=!0},p(k,S){const $={};S[0]&8&&($.record=k[3]),S[0]&32&&($.filename=k[34]),i.$set($),(!m||S[0]&36)&&ee(t,"fade",k[35]),(!m||S[0]&32)&&r!==(r=k[34]+"")&&oe(a,r),(!m||S[0]&1064&&u!==(u=_e.files.getURL(k[3],k[34],{token:k[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(k[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),g===(g=h(k))&&_?_.p(k,S):(_.d(1),_=g(k),_&&(_.c(),_.m(d,null))),(!m||S[1]&2)&&ee(e,"dragging",k[32]),(!m||S[1]&4)&&ee(e,"dragover",k[33])},i(k){m||(M(i.$$.fragment,k),m=!0)},o(k){D(i.$$.fragment,k),m=!1},d(k){k&&y(e),H(i),_.d()}}}function cg(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[$A,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.list=e[0],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function CA(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,h,g,_;i=new wA({props:{file:n[29]}});function k(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),j(i.$$.fragment),l=C(),s=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=B(u),d=C(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),ee(e,"dragging",n[32]),ee(e,"dragover",n[33])},m(S,$){v(S,e,$),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(s,r),w(s,a),w(a,f),w(e,d),w(e,m),h=!0,g||(_=[Oe(qe.call(null,m,"Remove file")),W(m,"click",k)],g=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[29]),i.$set(T),(!h||$[0]&2)&&u!==(u=n[29].name+"")&&oe(f,u),(!h||$[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!h||$[1]&2)&&ee(e,"dragging",n[32]),(!h||$[1]&4)&&ee(e,"dragover",n[33])},i(S){h||(M(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&y(e),H(i),g=!1,Ie(_)}}}function dg(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[CA,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&2&&(l=!0,f.list=e[1],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function OA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,g,_,k,S,$,T;e=new ii({props:{uniqueId:n[28],field:n[4]}});let O=de(n[5]);const E=A=>A[34]+A[3].id;for(let A=0;AA[29].name+A[31];for(let A=0;Ae in n?Dy(n,e,{enumerable:!0,config form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(O(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&y(e),H(t),l=!1,Ie(s)}}}function EA(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,h="";function g(U){V.removeByValue(f,U),t(2,f)}function _(U){V.pushUnique(f,U),t(2,f)}function k(U){V.isEmpty(u[U])||u.splice(U,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(U){var Y;U.preventDefault(),t(9,m=!1);const J=((Y=U.dataTransfer)==null?void 0:Y.files)||[];if(!(s||!J.length)){for(const Z of J){const G=l.length+u.length-f.length;if(r.maxSelect<=G)break;u.push(Z)}t(1,u)}}Xt(async()=>{t(10,h=await _e.getSuperuserFileToken(o.collectionId))});const T=U=>g(U),M=U=>_(U);function E(U){a=U,t(0,a),t(6,i),t(4,r)}const L=U=>k(U);function I(U){u=U,t(1,u)}function A(U){ie[U?"unshift":"push"](()=>{c=U,t(7,c)})}const P=()=>{for(let U of c.files)u.push(U);t(1,u),t(7,c.value=null,c)},N=()=>c==null?void 0:c.click();function R(U){ie[U?"unshift":"push"](()=>{d=U,t(8,d)})}const z=()=>{t(9,m=!0)},F=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,u=U.uploadedFiles),"deletedFileNames"in U&&t(2,f=U.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=V.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,h,s,g,_,k,$,T,M,E,L,I,A,P,N,R,z,F]}class DA extends Se{constructor(e){super(),we(this,e,EA,MA,ke,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function IA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function LA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function AA(n){let e,t,i,l;function s(a,u){return a[4]?LA:IA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){v(a,e,u),r.m(e,null),i||(l=Oe(t=qe.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&It(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&y(e),r.d(),i=!1,l()}}}function PA(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function NA(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=zt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ye()},m(o,r){e&&q(e,o,r),v(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ae()}l?(e=zt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),O(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&O(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&y(t),e&&H(e,o)}}}function RA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[6],field:n[1],$$slots:{default:[AA]},$$scope:{ctx:n}}});const r=[NA,PA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ye()},m(f,c){q(e,f,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(e.$$.fragment,f),O(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(y(t),y(s)),H(e,f),a[i].d(f)}}}function FA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pg(n){return typeof n=="string"&&Ty(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Ty(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function qA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=pg(s);Xt(async()=>{try{t(3,o=(await Tt(async()=>{const{default:u}=await import("./CodeEditor-7pyapRXP.js");return{default:u}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=pg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Ty(r))},[s,l,r,o,i,a]}class HA extends Se{constructor(e){super(),we(this,e,qA,FA,ke,{field:1,value:0})}}function jA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),v(c,t,d),v(c,i,d),he(i,n[0]),a=!0,u||(f=W(i,"input",n[2]),u=!0)},p(c,d){const m={};d&8&&(m.uniqueId=c[3]),d&2&&(m.field=c[1]),e.$set(m),(!a||d&8&&l!==(l=c[3]))&&p(i,"id",l),(!a||d&2&&s!==(s=c[1].required))&&(i.required=s),(!a||d&2&&o!==(o=c[1].min))&&p(i,"min",o),(!a||d&2&&r!==(r=c[1].max))&&p(i,"max",r),d&1&>(i.value)!==c[0]&&he(i,c[0])},i(c){a||(O(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(y(t),y(i)),H(e,c),u=!1,f()}}}function zA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class VA extends Se{constructor(e){super(),we(this,e,UA,zA,ke,{field:1,value:0})}}function BA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function WA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class KA extends Se{constructor(e){super(),we(this,e,YA,WA,ke,{field:1,value:0})}}function mg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function JA(n,e){e=mg(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=mg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function hg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function _g(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function gg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[31]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function bg(n){let e,t=!n[13]&&kg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=kg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function kg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&yg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){v(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=yg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function yg(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-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ZA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function GA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function vg(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){v(o,e,r),w(e,t),i||(l=[Oe(qe.call(null,t,"Edit")),W(t,"keydown",On(n[27])),W(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&y(e),i=!1,Ie(l)}}}function wg(n,e){let t,i,l,s,o,r,a,u;function f(_,k){return _[6]?GA:ZA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&vg(e);function h(){return e[33](e[50])}function g(..._){return e[34](e[50],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),j(s.$$.fragment),o=C(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),ee(t,"selected",e[6]),ee(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,k){v(_,t,k),d.m(t,null),w(t,i),w(t,l),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[W(t,"click",h),W(t,"keydown",g)],a=!0)},p(_,k){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=vg(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&ee(t,"selected",e[6]),(!r||k[0]&1808)&&ee(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(O(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&y(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function Sg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=B("("),i=B(t),l=B(" of MAX "),s=B(n[4]),o=B(")")},m(r,a){v(r,e,a),v(r,i,a),v(r,l,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(y(e),y(i),y(l),y(s),y(o))}}}function XA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function QA(n){let e,t,i=de(n[6]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),ee(e,"label-danger",n[53]),ee(e,"label-warning",n[54])},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),v(f,s,c),o=!0,r||(a=W(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[50]),t.$set(d),(!o||c[1]&4194304)&&ee(e,"label-danger",n[53]),(!o||c[1]&8388608)&&ee(e,"label-warning",n[54])},i(f){o||(O(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(y(e),y(s)),H(t),r=!1,a()}}}function $g(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[xA,({dragging:o,dragover:r})=>({53:o,54:r}),({dragging:o,dragover:r})=>[0,(o?4194304:0)|(r?8388608:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new _o({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eP(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,k,S,$;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&gg(n),M=de(n[8]);const E=z=>z[50].id;for(let z=0;z1&&Tg(n);const P=[QA,XA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),g=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=C(),T&&T.c(),l=C(),s=b("div");for(let z=0;z1?A?A.p(z,F):(A=Tg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(z),h===J?N[h].p(z,F):(re(),D(N[J],1,1,()=>{N[J]=null}),ae(),g=N[h],g?g.p(z,F):(g=N[h]=P[h](z),g.c()),O(g,1),g.m(_.parentNode,_))},i(z){if(!k){O(t.$$.fragment,z);for(let F=0;FCancel',t=C(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[W(e,"click",n[28]),W(i,"click",n[29])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function iP(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[nP],header:[tP],default:[eP]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ce));const h=kt(),g="picker_"+V.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",M=[],E=[],L=1,I=0,A=!1,P=!1;function N(){return t(2,T=""),t(8,M=[]),t(6,E=[]),F(),U(!0),S==null?void 0:S.show()}function R(){return S==null?void 0:S.hide()}function z(){var Ht;let Ce="";const ct=(Ht=s==null?void 0:s.fields)==null?void 0:Ht.filter(Le=>!Le.hidden&&Le.presentable&&Le.type=="relation");for(const Le of ct){const ot=V.getExpandPresentableRelField(Le,m,2);ot&&(Ce!=""&&(Ce+=","),Ce+=ot)}return Ce}async function F(){const Ce=V.toArray(_);if(!l||!Ce.length)return;t(24,P=!0);let ct=[];const Ht=Ce.slice(),Le=[];for(;Ht.length>0;){const ot=[];for(const on of Ht.splice(0,Go))ot.push(`id="${on}"`);Le.push(_e.collection(l).getFullList({batch:Go,filter:ot.join("||"),fields:"*:excerpt(200)",expand:z(),requestKey:null}))}try{await Promise.all(Le).then(ot=>{ct=ct.concat(...ot)}),t(6,E=[]);for(const ot of Ce){const on=V.findByKey(ct,"id",ot);on&&E.push(on)}T.trim()||t(8,M=V.filterDuplicatesByKey(E.concat(M))),t(24,P=!1)}catch(ot){ot.isAbort||(_e.error(ot),t(24,P=!1))}}async function U(Ce=!1){if(l){t(3,A=!0),Ce&&(T.trim()?t(8,M=[]):t(8,M=V.toArray(E).slice()));try{const ct=Ce?1:L+1,Ht=V.getAllCollectionIdentifiers(s);let Le="";o||(Le="-@rowid");const ot=await _e.collection(l).getList(ct,Go,{filter:V.normalizeSearchFilter(T,Ht),sort:Le,fields:"*:excerpt(200)",skipTotal:1,expand:z(),requestKey:g+"loadList"});t(8,M=V.filterDuplicatesByKey(M.concat(ot.items))),L=ot.page,t(23,I=ot.items.length),t(3,A=!1)}catch(ct){ct.isAbort||(_e.error(ct),t(3,A=!1))}}}function J(Ce){i==1?t(6,E=[Ce]):u&&(V.pushOrReplaceByKey(E,Ce),t(6,E))}function Y(Ce){V.removeByKey(E,"id",Ce.id),t(6,E)}function Z(Ce){f(Ce)?Y(Ce):J(Ce)}function G(){var Ce;i!=1?t(20,_=E.map(ct=>ct.id)):t(20,_=((Ce=E==null?void 0:E[0])==null?void 0:Ce.id)||""),h("save",E),R()}function pe(Ce){Pe.call(this,n,Ce)}const ce=()=>R(),ue=()=>G(),Te=Ce=>t(2,T=Ce.detail),Ke=()=>$==null?void 0:$.show(),Je=Ce=>$==null?void 0:$.show(Ce.id),ft=Ce=>Z(Ce),et=(Ce,ct)=>{(ct.code==="Enter"||ct.code==="Space")&&(ct.preventDefault(),ct.stopPropagation(),Z(Ce))},xe=()=>t(2,T=""),We=()=>{a&&!A&&U()},at=Ce=>Y(Ce);function jt(Ce){E=Ce,t(6,E)}function Ve(Ce){ie[Ce?"unshift":"push"](()=>{S=Ce,t(1,S)})}function Ee(Ce){Pe.call(this,n,Ce)}function st(Ce){Pe.call(this,n,Ce)}function De(Ce){ie[Ce?"unshift":"push"](()=>{$=Ce,t(7,$)})}const Ye=Ce=>{V.removeByKey(M,"id",Ce.detail.record.id),M.unshift(Ce.detail.record),t(8,M),J(Ce.detail.record)},ve=Ce=>{V.removeByKey(M,"id",Ce.detail.id),t(8,M),Y(Ce.detail)};return n.$$set=Ce=>{e=je(je({},e),Wt(Ce)),t(19,d=lt(e,c)),"value"in Ce&&t(20,_=Ce.value),"field"in Ce&&t(21,k=Ce.field)},n.$$.update=()=>{n.$$.dirty[0]&2097152&&t(4,i=(k==null?void 0:k.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=k==null?void 0:k.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Ce=>Ce.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&U(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=A||P),n.$$.dirty[0]&8388608&&t(12,a=I==Go),n.$$.dirty[0]&80&&t(10,u=i<=0||i>E.length),n.$$.dirty[0]&64&&t(9,f=function(Ce){return V.findByKey(E,"id",Ce.id)})},[R,S,T,A,i,s,E,$,M,f,u,o,a,r,U,J,Y,Z,G,d,_,k,N,I,P,l,m,pe,ce,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ve]}class sP extends Se{constructor(e){super(),we(this,e,lP,iP,ke,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Cg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function Og(n,e,t){const i=n.slice();return i[27]=e[t],i}function Mg(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){v(s,e,o),i||(l=Oe(t=qe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&It(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&y(e),i=!1,l()}}}function oP(n){let e,t=n[6].length&&Mg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=Mg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Eg(n){let e,t=n[5]&&Dg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Dg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Dg(n){let e,t=de(V.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function rP(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[25]),ee(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Oe(qe.call(null,o,"Remove")),W(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&ee(e,"dragging",n[25]),(!a||m&67108864)&&ee(e,"dragover",n[26])},i(d){a||(O(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(y(e),y(r)),H(i),u=!1,Ie(f)}}}function Lg(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[rP,({dragging:a,dragover:u})=>({25:a,26:u}),({dragging:a,dragover:u})=>(a?33554432:0)|(u?67108864:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function aP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ii({props:{uniqueId:n[21],field:n[2],$$slots:{default:[oP]},$$scope:{ctx:n}}});let m=de(n[4]);const h=_=>_[22].id;for(let _=0;_ Open picker',p(l,"class","relations-list svelte-1ynw0pc"),p(u,"type","button"),p(u,"class","btn btn-transparent btn-sm btn-block"),p(a,"class","list-item list-item-btn"),p(i,"class","list")},m(_,k){q(e,_,k),v(_,t,k),v(_,i,k),w(i,l);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new sP({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&1075839223&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(O(e.$$.fragment,r),O(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&y(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Ag=100;function fP(n,e,t){let i,l;Qe(n,Mn,I=>t(18,l=I));let{field:s}=e,{value:o}=e,{picker:r}=e,a,u=[],f=!1,c,d=[];function m(){if(f)return!1;const I=V.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var z,F;const I=V.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(U=>U.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(U=>!U.hidden&&U.presentable&&U.type=="relation");for(const U of P){const J=V.getExpandPresentableRelField(U,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=I.slice(),R=[];for(;N.length>0;){const U=[];for(const J of N.splice(0,Ag))U.push(`id="${J}"`);R.push(_e.collection(s.collectionId).getFullList(Ag,{filter:U.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let U=[];await Promise.all(R).then(J=>{U=U.concat(...J)});for(const J of I){const Y=V.findByKey(U,"id",J);Y?u.push(Y):d.push(J)}t(4,u),_()}catch(U){_e.error(U)}t(5,f=!1)}function g(I){V.removeByKey(u,"id",I.id),t(4,u),_()}function _(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}oo(()=>{clearTimeout(c)});const k=I=>g(I);function S(I){u=I,t(4,u)}const $=()=>{_()},T=()=>r==null?void 0:r.show();function M(I){ie[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(I){ie[I?"unshift":"push"](()=>{r=I,t(1,r)})}const L=I=>{var A;t(4,u=I.detail||[]),t(0,o=i?u.map(P=>P.id):((A=u[0])==null?void 0:A.id)||"")};return n.$$set=I=>{"field"in I&&t(2,s=I.field),"value"in I&&t(0,o=I.value),"picker"in I&&t(1,r=I.picker)},n.$$.update=()=>{n.$$.dirty&4&&t(7,i=s.maxSelect>1),n.$$.dirty&9&&typeof o<"u"&&(a==null||a.changed()),n.$$.dirty&1041&&m()&&(t(5,f=!0),clearTimeout(c),t(10,c=setTimeout(h,0)))},[o,r,s,a,u,f,d,i,g,_,c,k,S,$,T,M,E,L]}class cP extends Se{constructor(e){super(),we(this,e,fP,uP,ke,{field:2,value:0,picker:1})}}function Pg(n){let e,t,i,l;return{c(){e=b("div"),t=B("Select up to "),i=B(n[2]),l=B(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&oe(i,s[2])},d(s){s&&y(e)}}}function dP(n){var c,d;let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[5],field:n[1]}});function a(m){n[4](m)}let u={id:n[5],toggle:!n[1].required||n[3],multiple:n[3],closable:!n[3]||((c=n[0])==null?void 0:c.length)>=n[1].maxSelect,items:n[1].values,searchable:((d=n[1].values)==null?void 0:d.length)>5};n[0]!==void 0&&(u.selected=n[0]),i=new ps({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Pg(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),s=C(),f&&f.c(),o=ye()},m(m,h){q(e,m,h),v(m,t,h),q(i,m,h),v(m,s,h),f&&f.m(m,h),v(m,o,h),r=!0},p(m,h){var k,S;const g={};h&32&&(g.uniqueId=m[5]),h&2&&(g.field=m[1]),e.$set(g);const _={};h&32&&(_.id=m[5]),h&10&&(_.toggle=!m[1].required||m[3]),h&8&&(_.multiple=m[3]),h&11&&(_.closable=!m[3]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),h&2&&(_.items=m[1].values),h&2&&(_.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,_.selected=m[0],$e(()=>l=!1)),i.$set(_),m[3]?f?f.p(m,h):(f=Pg(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(O(e.$$.fragment,m),O(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(y(t),y(s),y(o)),H(e,m),H(i,m),f&&f.d(m)}}}function pP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mP(n,e,t){let i,l,{field:s}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,s),t(2,l)}return n.$$set=a=>{"field"in a&&t(1,s=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=s.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,l=s.maxSelect||s.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>s.values.includes(a))),o.length>l&&t(0,o=o.slice(o.length-l)))},[o,s,l,i,r]}class hP extends Se{constructor(e){super(),we(this,e,mP,pP,ke,{field:1,value:0})}}function _P(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Xt(()=>(u(),()=>clearTimeout(a)));function c(m){ie[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(3,l=lt(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class bP extends Se{constructor(e){super(),we(this,e,gP,_P,ke,{value:0,maxHeight:4})}}function kP(n){let e,t,i,l,s;e=new ii({props:{uniqueId:n[6],field:n[1]}});function o(a){n[5](a)}let r={id:n[6],required:n[3],placeholder:n[2]?"Leave empty to autogenerate...":""};return n[0]!==void 0&&(r.value=n[0]),i=new bP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],$e(()=>l=!1)),i.$set(c)},i(a){s||(O(e.$$.fragment,a),O(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(e,a),H(i,a)}}}function yP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[kP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function vP(n,e,t){let i,l,{original:s}=e,{field:o}=e,{value:r=void 0}=e;function a(u){r=u,t(0,r)}return n.$$set=u=>{"original"in u&&t(4,s=u.original),"field"in u&&t(1,o=u.field),"value"in u&&t(0,r=u.value)},n.$$.update=()=>{n.$$.dirty&18&&t(2,i=!V.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class wP extends Se{constructor(e){super(),we(this,e,vP,yP,ke,{original:4,field:1,value:0})}}function SP(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(O(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function TP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $P(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class CP extends Se{constructor(e){super(),we(this,e,$P,TP,ke,{field:1,value:0})}}function Ng(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=B(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(f,c){v(f,t,c),w(t,i),w(i,s),w(t,o),r||(a=W(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&oe(s,l),c&6&&ee(t,"active",e[1]===e[6].language)},d(f){f&&y(t),r=!1,a()}}}function qg(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new xu({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=B(a),f=B(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(s,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,g){e=h;const _={};g&4&&(_.language=e[6].language),g&4&&(_.content=e[6].content),i.$set(_),(!m||g&4)&&a!==(a=e[6].title+"")&&oe(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&ee(t,"active",e[1]===e[6].language)},i(h){m||(O(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&y(t),H(i)}}}function OP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=de(n[2]);const d=g=>g[6].language;for(let g=0;gg[6].language;for(let g=0;gt(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,l=u.class),"js"in u&&t(3,s=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(Hg,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:s,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[l,r,i,s,o,a]}class EP extends Se{constructor(e){super(),we(this,e,MP,OP,ke,{class:0,js:3,dart:4})}}function DP(n){let e,t,i,l,s,o=V.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[LP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=B(`Generate a non-refreshable auth token for - `),s=b("strong"),r=B(o),a=B(":"),u=C(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=W(e,"submit",nt(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=V.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(O(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&y(e),H(f),d=!1,m()}}}function IP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new $i({props:{value:n[3].authStore.token}}),u=new EP({props:{class:"m-b-0",js:` + `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(M(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&y(e),H(t),l=!1,Ie(s)}}}function EA(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,h="";function g(U){V.removeByValue(f,U),t(2,f)}function _(U){V.pushUnique(f,U),t(2,f)}function k(U){V.isEmpty(u[U])||u.splice(U,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(U){var Y;U.preventDefault(),t(9,m=!1);const J=((Y=U.dataTransfer)==null?void 0:Y.files)||[];if(!(s||!J.length)){for(const Z of J){const G=l.length+u.length-f.length;if(r.maxSelect<=G)break;u.push(Z)}t(1,u)}}Xt(async()=>{t(10,h=await _e.getSuperuserFileToken(o.collectionId))});const T=U=>g(U),O=U=>_(U);function E(U){a=U,t(0,a),t(6,i),t(4,r)}const L=U=>k(U);function I(U){u=U,t(1,u)}function A(U){ie[U?"unshift":"push"](()=>{c=U,t(7,c)})}const P=()=>{for(let U of c.files)u.push(U);t(1,u),t(7,c.value=null,c)},N=()=>c==null?void 0:c.click();function R(U){ie[U?"unshift":"push"](()=>{d=U,t(8,d)})}const z=()=>{t(9,m=!0)},F=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,u=U.uploadedFiles),"deletedFileNames"in U&&t(2,f=U.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=V.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,h,s,g,_,k,$,T,O,E,L,I,A,P,N,R,z,F]}class DA extends Se{constructor(e){super(),we(this,e,EA,MA,ke,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function IA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function LA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function AA(n){let e,t,i,l;function s(a,u){return a[4]?LA:IA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){v(a,e,u),r.m(e,null),i||(l=Oe(t=qe.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&It(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&y(e),r.d(),i=!1,l()}}}function PA(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function NA(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=zt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ye()},m(o,r){e&&q(e,o,r),v(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ae()}l?(e=zt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&y(t),e&&H(e,o)}}}function RA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[6],field:n[1],$$slots:{default:[AA]},$$scope:{ctx:n}}});const r=[NA,PA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ye()},m(f,c){q(e,f,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(y(t),y(s)),H(e,f),a[i].d(f)}}}function FA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pg(n){return typeof n=="string"&&Ty(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Ty(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function qA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=pg(s);Xt(async()=>{try{t(3,o=(await Tt(async()=>{const{default:u}=await import("./CodeEditor-Bfa8qogr.js");return{default:u}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=pg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Ty(r))},[s,l,r,o,i,a]}class HA extends Se{constructor(e){super(),we(this,e,qA,FA,ke,{field:1,value:0})}}function jA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),v(c,t,d),v(c,i,d),he(i,n[0]),a=!0,u||(f=W(i,"input",n[2]),u=!0)},p(c,d){const m={};d&8&&(m.uniqueId=c[3]),d&2&&(m.field=c[1]),e.$set(m),(!a||d&8&&l!==(l=c[3]))&&p(i,"id",l),(!a||d&2&&s!==(s=c[1].required))&&(i.required=s),(!a||d&2&&o!==(o=c[1].min))&&p(i,"min",o),(!a||d&2&&r!==(r=c[1].max))&&p(i,"max",r),d&1&>(i.value)!==c[0]&&he(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(y(t),y(i)),H(e,c),u=!1,f()}}}function zA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class VA extends Se{constructor(e){super(),we(this,e,UA,zA,ke,{field:1,value:0})}}function BA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function WA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class KA extends Se{constructor(e){super(),we(this,e,YA,WA,ke,{field:1,value:0})}}function mg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function JA(n,e){e=mg(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=mg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function hg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function _g(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function gg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[31]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function bg(n){let e,t=!n[13]&&kg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=kg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function kg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&yg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){v(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=yg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function yg(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-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ZA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function GA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function vg(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){v(o,e,r),w(e,t),i||(l=[Oe(qe.call(null,t,"Edit")),W(t,"keydown",On(n[27])),W(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&y(e),i=!1,Ie(l)}}}function wg(n,e){let t,i,l,s,o,r,a,u;function f(_,k){return _[6]?GA:ZA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&vg(e);function h(){return e[33](e[50])}function g(..._){return e[34](e[50],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),j(s.$$.fragment),o=C(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),ee(t,"selected",e[6]),ee(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,k){v(_,t,k),d.m(t,null),w(t,i),w(t,l),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[W(t,"click",h),W(t,"keydown",g)],a=!0)},p(_,k){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=vg(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&ee(t,"selected",e[6]),(!r||k[0]&1808)&&ee(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(M(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&y(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function Sg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=B("("),i=B(t),l=B(" of MAX "),s=B(n[4]),o=B(")")},m(r,a){v(r,e,a),v(r,i,a),v(r,l,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(y(e),y(i),y(l),y(s),y(o))}}}function XA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function QA(n){let e,t,i=de(n[6]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),ee(e,"label-danger",n[53]),ee(e,"label-warning",n[54])},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),v(f,s,c),o=!0,r||(a=W(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[50]),t.$set(d),(!o||c[1]&4194304)&&ee(e,"label-danger",n[53]),(!o||c[1]&8388608)&&ee(e,"label-warning",n[54])},i(f){o||(M(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(y(e),y(s)),H(t),r=!1,a()}}}function $g(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[xA,({dragging:o,dragover:r})=>({53:o,54:r}),({dragging:o,dragover:r})=>[0,(o?4194304:0)|(r?8388608:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new _o({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eP(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,k,S,$;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&gg(n),O=de(n[8]);const E=z=>z[50].id;for(let z=0;z1&&Tg(n);const P=[QA,XA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),g=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=C(),T&&T.c(),l=C(),s=b("div");for(let z=0;z1?A?A.p(z,F):(A=Tg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(z),h===J?N[h].p(z,F):(re(),D(N[J],1,1,()=>{N[J]=null}),ae(),g=N[h],g?g.p(z,F):(g=N[h]=P[h](z),g.c()),M(g,1),g.m(_.parentNode,_))},i(z){if(!k){M(t.$$.fragment,z);for(let F=0;FCancel',t=C(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[W(e,"click",n[28]),W(i,"click",n[29])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function iP(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[nP],header:[tP],default:[eP]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ce));const h=kt(),g="picker_"+V.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",O=[],E=[],L=1,I=0,A=!1,P=!1;function N(){return t(2,T=""),t(8,O=[]),t(6,E=[]),F(),U(!0),S==null?void 0:S.show()}function R(){return S==null?void 0:S.hide()}function z(){var Ht;let Ce="";const ct=(Ht=s==null?void 0:s.fields)==null?void 0:Ht.filter(Le=>!Le.hidden&&Le.presentable&&Le.type=="relation");for(const Le of ct){const ot=V.getExpandPresentableRelField(Le,m,2);ot&&(Ce!=""&&(Ce+=","),Ce+=ot)}return Ce}async function F(){const Ce=V.toArray(_);if(!l||!Ce.length)return;t(24,P=!0);let ct=[];const Ht=Ce.slice(),Le=[];for(;Ht.length>0;){const ot=[];for(const on of Ht.splice(0,Go))ot.push(`id="${on}"`);Le.push(_e.collection(l).getFullList({batch:Go,filter:ot.join("||"),fields:"*:excerpt(200)",expand:z(),requestKey:null}))}try{await Promise.all(Le).then(ot=>{ct=ct.concat(...ot)}),t(6,E=[]);for(const ot of Ce){const on=V.findByKey(ct,"id",ot);on&&E.push(on)}T.trim()||t(8,O=V.filterDuplicatesByKey(E.concat(O))),t(24,P=!1)}catch(ot){ot.isAbort||(_e.error(ot),t(24,P=!1))}}async function U(Ce=!1){if(l){t(3,A=!0),Ce&&(T.trim()?t(8,O=[]):t(8,O=V.toArray(E).slice()));try{const ct=Ce?1:L+1,Ht=V.getAllCollectionIdentifiers(s);let Le="";o||(Le="-@rowid");const ot=await _e.collection(l).getList(ct,Go,{filter:V.normalizeSearchFilter(T,Ht),sort:Le,fields:"*:excerpt(200)",skipTotal:1,expand:z(),requestKey:g+"loadList"});t(8,O=V.filterDuplicatesByKey(O.concat(ot.items))),L=ot.page,t(23,I=ot.items.length),t(3,A=!1)}catch(ct){ct.isAbort||(_e.error(ct),t(3,A=!1))}}}function J(Ce){i==1?t(6,E=[Ce]):u&&(V.pushOrReplaceByKey(E,Ce),t(6,E))}function Y(Ce){V.removeByKey(E,"id",Ce.id),t(6,E)}function Z(Ce){f(Ce)?Y(Ce):J(Ce)}function G(){var Ce;i!=1?t(20,_=E.map(ct=>ct.id)):t(20,_=((Ce=E==null?void 0:E[0])==null?void 0:Ce.id)||""),h("save",E),R()}function pe(Ce){Pe.call(this,n,Ce)}const ce=()=>R(),ue=()=>G(),Te=Ce=>t(2,T=Ce.detail),Ke=()=>$==null?void 0:$.show(),Je=Ce=>$==null?void 0:$.show(Ce.id),ft=Ce=>Z(Ce),et=(Ce,ct)=>{(ct.code==="Enter"||ct.code==="Space")&&(ct.preventDefault(),ct.stopPropagation(),Z(Ce))},xe=()=>t(2,T=""),We=()=>{a&&!A&&U()},at=Ce=>Y(Ce);function jt(Ce){E=Ce,t(6,E)}function Ve(Ce){ie[Ce?"unshift":"push"](()=>{S=Ce,t(1,S)})}function Ee(Ce){Pe.call(this,n,Ce)}function st(Ce){Pe.call(this,n,Ce)}function De(Ce){ie[Ce?"unshift":"push"](()=>{$=Ce,t(7,$)})}const Ye=Ce=>{V.removeByKey(O,"id",Ce.detail.record.id),O.unshift(Ce.detail.record),t(8,O),J(Ce.detail.record)},ve=Ce=>{V.removeByKey(O,"id",Ce.detail.id),t(8,O),Y(Ce.detail)};return n.$$set=Ce=>{e=je(je({},e),Wt(Ce)),t(19,d=lt(e,c)),"value"in Ce&&t(20,_=Ce.value),"field"in Ce&&t(21,k=Ce.field)},n.$$.update=()=>{n.$$.dirty[0]&2097152&&t(4,i=(k==null?void 0:k.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=k==null?void 0:k.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Ce=>Ce.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&U(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=A||P),n.$$.dirty[0]&8388608&&t(12,a=I==Go),n.$$.dirty[0]&80&&t(10,u=i<=0||i>E.length),n.$$.dirty[0]&64&&t(9,f=function(Ce){return V.findByKey(E,"id",Ce.id)})},[R,S,T,A,i,s,E,$,O,f,u,o,a,r,U,J,Y,Z,G,d,_,k,N,I,P,l,m,pe,ce,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ve]}class sP extends Se{constructor(e){super(),we(this,e,lP,iP,ke,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Cg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function Og(n,e,t){const i=n.slice();return i[27]=e[t],i}function Mg(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){v(s,e,o),i||(l=Oe(t=qe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&It(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&y(e),i=!1,l()}}}function oP(n){let e,t=n[6].length&&Mg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=Mg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Eg(n){let e,t=n[5]&&Dg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Dg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Dg(n){let e,t=de(V.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function rP(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[25]),ee(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Oe(qe.call(null,o,"Remove")),W(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&ee(e,"dragging",n[25]),(!a||m&67108864)&&ee(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(y(e),y(r)),H(i),u=!1,Ie(f)}}}function Lg(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[rP,({dragging:a,dragover:u})=>({25:a,26:u}),({dragging:a,dragover:u})=>(a?33554432:0)|(u?67108864:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function aP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ii({props:{uniqueId:n[21],field:n[2],$$slots:{default:[oP]},$$scope:{ctx:n}}});let m=de(n[4]);const h=_=>_[22].id;for(let _=0;_ Open picker',p(l,"class","relations-list svelte-1ynw0pc"),p(u,"type","button"),p(u,"class","btn btn-transparent btn-sm btn-block"),p(a,"class","list-item list-item-btn"),p(i,"class","list")},m(_,k){q(e,_,k),v(_,t,k),v(_,i,k),w(i,l);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new sP({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&1075839223&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&y(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Ag=100;function fP(n,e,t){let i,l;Qe(n,Mn,I=>t(18,l=I));let{field:s}=e,{value:o}=e,{picker:r}=e,a,u=[],f=!1,c,d=[];function m(){if(f)return!1;const I=V.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var z,F;const I=V.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(U=>U.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(U=>!U.hidden&&U.presentable&&U.type=="relation");for(const U of P){const J=V.getExpandPresentableRelField(U,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=I.slice(),R=[];for(;N.length>0;){const U=[];for(const J of N.splice(0,Ag))U.push(`id="${J}"`);R.push(_e.collection(s.collectionId).getFullList(Ag,{filter:U.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let U=[];await Promise.all(R).then(J=>{U=U.concat(...J)});for(const J of I){const Y=V.findByKey(U,"id",J);Y?u.push(Y):d.push(J)}t(4,u),_()}catch(U){_e.error(U)}t(5,f=!1)}function g(I){V.removeByKey(u,"id",I.id),t(4,u),_()}function _(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}oo(()=>{clearTimeout(c)});const k=I=>g(I);function S(I){u=I,t(4,u)}const $=()=>{_()},T=()=>r==null?void 0:r.show();function O(I){ie[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(I){ie[I?"unshift":"push"](()=>{r=I,t(1,r)})}const L=I=>{var A;t(4,u=I.detail||[]),t(0,o=i?u.map(P=>P.id):((A=u[0])==null?void 0:A.id)||"")};return n.$$set=I=>{"field"in I&&t(2,s=I.field),"value"in I&&t(0,o=I.value),"picker"in I&&t(1,r=I.picker)},n.$$.update=()=>{n.$$.dirty&4&&t(7,i=s.maxSelect>1),n.$$.dirty&9&&typeof o<"u"&&(a==null||a.changed()),n.$$.dirty&1041&&m()&&(t(5,f=!0),clearTimeout(c),t(10,c=setTimeout(h,0)))},[o,r,s,a,u,f,d,i,g,_,c,k,S,$,T,O,E,L]}class cP extends Se{constructor(e){super(),we(this,e,fP,uP,ke,{field:2,value:0,picker:1})}}function Pg(n){let e,t,i,l;return{c(){e=b("div"),t=B("Select up to "),i=B(n[2]),l=B(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&oe(i,s[2])},d(s){s&&y(e)}}}function dP(n){var c,d;let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[5],field:n[1]}});function a(m){n[4](m)}let u={id:n[5],toggle:!n[1].required||n[3],multiple:n[3],closable:!n[3]||((c=n[0])==null?void 0:c.length)>=n[1].maxSelect,items:n[1].values,searchable:((d=n[1].values)==null?void 0:d.length)>5};n[0]!==void 0&&(u.selected=n[0]),i=new ps({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Pg(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),s=C(),f&&f.c(),o=ye()},m(m,h){q(e,m,h),v(m,t,h),q(i,m,h),v(m,s,h),f&&f.m(m,h),v(m,o,h),r=!0},p(m,h){var k,S;const g={};h&32&&(g.uniqueId=m[5]),h&2&&(g.field=m[1]),e.$set(g);const _={};h&32&&(_.id=m[5]),h&10&&(_.toggle=!m[1].required||m[3]),h&8&&(_.multiple=m[3]),h&11&&(_.closable=!m[3]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),h&2&&(_.items=m[1].values),h&2&&(_.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,_.selected=m[0],$e(()=>l=!1)),i.$set(_),m[3]?f?f.p(m,h):(f=Pg(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(M(e.$$.fragment,m),M(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(y(t),y(s),y(o)),H(e,m),H(i,m),f&&f.d(m)}}}function pP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mP(n,e,t){let i,l,{field:s}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,s),t(2,l)}return n.$$set=a=>{"field"in a&&t(1,s=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=s.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,l=s.maxSelect||s.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>s.values.includes(a))),o.length>l&&t(0,o=o.slice(o.length-l)))},[o,s,l,i,r]}class hP extends Se{constructor(e){super(),we(this,e,mP,pP,ke,{field:1,value:0})}}function _P(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Xt(()=>(u(),()=>clearTimeout(a)));function c(m){ie[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(3,l=lt(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class bP extends Se{constructor(e){super(),we(this,e,gP,_P,ke,{value:0,maxHeight:4})}}function kP(n){let e,t,i,l,s;e=new ii({props:{uniqueId:n[6],field:n[1]}});function o(a){n[5](a)}let r={id:n[6],required:n[3],placeholder:n[2]?"Leave empty to autogenerate...":""};return n[0]!==void 0&&(r.value=n[0]),i=new bP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],$e(()=>l=!1)),i.$set(c)},i(a){s||(M(e.$$.fragment,a),M(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(e,a),H(i,a)}}}function yP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[kP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function vP(n,e,t){let i,l,{original:s}=e,{field:o}=e,{value:r=void 0}=e;function a(u){r=u,t(0,r)}return n.$$set=u=>{"original"in u&&t(4,s=u.original),"field"in u&&t(1,o=u.field),"value"in u&&t(0,r=u.value)},n.$$.update=()=>{n.$$.dirty&18&&t(2,i=!V.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class wP extends Se{constructor(e){super(),we(this,e,vP,yP,ke,{original:4,field:1,value:0})}}function SP(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function TP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $P(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class CP extends Se{constructor(e){super(),we(this,e,$P,TP,ke,{field:1,value:0})}}function Ng(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=B(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(f,c){v(f,t,c),w(t,i),w(i,s),w(t,o),r||(a=W(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&oe(s,l),c&6&&ee(t,"active",e[1]===e[6].language)},d(f){f&&y(t),r=!1,a()}}}function qg(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new xu({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=B(a),f=B(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(s,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,g){e=h;const _={};g&4&&(_.language=e[6].language),g&4&&(_.content=e[6].content),i.$set(_),(!m||g&4)&&a!==(a=e[6].title+"")&&oe(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&ee(t,"active",e[1]===e[6].language)},i(h){m||(M(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&y(t),H(i)}}}function OP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=de(n[2]);const d=g=>g[6].language;for(let g=0;gg[6].language;for(let g=0;gt(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,l=u.class),"js"in u&&t(3,s=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(Hg,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:s,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[l,r,i,s,o,a]}class EP extends Se{constructor(e){super(),we(this,e,MP,OP,ke,{class:0,js:3,dart:4})}}function DP(n){let e,t,i,l,s,o=V.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[LP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=B(`Generate a non-refreshable auth token for + `),s=b("strong"),r=B(o),a=B(":"),u=C(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=W(e,"submit",nt(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=V.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&y(e),H(f),d=!1,m()}}}function IP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new $i({props:{value:n[3].authStore.token}}),u=new EP({props:{class:"m-b-0",js:` import PocketBase from 'pocketbase'; const token = "..."; @@ -154,8 +154,8 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config final pb = PocketBase('${c[7]}'); pb.authStore.save(token, null); - `),u.$set(h)},i(c){f||(O(r.$$.fragment,c),O(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(y(e),y(a)),H(r),H(u,c)}}}function LP(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=B("Token duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","number"),p(s,"id",o=n[20]),p(s,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(s,"min","0"),p(s,"step","1"),s.value=a=n[5]||""},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),u||(f=W(s,"input",n[14]),u=!0)},p(c,d){var m,h;d&1048576&&i!==(i=c[20])&&p(e,"for",i),d&1048576&&o!==(o=c[20])&&p(s,"id",o),d&1&&r!==(r="Default to the collection setting ("+(((h=(m=c[0])==null?void 0:m.authToken)==null?void 0:h.duration)||0)+"s)")&&p(s,"placeholder",r),d&32&&a!==(a=c[5]||"")&&s.value!==a&&(s.value=a)},d(c){c&&(y(e),y(l),y(s)),u=!1,f()}}}function AP(n){let e,t,i,l,s,o;const r=[IP,DP],a=[];function u(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?0:1}return i=u(n),l=a[i]=r[i](n),{c(){e=b("div"),t=C(),l.c(),s=ye(),p(e,"class","clearfix")},m(f,c){v(f,e,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),O(l,1),l.m(s.parentNode,s))},i(f){o||(O(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(y(e),y(t),y(s)),a[i].d(f)}}}function PP(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function NP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],ee(e,"btn-loading",n[6])},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&ee(e,"btn-loading",s[6])},d(s){s&&y(e),i=!1,l()}}}function RP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate a new one",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded"),e.disabled=n[6]},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&y(e),i=!1,l()}}}function FP(n){let e,t,i,l,s,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?RP:NP}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){v(f,e,c),w(e,t),v(f,i,c),u.m(f,c),v(f,l,c),s||(o=W(e,"click",n[2]),s=!0)},p(f,c){c&64&&(e.disabled=f[6]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(y(e),y(i),y(l)),u.d(f),s=!1,o()}}}function qP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[FP],header:[PP],default:[AP]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function HP(n,e,t){let i;const l=kt(),s="impersonate_"+V.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(g(),a==null||a.show())}function m(){a==null||a.hide(),g()}async function h(){if(!(f||!o||!r)){t(6,f=!0);try{t(3,c=await _e.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(L){_e.error(L)}t(6,f=!1)}}function g(){t(5,u=0),t(3,c=void 0)}const _=()=>g(),k=()=>h(),S=L=>t(5,u=L.target.value<<0),$=()=>!f;function T(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function M(L){Pe.call(this,n,L)}function E(L){Pe.call(this,n,L)}return n.$$set=L=>{"collection"in L&&t(0,o=L.collection),"record"in L&&t(1,r=L.record)},n.$$.update=()=>{n.$$.dirty&8&&t(7,i=V.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,k,S,$,T,M,E]}class jP extends Se{constructor(e){super(),we(this,e,HP,qP,ke,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function jg(n,e,t){const i=n.slice();return i[84]=e[t],i[85]=e,i[86]=t,i}function zg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=B(`The record has previous unsaved changes. - `),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='',f=C(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(t,a),w(t,u),w(e,f),w(e,c),m=!0,h||(g=[W(r,"click",n[48]),Oe(qe.call(null,u,"Discard draft")),W(u,"click",nt(n[49]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=_u(e,mt,{duration:150})),m=!1},d(_){_&&y(e),_&&d&&d.end(),h=!1,Ie(g)}}}function Ug(n){let e,t,i;return t=new gL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function zP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S=!n[6]&&Ug(n);return{c(){var $,T;e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="id",s=C(),o=b("span"),a=C(),S&&S.c(),u=C(),f=b("input"),p(t,"class",zs(V.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[87]),p(f,"type","text"),p(f,"id",c=n[87]),p(f,"placeholder",d=!n[7]&&!V.isEmpty(($=n[19])==null?void 0:$.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=(T=n[19])==null?void 0:T.min),f.readOnly=h=!n[6]},m($,T){v($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),v($,a,T),S&&S.m($,T),v($,u,T),v($,f,T),he(f,n[3].id),g=!0,_||(k=W(f,"input",n[50]),_=!0)},p($,T){var M,E;(!g||T[2]&33554432&&r!==(r=$[87]))&&p(e,"for",r),$[6]?S&&(re(),D(S,1,1,()=>{S=null}),ae()):S?(S.p($,T),T[0]&64&&O(S,1)):(S=Ug($),S.c(),O(S,1),S.m(u.parentNode,u)),(!g||T[2]&33554432&&c!==(c=$[87]))&&p(f,"id",c),(!g||T[0]&524416&&d!==(d=!$[7]&&!V.isEmpty((M=$[19])==null?void 0:M.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!g||T[0]&524288&&m!==(m=(E=$[19])==null?void 0:E.min))&&p(f,"minlength",m),(!g||T[0]&64&&h!==(h=!$[6]))&&(f.readOnly=h),T[0]&8&&f.value!==$[3].id&&he(f,$[3].id)},i($){g||(O(S),g=!0)},o($){D(S),g=!1},d($){$&&(y(e),y(a),y(u),y(f)),S&&S.d($),_=!1,k()}}}function Vg(n){let e,t,i,l,s;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new NL({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Bg();return{c(){j(e.$$.fragment),i=C(),a&&a.c(),l=ye()},m(u,f){q(e,u,f),v(u,i,f),a&&a.m(u,f),v(u,l,f),s=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],$e(()=>t=!1)),e.$set(c),u[16].length?a||(a=Bg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(O(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(y(i),y(l)),H(e,u),a&&a.d(u)}}}function Bg(n){let e;return{c(){e=b("hr")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function UP(n){let e,t,i;function l(o){n[65](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new KA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VP(n){let e,t,i;function l(o){n[64](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new cP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BP(n){let e,t,i,l,s;function o(f){n[61](f,n[84])}function r(f){n[62](f,n[84])}function a(f){n[63](f,n[84])}let u={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(u.value=n[3][n[84].name]),n[4][n[84].name]!==void 0&&(u.uploadedFiles=n[4][n[84].name]),n[5][n[84].name]!==void 0&&(u.deletedFileNames=n[5][n[84].name]),e=new DA({props:u}),ie.push(()=>be(e,"value",o)),ie.push(()=>be(e,"uploadedFiles",r)),ie.push(()=>be(e,"deletedFileNames",a)),{c(){j(e.$$.fragment)},m(f,c){q(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[84]),c[0]&4&&(d.original=n[2]),c[0]&8&&(d.record=n[3]),!t&&c[0]&65544&&(t=!0,d.value=n[3][n[84].name],$e(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[84].name],$e(()=>i=!1)),!l&&c[0]&65568&&(l=!0,d.deletedFileNames=n[5][n[84].name],$e(()=>l=!1)),e.$set(d)},i(f){s||(O(e.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),s=!1},d(f){H(e,f)}}}function WP(n){let e,t,i;function l(o){n[60](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new HA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YP(n){let e,t,i;function l(o){n[59](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new hP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KP(n){let e,t,i;function l(o){n[58](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new KL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JP(n){let e,t,i;function l(o){n[57](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new pA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZP(n){let e,t,i;function l(o){n[56](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new CP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GP(n){let e,t,i;function l(o){n[55](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new gA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XP(n){let e,t,i;function l(o){n[54](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new VL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QP(n){let e,t,i;function l(o){n[53](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new VA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xP(n){let e,t,i;function l(o){n[52](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new wP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Wg(n,e){let t,i,l,s,o;const r=[xP,QP,XP,GP,ZP,JP,KP,YP,WP,BP,VP,UP],a=[];function u(f,c){return f[84].type==="text"?0:f[84].type==="number"?1:f[84].type==="bool"?2:f[84].type==="email"?3:f[84].type==="url"?4:f[84].type==="editor"?5:f[84].type==="date"?6:f[84].type==="select"?7:f[84].type==="json"?8:f[84].type==="file"?9:f[84].type==="relation"?10:f[84].type==="password"?11:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(f,c){v(f,t,c),~i&&a[i].m(f,c),v(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(re(),D(a[d],1,1,()=>{a[d]=null}),ae()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),O(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(O(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(y(t),y(s)),~i&&a[i].d(f)}}}function Yg(n){let e,t,i;return t=new SL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[15]===io)},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&32768)&&ee(e,"active",l[15]===io)},i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function eN(n){let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&zg(n);l=new fe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[zP,({uniqueId:S})=>({87:S}),({uniqueId:S})=>[0,0,S?33554432:0]]},$$scope:{ctx:n}}});let h=n[9]&&Vg(n),g=de(n[16]);const _=S=>S[84].name;for(let S=0;S{m=null}),ae());const T={};$[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),$[0]&524488|$[2]&100663296&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),S[9]?h?(h.p(S,$),$[0]&512&&O(h,1)):(h=Vg(S),h.c(),O(h,1),h.m(t,o)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),$[0]&65596&&(g=de(S[16]),re(),r=vt(r,$,_,1,S,g,a,t,Bt,Wg,null,jg),ae()),(!f||$[0]&128)&&ee(t,"no-pointer-events",S[7]),(!f||$[0]&32768)&&ee(t,"active",S[15]===El),S[9]&&!S[17]&&!S[6]?k?(k.p(S,$),$[0]&131648&&O(k,1)):(k=Yg(S),k.c(),O(k,1),k.m(e,null)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i(S){if(!f){O(m),O(l.$$.fragment,S),O(h);for(let $=0;${d=null}),ae()):d?(d.p(h,g),g[0]&64&&O(d,1)):(d=Kg(h),d.c(),O(d,1),d.m(f.parentNode,f))},i(h){c||(O(d),c=!0)},o(h){D(d),c=!1},d(h){h&&(y(e),y(u),y(f)),d&&d.d(h)}}}function nN(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,i:te,o:te,d(l){l&&(y(e),y(t),y(i))}}}function Kg(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[iN]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&67108864&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(O(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(y(e),y(t),y(i)),H(o)}}}function Jg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[40]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Zg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[41]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Gg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Impersonate',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[42]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function iN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[9]&&!n[2].verified&&n[2].email&&Jg(n),h=n[9]&&n[2].email&&Zg(n),g=n[9]&&Gg(n);return{c(){m&&m.c(),e=C(),h&&h.c(),t=C(),g&&g.c(),i=C(),l=b("button"),l.innerHTML=' Copy raw JSON',s=C(),o=b("button"),o.innerHTML=' Duplicate',r=C(),a=b("hr"),u=C(),f=b("button"),f.innerHTML=' Delete',p(l,"type","button"),p(l,"class","dropdown-item closable"),p(l,"role","menuitem"),p(o,"type","button"),p(o,"class","dropdown-item closable"),p(o,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item txt-danger closable"),p(f,"role","menuitem")},m(_,k){m&&m.m(_,k),v(_,e,k),h&&h.m(_,k),v(_,t,k),g&&g.m(_,k),v(_,i,k),v(_,l,k),v(_,s,k),v(_,o,k),v(_,r,k),v(_,a,k),v(_,u,k),v(_,f,k),c||(d=[W(l,"click",n[43]),W(o,"click",n[44]),W(f,"click",On(nt(n[45])))],c=!0)},p(_,k){_[9]&&!_[2].verified&&_[2].email?m?m.p(_,k):(m=Jg(_),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_[9]&&_[2].email?h?h.p(_,k):(h=Zg(_),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),_[9]?g?g.p(_,k):(g=Gg(_),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null)},d(_){_&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r),y(a),y(u),y(f)),m&&m.d(_),h&&h.d(_),g&&g.d(_),c=!1,Ie(d)}}}function Xg(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=C(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),ee(t,"active",n[15]===El),p(l,"type","button"),p(l,"class","tab-item"),ee(l,"active",n[15]===io),p(e,"class","tabs-header stretched")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=[W(t,"click",n[46]),W(l,"click",n[47])],s=!0)},p(r,a){a[0]&32768&&ee(t,"active",r[15]===El),a[0]&32768&&ee(l,"active",r[15]===io)},d(r){r&&y(e),s=!1,Ie(o)}}}function lN(n){let e,t,i,l,s;const o=[nN,tN],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[9]&&!n[17]&&!n[6]&&Xg(n);return{c(){t.c(),i=C(),u&&u.c(),l=ye()},m(f,c){r[e].m(f,c),v(f,i,c),u&&u.m(f,c),v(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),O(t,1),t.m(i.parentNode,i)),f[9]&&!f[17]&&!f[6]?u?u.p(f,c):(u=Xg(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(O(t),s=!0)},o(f){D(t),s=!1},d(f){f&&(y(i),y(l)),r[e].d(f),u&&u.d(f)}}}function Qg(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[sN]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[18]||n[13]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&270336&&s!==(s=!r[18]||r[13]))&&(e.disabled=s)},i(r){o||(O(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&y(e),H(l)}}}function sN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[39]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function oN(n){let e,t,i,l,s,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,g=!n[6]&&Qg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=C(),s=b("div"),o=b("button"),r=b("span"),u=B(a),c=C(),g&&g.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[13]||n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[21]),p(o,"title","Save and close"),p(o,"class","btn"),o.disabled=f=!n[18]||n[13],ee(o,"btn-expanded",n[6]),ee(o,"btn-expanded-sm",!n[6]),ee(o,"btn-loading",n[13]||n[7]),p(s,"class","btns-group no-gap")},m(_,k){v(_,e,k),w(e,t),v(_,l,k),v(_,s,k),w(s,o),w(o,r),w(r,u),w(s,c),g&&g.m(s,null),d=!0,m||(h=W(e,"click",n[38]),m=!0)},p(_,k){(!d||k[0]&8320&&i!==(i=_[13]||_[7]))&&(e.disabled=i),(!d||k[0]&64)&&a!==(a=_[6]?"Create":"Save changes")&&oe(u,a),(!d||k[0]&270336&&f!==(f=!_[18]||_[13]))&&(o.disabled=f),(!d||k[0]&64)&&ee(o,"btn-expanded",_[6]),(!d||k[0]&64)&&ee(o,"btn-expanded-sm",!_[6]),(!d||k[0]&8320)&&ee(o,"btn-loading",_[13]||_[7]),_[6]?g&&(re(),D(g,1,1,()=>{g=null}),ae()):g?(g.p(_,k),k[0]&64&&O(g,1)):(g=Qg(_),g.c(),O(g,1),g.m(s,null))},i(_){d||(O(g),d=!0)},o(_){D(g),d=!1},d(_){_&&(y(e),y(l),y(s)),g&&g.d(),m=!1,h()}}}function xg(n){let e,t,i={record:n[3],collection:n[0]};return e=new jP({props:i}),n[70](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),s[0]&1&&(o.collection=l[0]),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[70](null),H(e,l)}}}function rN(n){let e,t,i,l,s={class:` + `),u.$set(h)},i(c){f||(M(r.$$.fragment,c),M(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(y(e),y(a)),H(r),H(u,c)}}}function LP(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=B("Token duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","number"),p(s,"id",o=n[20]),p(s,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(s,"min","0"),p(s,"step","1"),s.value=a=n[5]||""},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),u||(f=W(s,"input",n[14]),u=!0)},p(c,d){var m,h;d&1048576&&i!==(i=c[20])&&p(e,"for",i),d&1048576&&o!==(o=c[20])&&p(s,"id",o),d&1&&r!==(r="Default to the collection setting ("+(((h=(m=c[0])==null?void 0:m.authToken)==null?void 0:h.duration)||0)+"s)")&&p(s,"placeholder",r),d&32&&a!==(a=c[5]||"")&&s.value!==a&&(s.value=a)},d(c){c&&(y(e),y(l),y(s)),u=!1,f()}}}function AP(n){let e,t,i,l,s,o;const r=[IP,DP],a=[];function u(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?0:1}return i=u(n),l=a[i]=r[i](n),{c(){e=b("div"),t=C(),l.c(),s=ye(),p(e,"class","clearfix")},m(f,c){v(f,e,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(y(e),y(t),y(s)),a[i].d(f)}}}function PP(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function NP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],ee(e,"btn-loading",n[6])},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&ee(e,"btn-loading",s[6])},d(s){s&&y(e),i=!1,l()}}}function RP(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate a new one",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded"),e.disabled=n[6]},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&y(e),i=!1,l()}}}function FP(n){let e,t,i,l,s,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?RP:NP}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){v(f,e,c),w(e,t),v(f,i,c),u.m(f,c),v(f,l,c),s||(o=W(e,"click",n[2]),s=!0)},p(f,c){c&64&&(e.disabled=f[6]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(y(e),y(i),y(l)),u.d(f),s=!1,o()}}}function qP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[FP],header:[PP],default:[AP]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function HP(n,e,t){let i;const l=kt(),s="impersonate_"+V.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(g(),a==null||a.show())}function m(){a==null||a.hide(),g()}async function h(){if(!(f||!o||!r)){t(6,f=!0);try{t(3,c=await _e.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(L){_e.error(L)}t(6,f=!1)}}function g(){t(5,u=0),t(3,c=void 0)}const _=()=>g(),k=()=>h(),S=L=>t(5,u=L.target.value<<0),$=()=>!f;function T(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Pe.call(this,n,L)}function E(L){Pe.call(this,n,L)}return n.$$set=L=>{"collection"in L&&t(0,o=L.collection),"record"in L&&t(1,r=L.record)},n.$$.update=()=>{n.$$.dirty&8&&t(7,i=V.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,k,S,$,T,O,E]}class jP extends Se{constructor(e){super(),we(this,e,HP,qP,ke,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function jg(n,e,t){const i=n.slice();return i[84]=e[t],i[85]=e,i[86]=t,i}function zg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=B(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='',f=C(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(t,a),w(t,u),w(e,f),w(e,c),m=!0,h||(g=[W(r,"click",n[48]),Oe(qe.call(null,u,"Discard draft")),W(u,"click",nt(n[49]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=_u(e,mt,{duration:150})),m=!1},d(_){_&&y(e),_&&d&&d.end(),h=!1,Ie(g)}}}function Ug(n){let e,t,i;return t=new gL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function zP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=!n[6]&&Ug(n);return{c(){var T,O,E;e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="id",s=C(),o=b("span"),a=C(),$&&$.c(),u=C(),f=b("input"),p(t,"class",zs(V.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[87]),p(f,"type","text"),p(f,"id",c=n[87]),p(f,"placeholder",d=!n[7]&&!V.isEmpty((T=n[19])==null?void 0:T.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=((O=n[19])==null?void 0:O.min)||null),p(f,"maxlength",h=((E=n[19])==null?void 0:E.max)||null),f.readOnly=g=!n[6]},m(T,O){v(T,e,O),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),v(T,a,O),$&&$.m(T,O),v(T,u,O),v(T,f,O),he(f,n[3].id),_=!0,k||(S=W(f,"input",n[50]),k=!0)},p(T,O){var E,L,I;(!_||O[2]&33554432&&r!==(r=T[87]))&&p(e,"for",r),T[6]?$&&(re(),D($,1,1,()=>{$=null}),ae()):$?($.p(T,O),O[0]&64&&M($,1)):($=Ug(T),$.c(),M($,1),$.m(u.parentNode,u)),(!_||O[2]&33554432&&c!==(c=T[87]))&&p(f,"id",c),(!_||O[0]&524416&&d!==(d=!T[7]&&!V.isEmpty((E=T[19])==null?void 0:E.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!_||O[0]&524288&&m!==(m=((L=T[19])==null?void 0:L.min)||null))&&p(f,"minlength",m),(!_||O[0]&524288&&h!==(h=((I=T[19])==null?void 0:I.max)||null))&&p(f,"maxlength",h),(!_||O[0]&64&&g!==(g=!T[6]))&&(f.readOnly=g),O[0]&8&&f.value!==T[3].id&&he(f,T[3].id)},i(T){_||(M($),_=!0)},o(T){D($),_=!1},d(T){T&&(y(e),y(a),y(u),y(f)),$&&$.d(T),k=!1,S()}}}function Vg(n){let e,t,i,l,s;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new NL({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Bg();return{c(){j(e.$$.fragment),i=C(),a&&a.c(),l=ye()},m(u,f){q(e,u,f),v(u,i,f),a&&a.m(u,f),v(u,l,f),s=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],$e(()=>t=!1)),e.$set(c),u[16].length?a||(a=Bg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(M(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(y(i),y(l)),H(e,u),a&&a.d(u)}}}function Bg(n){let e;return{c(){e=b("hr")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function UP(n){let e,t,i;function l(o){n[65](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new KA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VP(n){let e,t,i;function l(o){n[64](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new cP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BP(n){let e,t,i,l,s;function o(f){n[61](f,n[84])}function r(f){n[62](f,n[84])}function a(f){n[63](f,n[84])}let u={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(u.value=n[3][n[84].name]),n[4][n[84].name]!==void 0&&(u.uploadedFiles=n[4][n[84].name]),n[5][n[84].name]!==void 0&&(u.deletedFileNames=n[5][n[84].name]),e=new DA({props:u}),ie.push(()=>be(e,"value",o)),ie.push(()=>be(e,"uploadedFiles",r)),ie.push(()=>be(e,"deletedFileNames",a)),{c(){j(e.$$.fragment)},m(f,c){q(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[84]),c[0]&4&&(d.original=n[2]),c[0]&8&&(d.record=n[3]),!t&&c[0]&65544&&(t=!0,d.value=n[3][n[84].name],$e(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[84].name],$e(()=>i=!1)),!l&&c[0]&65568&&(l=!0,d.deletedFileNames=n[5][n[84].name],$e(()=>l=!1)),e.$set(d)},i(f){s||(M(e.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),s=!1},d(f){H(e,f)}}}function WP(n){let e,t,i;function l(o){n[60](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new HA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YP(n){let e,t,i;function l(o){n[59](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new hP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KP(n){let e,t,i;function l(o){n[58](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new KL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JP(n){let e,t,i;function l(o){n[57](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new pA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZP(n){let e,t,i;function l(o){n[56](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new CP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GP(n){let e,t,i;function l(o){n[55](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new gA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XP(n){let e,t,i;function l(o){n[54](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new VL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QP(n){let e,t,i;function l(o){n[53](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new VA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xP(n){let e,t,i;function l(o){n[52](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new wP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Wg(n,e){let t,i,l,s,o;const r=[xP,QP,XP,GP,ZP,JP,KP,YP,WP,BP,VP,UP],a=[];function u(f,c){return f[84].type==="text"?0:f[84].type==="number"?1:f[84].type==="bool"?2:f[84].type==="email"?3:f[84].type==="url"?4:f[84].type==="editor"?5:f[84].type==="date"?6:f[84].type==="select"?7:f[84].type==="json"?8:f[84].type==="file"?9:f[84].type==="relation"?10:f[84].type==="password"?11:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(f,c){v(f,t,c),~i&&a[i].m(f,c),v(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(re(),D(a[d],1,1,()=>{a[d]=null}),ae()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),M(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(y(t),y(s)),~i&&a[i].d(f)}}}function Yg(n){let e,t,i;return t=new SL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[15]===io)},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&32768)&&ee(e,"active",l[15]===io)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function eN(n){let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&zg(n);l=new fe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[zP,({uniqueId:S})=>({87:S}),({uniqueId:S})=>[0,0,S?33554432:0]]},$$scope:{ctx:n}}});let h=n[9]&&Vg(n),g=de(n[16]);const _=S=>S[84].name;for(let S=0;S{m=null}),ae());const T={};$[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),$[0]&524488|$[2]&100663296&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),S[9]?h?(h.p(S,$),$[0]&512&&M(h,1)):(h=Vg(S),h.c(),M(h,1),h.m(t,o)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),$[0]&65596&&(g=de(S[16]),re(),r=vt(r,$,_,1,S,g,a,t,Bt,Wg,null,jg),ae()),(!f||$[0]&128)&&ee(t,"no-pointer-events",S[7]),(!f||$[0]&32768)&&ee(t,"active",S[15]===El),S[9]&&!S[17]&&!S[6]?k?(k.p(S,$),$[0]&131648&&M(k,1)):(k=Yg(S),k.c(),M(k,1),k.m(e,null)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i(S){if(!f){M(m),M(l.$$.fragment,S),M(h);for(let $=0;${d=null}),ae()):d?(d.p(h,g),g[0]&64&&M(d,1)):(d=Kg(h),d.c(),M(d,1),d.m(f.parentNode,f))},i(h){c||(M(d),c=!0)},o(h){D(d),c=!1},d(h){h&&(y(e),y(u),y(f)),d&&d.d(h)}}}function nN(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,i:te,o:te,d(l){l&&(y(e),y(t),y(i))}}}function Kg(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[iN]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&67108864&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(y(e),y(t),y(i)),H(o)}}}function Jg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[40]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Zg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[41]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Gg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Impersonate',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[42]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function iN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[9]&&!n[2].verified&&n[2].email&&Jg(n),h=n[9]&&n[2].email&&Zg(n),g=n[9]&&Gg(n);return{c(){m&&m.c(),e=C(),h&&h.c(),t=C(),g&&g.c(),i=C(),l=b("button"),l.innerHTML=' Copy raw JSON',s=C(),o=b("button"),o.innerHTML=' Duplicate',r=C(),a=b("hr"),u=C(),f=b("button"),f.innerHTML=' Delete',p(l,"type","button"),p(l,"class","dropdown-item closable"),p(l,"role","menuitem"),p(o,"type","button"),p(o,"class","dropdown-item closable"),p(o,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item txt-danger closable"),p(f,"role","menuitem")},m(_,k){m&&m.m(_,k),v(_,e,k),h&&h.m(_,k),v(_,t,k),g&&g.m(_,k),v(_,i,k),v(_,l,k),v(_,s,k),v(_,o,k),v(_,r,k),v(_,a,k),v(_,u,k),v(_,f,k),c||(d=[W(l,"click",n[43]),W(o,"click",n[44]),W(f,"click",On(nt(n[45])))],c=!0)},p(_,k){_[9]&&!_[2].verified&&_[2].email?m?m.p(_,k):(m=Jg(_),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_[9]&&_[2].email?h?h.p(_,k):(h=Zg(_),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),_[9]?g?g.p(_,k):(g=Gg(_),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null)},d(_){_&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r),y(a),y(u),y(f)),m&&m.d(_),h&&h.d(_),g&&g.d(_),c=!1,Ie(d)}}}function Xg(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=C(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),ee(t,"active",n[15]===El),p(l,"type","button"),p(l,"class","tab-item"),ee(l,"active",n[15]===io),p(e,"class","tabs-header stretched")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=[W(t,"click",n[46]),W(l,"click",n[47])],s=!0)},p(r,a){a[0]&32768&&ee(t,"active",r[15]===El),a[0]&32768&&ee(l,"active",r[15]===io)},d(r){r&&y(e),s=!1,Ie(o)}}}function lN(n){let e,t,i,l,s;const o=[nN,tN],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[9]&&!n[17]&&!n[6]&&Xg(n);return{c(){t.c(),i=C(),u&&u.c(),l=ye()},m(f,c){r[e].m(f,c),v(f,i,c),u&&u.m(f,c),v(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),M(t,1),t.m(i.parentNode,i)),f[9]&&!f[17]&&!f[6]?u?u.p(f,c):(u=Xg(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(M(t),s=!0)},o(f){D(t),s=!1},d(f){f&&(y(i),y(l)),r[e].d(f),u&&u.d(f)}}}function Qg(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[sN]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[18]||n[13]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&270336&&s!==(s=!r[18]||r[13]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&y(e),H(l)}}}function sN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[39]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function oN(n){let e,t,i,l,s,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,g=!n[6]&&Qg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=C(),s=b("div"),o=b("button"),r=b("span"),u=B(a),c=C(),g&&g.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[13]||n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[21]),p(o,"title","Save and close"),p(o,"class","btn"),o.disabled=f=!n[18]||n[13],ee(o,"btn-expanded",n[6]),ee(o,"btn-expanded-sm",!n[6]),ee(o,"btn-loading",n[13]||n[7]),p(s,"class","btns-group no-gap")},m(_,k){v(_,e,k),w(e,t),v(_,l,k),v(_,s,k),w(s,o),w(o,r),w(r,u),w(s,c),g&&g.m(s,null),d=!0,m||(h=W(e,"click",n[38]),m=!0)},p(_,k){(!d||k[0]&8320&&i!==(i=_[13]||_[7]))&&(e.disabled=i),(!d||k[0]&64)&&a!==(a=_[6]?"Create":"Save changes")&&oe(u,a),(!d||k[0]&270336&&f!==(f=!_[18]||_[13]))&&(o.disabled=f),(!d||k[0]&64)&&ee(o,"btn-expanded",_[6]),(!d||k[0]&64)&&ee(o,"btn-expanded-sm",!_[6]),(!d||k[0]&8320)&&ee(o,"btn-loading",_[13]||_[7]),_[6]?g&&(re(),D(g,1,1,()=>{g=null}),ae()):g?(g.p(_,k),k[0]&64&&M(g,1)):(g=Qg(_),g.c(),M(g,1),g.m(s,null))},i(_){d||(M(g),d=!0)},o(_){D(g),d=!1},d(_){_&&(y(e),y(l),y(s)),g&&g.d(),m=!1,h()}}}function xg(n){let e,t,i={record:n[3],collection:n[0]};return e=new jP({props:i}),n[70](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),s[0]&1&&(o.collection=l[0]),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[70](null),H(e,l)}}}function rN(n){let e,t,i,l,s={class:` record-panel `+(n[20]?"overlay-panel-xl":"overlay-panel-lg")+` `+(n[9]&&!n[17]&&!n[6]?"colored-header":"")+` @@ -163,14 +163,14 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config record-panel `+(r[20]?"overlay-panel-xl":"overlay-panel-lg")+` `+(r[9]&&!r[17]&&!r[6]?"colored-header":"")+` - `),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[66]),a[0]&1031165|a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&O(o,1)):(o=xg(r),o.c(),O(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(O(e.$$.fragment,r),O(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(y(t),y(i)),n[67](null),H(e,r),o&&o.d(r)}}}const El="form",io="providers";function aN(n,e,t){let i,l,s,o,r,a,u,f;const c=kt(),d="record_"+V.randomString(5);let{collection:m}=e,h,g,_={},k={},S=null,$=!1,T=!1,M={},E={},L=JSON.stringify(_),I=L,A=El,P=!0,N=!0,R=m,z=[];const F=["id"],U=F.concat("email","emailVisibility","verified","tokenKey","password");function J(se){return ce(se),t(14,T=!0),t(15,A=El),h==null?void 0:h.show()}function Y(){return h==null?void 0:h.hide()}function Z(){t(14,T=!1),Y()}function G(){t(35,R=m),h!=null&&h.isActive()&&(Je(JSON.stringify(k)),Z())}async function pe(se){if(!se)return null;let Me=typeof se=="string"?se:se==null?void 0:se.id;if(Me)try{return await _e.collection(m.id).getOne(Me)}catch(Ne){Ne.isAbort||(Z(),console.warn("resolveModel:",Ne),Ci(`Unable to load record with id "${Me}"`))}return typeof se=="object"?se:null}async function ce(se){t(7,N=!0),Ut({}),t(4,M={}),t(5,E={}),t(2,_=typeof se=="string"?{id:se,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:se||{}),t(3,k=structuredClone(_)),t(2,_=await pe(se)||{}),t(3,k=structuredClone(_)),await dn(),t(12,S=Ke()),!S||et(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(k)),t(7,N=!1)}async function ue(se){var Ne,ze;Ut({}),t(2,_=se||{}),t(4,M={}),t(5,E={});const Me=((ze=(Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(Ge=>Ge.type!="file"))==null?void 0:ze.map(Ge=>Ge.name))||[];for(let Ge in se)Me.includes(Ge)||t(3,k[Ge]=se[Ge],k);await dn(),t(33,L=JSON.stringify(k)),xe()}function Te(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function Ke(se){try{const Me=window.localStorage.getItem(Te());if(Me)return JSON.parse(Me)}catch{}return se}function Je(se){try{window.localStorage.setItem(Te(),se)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(Te())}}function ft(){S&&(t(3,k=S),t(12,S=null))}function et(se,Me){var qt;const Ne=structuredClone(se||{}),ze=structuredClone(Me||{}),Ge=(qt=m==null?void 0:m.fields)==null?void 0:qt.filter(Sn=>Sn.type==="file");for(let Sn of Ge)delete Ne[Sn.name],delete ze[Sn.name];const xt=["expand","password","passwordConfirm"];for(let Sn of xt)delete Ne[Sn],delete ze[Sn];return JSON.stringify(Ne)==JSON.stringify(ze)}function xe(){t(12,S=null),window.localStorage.removeItem(Te())}async function We(se=!0){var Me;if(!($||!u||!(m!=null&&m.id))){t(13,$=!0);try{const Ne=jt();let ze;if(P?ze=await _e.collection(m.id).create(Ne):ze=await _e.collection(m.id).update(k.id,Ne),nn(P?"Successfully created record.":"Successfully updated record."),xe(),l&&(k==null?void 0:k.id)==((Me=_e.authStore.record)==null?void 0:Me.id)&&Ne.get("password"))return _e.logout();se?Z():ue(ze),c("save",{isNew:P,record:ze})}catch(Ne){_e.error(Ne)}t(13,$=!1)}}function at(){_!=null&&_.id&&_n("Do you really want to delete the selected record?",()=>_e.collection(_.collectionId).delete(_.id).then(()=>{Z(),nn("Successfully deleted record."),c("delete",_)}).catch(se=>{_e.error(se)}))}function jt(){const se=structuredClone(k||{}),Me=new FormData,Ne={},ze={};for(const Ge of(m==null?void 0:m.fields)||[])Ge.type=="autodate"||i&&Ge.type=="password"||(Ne[Ge.name]=!0,Ge.type=="json"&&(ze[Ge.name]=!0));i&&se.password&&(Ne.password=!0),i&&se.passwordConfirm&&(Ne.passwordConfirm=!0);for(const Ge in se)if(Ne[Ge]){if(typeof se[Ge]>"u"&&(se[Ge]=null),ze[Ge]&&se[Ge]!=="")try{JSON.parse(se[Ge])}catch(xt){const qt={};throw qt[Ge]={code:"invalid_json",message:xt.toString()},new Fn({status:400,response:{data:qt}})}V.addValueToFormData(Me,Ge,se[Ge])}for(const Ge in M){const xt=V.toArray(M[Ge]);for(const qt of xt)Me.append(Ge+"+",qt)}for(const Ge in E){const xt=V.toArray(E[Ge]);for(const qt of xt)Me.append(Ge+"-",qt)}return Me}function Ve(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent verification email to ${_.email}?`,()=>_e.collection(m.id).requestVerification(_.email).then(()=>{nn(`Successfully sent verification email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function Ee(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent password reset email to ${_.email}?`,()=>_e.collection(m.id).requestPasswordReset(_.email).then(()=>{nn(`Successfully sent password reset email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function st(){a?_n("You have unsaved changes. Do you really want to discard them?",()=>{De()}):De()}async function De(){let se=_?structuredClone(_):null;if(se){const Me=["file","autodate"],Ne=(m==null?void 0:m.fields)||[];for(const ze of Ne)Me.includes(ze.type)&&delete se[ze.name];se.id=""}xe(),J(se),await dn(),t(33,L="")}function Ye(se){(se.ctrlKey||se.metaKey)&&se.code=="KeyS"&&(se.preventDefault(),se.stopPropagation(),We(!1))}function ve(){V.copyToClipboard(JSON.stringify(_,null,2)),Ks("The record JSON was copied to your clipboard!",3e3)}const Ce=()=>Y(),ct=()=>We(!1),Ht=()=>Ve(),Le=()=>Ee(),ot=()=>g==null?void 0:g.show(),on=()=>ve(),En=()=>st(),Re=()=>at(),Ft=()=>t(15,A=El),Yt=()=>t(15,A=io),vn=()=>ft(),fn=()=>xe();function Oi(){k.id=this.value,t(3,k)}function li(se){k=se,t(3,k)}function bt(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function wn(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function sn(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Dt(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Mi(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function ul(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function zi(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Ui(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function fl(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Dn(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Rl(se,Me){n.$$.not_equal(M[Me.name],se)&&(M[Me.name]=se,t(4,M))}function cl(se,Me){n.$$.not_equal(E[Me.name],se)&&(E[Me.name]=se,t(5,E))}function X(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function x(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}const le=()=>a&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{Z()}),!1):(Ut({}),xe(),!0);function ge(se){ie[se?"unshift":"push"](()=>{h=se,t(10,h)})}function Fe(se){Pe.call(this,n,se)}function Be(se){Pe.call(this,n,se)}function rt(se){ie[se?"unshift":"push"](()=>{g=se,t(11,g)})}return n.$$set=se=>{"collection"in se&&t(0,m=se.collection)},n.$$.update=()=>{var se,Me,Ne;n.$$.dirty[0]&1&&t(9,i=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&1&&t(17,l=(m==null?void 0:m.name)==="_superusers"),n.$$.dirty[0]&1&&t(20,s=!!((se=m==null?void 0:m.fields)!=null&&se.find(ze=>ze.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Me=m==null?void 0:m.fields)==null?void 0:Me.find(ze=>ze.name==="id")),n.$$.dirty[0]&48&&t(37,r=V.hasNonEmptyProps(M)||V.hasNonEmptyProps(E)),n.$$.dirty[0]&8&&t(34,I=JSON.stringify(k)),n.$$.dirty[1]&76&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!_||!_.id),n.$$.dirty[0]&448&&t(18,u=!N&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&8&&(N||Je(I)),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&m&&(R==null?void 0:R.id)!=(m==null?void 0:m.id)&&G(),n.$$.dirty[0]&512&&t(36,f=i?U:F),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&t(16,z=((Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(ze=>!f.includes(ze.name)&&ze.type!="autodate"))||[])},[m,Y,_,k,M,E,P,N,a,i,h,g,S,$,T,A,z,l,u,o,s,d,Z,ft,xe,We,at,Ve,Ee,st,Ye,ve,J,L,I,R,f,r,Ce,ct,Ht,Le,ot,on,En,Re,Ft,Yt,vn,fn,Oi,li,bt,wn,sn,Dt,Mi,ul,zi,Ui,fl,Dn,Rl,cl,X,x,le,ge,Fe,Be,rt]}class rf extends Se{constructor(e){super(),we(this,e,aN,rN,ke,{collection:0,show:32,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[32]}get hide(){return this.$$.ctx[1]}}function uN(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=C(),l=b("span"),o=B(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,l),w(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&oe(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:te,o:te,d(a){a&&y(e)}}}function fN(n,e,t){const i=kt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=V.getAllCollectionIdentifiers(l),c=await _e.collection(l.id).getList(1,1,{filter:V.normalizeSearchFilter(s,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class cN extends Se{constructor(e){super(),we(this,e,fN,uN,ke,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function e1(n,e,t){const i=n.slice();return i[58]=e[t],i}function t1(n,e,t){const i=n.slice();return i[61]=e[t],i}function n1(n,e,t){const i=n.slice();return i[61]=e[t],i}function i1(n,e,t){const i=n.slice();return i[54]=e[t],i}function l1(n){let e;function t(s,o){return s[9]?pN:dN}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){v(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&y(e),l.d()}}}function dN(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[13],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&8192&&(t.checked=a[13])},d(a){a&&y(e),o=!1,r()}}}function pN(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function mN(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[61].type))},m(i,l){v(i,e,l)},p(i,l){l[0]&32768&&t!==(t=V.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function hN(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function _N(n){let e,t,i,l=n[61].name+"",s;function o(u,f){return u[61].primaryKey?hN:mN}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){v(u,e,f),a.m(e,null),w(e,t),w(e,i),w(i,s)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,t))),f[0]&32768&&l!==(l=u[61].name+"")&&oe(s,l)},d(u){u&&y(e),a.d()}}}function s1(n,e){let t,i,l,s;function o(a){e[32](a)}let r={class:"col-type-"+e[61].type+" col-field-"+e[61].name,name:e[61].name,$$slots:{default:[_N]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new ir({props:r}),ie.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[61].type+" col-field-"+e[61].name),u[0]&32768&&(f.name=e[61].name),u[0]&32768|u[2]&16&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],$e(()=>l=!1)),i.$set(f)},i(a){s||(O(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function o1(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){v(t,e,i),n[33](e)},p:te,d(t){t&&y(e),n[33](null)}}}function r1(n){let e;function t(s,o){return s[9]?bN:gN}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function gN(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return yN;if(!a[16])return kN}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=C(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&y(e),r&&r.d()}}}function bN(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function kN(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){v(l,e,s),t||(i=W(e,"click",n[38]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function yN(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){v(l,e,s),t||(i=W(e,"click",n[37]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function a1(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=C(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[58].id),i.checked=s=n[4][n[58].id],p(r,"for",a="checkbox_"+n[58].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){v(d,e,m),w(e,t),w(t,i),w(t,o),w(t,r),u||(f=[W(i,"change",c),W(t,"click",On(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[58].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[58].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&y(e),u=!1,Ie(f)}}}function u1(n,e){let t,i,l,s;return i=new Sy({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),j(i.$$.fragment),p(t,"class",l="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){v(o,t,r),q(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[58]),r[0]&32768&&(a.field=e[61]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",l)},i(o){s||(O(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&y(t),H(i)}}}function f1(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&a1(e),d=de(e[15]);const m=_=>_[61].id;for(let _=0;_',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(_,k){v(_,t,k),c&&c.m(t,null),w(t,i);for(let S=0;SL[61].id;for(let L=0;L<_.length;L+=1){let I=n1(n,_,L),A=k(I);o.set(A,s[L]=s1(A,I))}let S=n[12].length&&o1(n),$=de(n[3]);const T=L=>L[16]?L[58]:L[58].id;for(let L=0;L<$.length;L+=1){let I=e1(n,$,L),A=T(I);d.set(A,c[L]=f1(A,I))}let M=null;$.length||(M=r1(n));let E=n[3].length&&n[14]&&c1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),l=C();for(let L=0;L({57:s}),({uniqueId:s})=>[0,s?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(O(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(i,s)}}}function SN(n){let e,t,i=[],l=new Map,s,o,r=de(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u{i=null}),ae())},i(l){t||(O(i),t=!0)},o(l){D(i),t=!1},d(l){l&&y(e),i&&i.d(l)}}}function m1(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[6]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),ee(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),ee(h,"btn-loading",n[10]),ee(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m($,T){v($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,k||(S=[W(f,"click",n[41]),W(h,"click",n[42])],k=!0)},p($,T){(!_||T[0]&64)&&oe(s,$[6]),(!_||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&oe(a,r),(!_||T[0]&1024)&&ee(f,"btn-disabled",$[10]),(!_||T[0]&1024)&&ee(h,"btn-loading",$[10]),(!_||T[0]&1024)&&ee(h,"btn-disabled",$[10])},i($){_||($&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ie(S)}}}function $N(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[TN],default:[vN]},$$scope:{ctx:n}};e=new Nu({props:s}),n[40](e);let o=n[6]&&m1(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=ye()},m(r,a){q(e,r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l=!0},p(r,a){const u={};a[0]&129851|a[2]&16&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&O(o,1)):(o=m1(r),o.c(),O(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(O(e.$$.fragment,r),O(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(y(t),y(i)),n[40](null),H(e,r),o&&o.d(r)}}}const CN=/^([\+\-])?(\w+)$/,h1=40;function ON(n,e,t){let i,l,s,o,r,a,u,f,c,d,m;Qe(n,Mn,Le=>t(47,d=Le)),Qe(n,Js,Le=>t(28,m=Le));const h=kt();let{collection:g}=e,{sort:_=""}=e,{filter:k=""}=e,S,$=[],T=1,M=0,E={},L=!0,I=!1,A=0,P,N=[],R=[],z="";const F=["verified","emailVisibility"];function U(){g!=null&&g.id&&(N.length?localStorage.setItem(z,JSON.stringify(N)):localStorage.removeItem(z))}function J(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Le=localStorage.getItem(z);Le&&t(5,N=JSON.parse(Le)||[])}catch{}}function Y(Le){return!!$.find(ot=>ot.id==Le)}async function Z(){const Le=T;for(let ot=1;ot<=Le;ot++)(ot===1||u)&&await G(ot,!1)}async function G(Le=1,ot=!0){var fn,Oi,li;if(!(g!=null&&g.id))return;t(9,L=!0);let on=_;const En=on.match(CN),Re=En?r.find(bt=>bt.name===En[2]):null;if(En&&Re){const bt=((li=(Oi=(fn=d==null?void 0:d.find(sn=>sn.id==Re.collectionId))==null?void 0:fn.fields)==null?void 0:Oi.filter(sn=>sn.presentable))==null?void 0:li.map(sn=>sn.name))||[],wn=[];for(const sn of bt)wn.push((En[1]||"")+En[2]+"."+sn);wn.length>0&&(on=wn.join(","))}const Ft=V.getAllCollectionIdentifiers(g),Yt=o.map(bt=>bt.name+":excerpt(200)").concat(r.map(bt=>"expand."+bt.name+".*:excerpt(200)"));Yt.length&&Yt.unshift("*");const vn=[];for(const bt of r){const wn=V.getExpandPresentableRelField(bt,d,2);wn&&vn.push(wn)}return _e.collection(g.id).getList(Le,h1,{sort:on,skipTotal:1,filter:V.normalizeSearchFilter(k,Ft),expand:vn.join(","),fields:Yt.join(","),requestKey:"records_list"}).then(async bt=>{var wn;if(Le<=1&&pe(),t(9,L=!1),t(8,T=bt.page),t(25,M=bt.items.length),h("load",$.concat(bt.items)),o.length)for(let sn of bt.items)sn._partial=!0;if(ot){const sn=++A;for(;(wn=bt.items)!=null&&wn.length&&A==sn;){const Dt=bt.items.splice(0,20);for(let Mi of Dt)V.pushOrReplaceByKey($,Mi);t(3,$),await V.yieldToMain()}}else{for(let sn of bt.items)V.pushOrReplaceByKey($,sn);t(3,$)}}).catch(bt=>{bt!=null&&bt.isAbort||(t(9,L=!1),console.warn(bt),pe(),_e.error(bt,!k||(bt==null?void 0:bt.status)!=400))})}function pe(){S==null||S.resetVerticalScroll(),t(3,$=[]),t(8,T=1),t(25,M=0),t(4,E={})}function ce(){c?ue():Te()}function ue(){t(4,E={})}function Te(){for(const Le of $)t(4,E[Le.id]=Le,E);t(4,E)}function Ke(Le){E[Le.id]?delete E[Le.id]:t(4,E[Le.id]=Le,E),t(4,E)}function Je(){_n(`Do you really want to delete the selected ${f===1?"record":"records"}?`,ft)}async function ft(){if(I||!f||!(g!=null&&g.id))return;let Le=[];for(const ot of Object.keys(E))Le.push(_e.collection(g.id).delete(ot));return t(10,I=!0),Promise.all(Le).then(()=>{nn(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",E),ue()}).catch(ot=>{_e.error(ot)}).finally(()=>(t(10,I=!1),Z()))}function et(Le){Pe.call(this,n,Le)}const xe=(Le,ot)=>{ot.target.checked?V.removeByValue(N,Le.id):V.pushUnique(N,Le.id),t(5,N)},We=()=>ce();function at(Le){_=Le,t(0,_)}function jt(Le){ie[Le?"unshift":"push"](()=>{P=Le,t(11,P)})}const Ve=Le=>Ke(Le),Ee=Le=>h("select",Le),st=(Le,ot)=>{ot.code==="Enter"&&(ot.preventDefault(),h("select",Le))},De=()=>t(1,k=""),Ye=()=>h("new"),ve=()=>G(T+1);function Ce(Le){ie[Le?"unshift":"push"](()=>{S=Le,t(7,S)})}const ct=()=>ue(),Ht=()=>Je();return n.$$set=Le=>{"collection"in Le&&t(22,g=Le.collection),"sort"in Le&&t(0,_=Le.sort),"filter"in Le&&t(1,k=Le.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&g!=null&&g.id&&(z=g.id+"@hiddenColumns",J(),pe()),n.$$.dirty[0]&4194304&&t(16,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(g==null?void 0:g.type)==="auth"&&g.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((g==null?void 0:g.fields)||[]).filter(Le=>!Le.hidden&&(!l||!F.includes(Le.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Le=>Le.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Le=>Le.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Le=>!N.includes(Le.id))),n.$$.dirty[0]&272629763&&!m&&g!=null&&g.id&&_!==-1&&k!==-1&&G(1),n.$$.dirty[0]&33554432&&t(14,u=M>=h1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=$.length&&f===$.length),n.$$.dirty[0]&32&&N!==-1&&U(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Le=>!Le.primaryKey).map(Le=>({id:Le.id,name:Le.name})))},[_,k,G,$,E,N,f,S,T,L,I,P,R,c,u,a,i,h,ce,ue,Ke,Je,g,Y,Z,M,s,l,m,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ve,Ce,ct,Ht]}class MN extends Se{constructor(e){super(),we(this,e,ON,$N,ke,{collection:22,sort:0,filter:1,hasRecord:23,reloadLoadedPages:24,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[23]}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[2]}}function EN(n){let e,t,i,l;return e=new fI({}),i=new pi({props:{class:"flex-content",$$slots:{footer:[AN],default:[LN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function DN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[RN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[FN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,{text:"Edit collection",position:"right"})),W(e,"click",n[21])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function g1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[24]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function LN(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P,N=!n[12]&&_1(n);c=new Pu({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&g1(n);k=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),M=new MN({props:U}),n[26](M),ie.push(()=>be(M,"filter",z)),ie.push(()=>be(M,"sort",F)),M.$on("select",n[29]),M.$on("delete",n[30]),M.$on("new",n[31]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=C(),s=b("div"),r=B(o),a=C(),u=b("div"),N&&N.c(),f=C(),j(c.$$.fragment),d=C(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',g=C(),R&&R.c(),_=C(),j(k.$$.fragment),S=C(),$=b("div"),T=C(),j(M.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(J,Y){v(J,e,Y),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),N&&N.m(u,null),w(u,f),q(c,u,null),w(e,d),w(e,m),w(m,h),w(m,g),R&&R.m(m,null),v(J,_,Y),q(k,J,Y),v(J,S,Y),v(J,$,Y),v(J,T,Y),q(M,J,Y),I=!0,A||(P=W(h,"click",n[23]),A=!0)},p(J,Y){(!I||Y[0]&4)&&o!==(o=J[2].name+"")&&oe(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,Y):(N=_1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,Y):(R=g1(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const Z={};Y[0]&1&&(Z.value=J[0]),Y[0]&4&&(Z.autocompleteCollection=J[2]),k.$set(Z);const G={};Y[0]&4&&(G.collection=J[2]),!E&&Y[0]&1&&(E=!0,G.filter=J[0],$e(()=>E=!1)),!L&&Y[0]&2&&(L=!0,G.sort=J[1],$e(()=>L=!1)),M.$set(G)},i(J){I||(O(c.$$.fragment,J),O(k.$$.fragment,J),O(M.$$.fragment,J),I=!0)},o(J){D(c.$$.fragment,J),D(k.$$.fragment,J),D(M.$$.fragment,J),I=!1},d(J){J&&(y(e),y(_),y(S),y($),y(T)),N&&N.d(),H(c),R&&R.d(),H(k,J),n[26](null),H(M,J),A=!1,P()}}}function AN(n){let e,t,i;function l(o){n[20](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new cN({props:s}),n[19](e),ie.push(()=>be(e,"totalCount",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[19](null),H(e,o)}}}function PN(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=C(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=W(i,"click",n[18]),l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,s()}}}function NN(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function RN(n){let e,t,i;function l(r,a){return r[12]?NN:PN}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){v(r,e,a),w(e,t),w(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&y(e),o.d()}}}function FN(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function qN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[IN,DN,EN],m=[];function h($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};l=new lf({props:g}),n[32](l),l.$on("truncate",n[33]);let _={};o=new q6({props:_}),n[34](o);let k={collection:n[2]};a=new rf({props:k}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new pL({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),j(f.$$.fragment)},m($,T){m[e].m($,T),v($,i,T),q(l,$,T),v($,s,T),q(o,$,T),v($,r,T),q(a,$,T),v($,u,T),q(f,$,T),c=!0},p($,T){let M=e;e=h($),e===M?m[e].p($,T):(re(),D(m[M],1,1,()=>{m[M]=null}),ae(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),O(t,1),t.m(i.parentNode,i));const E={};l.$set(E);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=$[2]),a.$set(I);const A={};T[0]&4&&(A.collection=$[2]),f.$set(A)},i($){c||(O(t),O(l.$$.fragment,$),O(o.$$.fragment,$),O(a.$$.fragment,$),O(f.$$.fragment,$),c=!0)},o($){D(t),D(l.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(f.$$.fragment,$),c=!1},d($){$&&(y(i),y(s),y(r),y(u)),m[e].d($),n[32](null),H(l,$),n[34](null),H(o,$),n[35](null),H(a,$),n[39](null),H(f,$)}}}function HN(n,e,t){let i,l,s,o,r,a,u,f;Qe(n,ti,Ee=>t(2,s=Ee)),Qe(n,un,Ee=>t(41,o=Ee)),Qe(n,Js,Ee=>t(3,r=Ee)),Qe(n,Au,Ee=>t(17,a=Ee)),Qe(n,Mn,Ee=>t(11,u=Ee)),Qe(n,Dl,Ee=>t(12,f=Ee));const c=new URLSearchParams(a);let d,m,h,g,_,k,S=c.get("filter")||"",$=c.get("sort")||"-@rowid",T=c.get("collection")||(s==null?void 0:s.id),M=0;Iu(T);async function E(Ee){await dn(),(s==null?void 0:s.type)==="view"?g.show(Ee):h==null||h.show(Ee)}function L(){t(14,T=s==null?void 0:s.id),t(0,S=""),t(1,$="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!$)return;const Ee=V.getAllCollectionIdentifiers(s),st=$.split(",").map(De=>De.startsWith("+")||De.startsWith("-")?De.substring(1):De);st.filter(De=>Ee.includes(De)).length!=st.length&&((s==null?void 0:s.type)!="view"?t(1,$="-@rowid"):Ee.includes("created")?t(1,$="-created"):t(1,$=""))}function A(Ee={}){const st=Object.assign({collection:(s==null?void 0:s.id)||"",filter:S,sort:$},Ee);V.replaceHashQueryParams(st)}const P=()=>d==null?void 0:d.show();function N(Ee){ie[Ee?"unshift":"push"](()=>{k=Ee,t(9,k)})}function R(Ee){M=Ee,t(10,M)}const z=()=>d==null?void 0:d.show(s),F=()=>{_==null||_.load(),k==null||k.reload()},U=()=>m==null?void 0:m.show(s),J=()=>h==null?void 0:h.show(),Y=Ee=>t(0,S=Ee.detail);function Z(Ee){ie[Ee?"unshift":"push"](()=>{_=Ee,t(8,_)})}function G(Ee){S=Ee,t(0,S)}function pe(Ee){$=Ee,t(1,$)}const ce=Ee=>{A({recordId:Ee.detail.id});let st=Ee.detail._partial?Ee.detail.id:Ee.detail;s.type==="view"?g==null||g.show(st):h==null||h.show(st)},ue=()=>{k==null||k.reload()},Te=()=>h==null?void 0:h.show();function Ke(Ee){ie[Ee?"unshift":"push"](()=>{d=Ee,t(4,d)})}const Je=()=>{_==null||_.load(),k==null||k.reload()};function ft(Ee){ie[Ee?"unshift":"push"](()=>{m=Ee,t(5,m)})}function et(Ee){ie[Ee?"unshift":"push"](()=>{h=Ee,t(6,h)})}const xe=()=>{A({recordId:null})},We=Ee=>{S?k==null||k.reload():Ee.detail.isNew&&t(10,M++,M),_==null||_.reloadLoadedPages()},at=Ee=>{(!S||_!=null&&_.hasRecord(Ee.detail.id))&&t(10,M--,M),_==null||_.reloadLoadedPages()};function jt(Ee){ie[Ee?"unshift":"push"](()=>{g=Ee,t(7,g)})}const Ve=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,l=i.get("collection")),n.$$.dirty[0]&49164&&!r&&l&&l!=T&&l!=(s==null?void 0:s.id)&&l!=(s==null?void 0:s.name)&&Bw(l),n.$$.dirty[0]&16388&&s!=null&&s.id&&T!=s.id&&T!=s.name&&L(),n.$$.dirty[0]&4&&s!=null&&s.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&($||S||s!=null&&s.id)&&A(),n.$$.dirty[0]&4&&Rn(un,o=(s==null?void 0:s.name)||"Collections",o)},[S,$,s,r,d,m,h,g,_,k,M,u,f,A,T,l,i,a,P,N,R,z,F,U,J,Y,Z,G,pe,ce,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve]}class jN extends Se{constructor(e){super(),we(this,e,HN,qN,ke,{},null,[-1,-1])}}function b1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=C(),i=b("a"),i.innerHTML=' Export collections',l=C(),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,u){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),o||(r=[Oe(qi.call(null,i,{path:"/settings/export-collections/?.*"})),Oe(Bn.call(null,i)),Oe(qi.call(null,s,{path:"/settings/import-collections/?.*"})),Oe(Bn.call(null,s))],o=!0)},d(a){a&&(y(e),y(t),y(i),y(l),y(s)),o=!1,Ie(r)}}}function zN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&b1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),l=b("a"),l.innerHTML=' Application',s=C(),o=b("a"),o.innerHTML=' Mail settings',r=C(),a=b("a"),a.innerHTML=' Files storage',u=C(),f=b("a"),f.innerHTML=' Backups',c=C(),h&&h.c(),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(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(g,_){v(g,e,_),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),w(e,r),w(e,a),w(e,u),w(e,f),w(e,c),h&&h.m(e,null),d||(m=[Oe(qi.call(null,l,{path:"/settings"})),Oe(Bn.call(null,l)),Oe(qi.call(null,o,{path:"/settings/mail/?.*"})),Oe(Bn.call(null,o)),Oe(qi.call(null,a,{path:"/settings/storage/?.*"})),Oe(Bn.call(null,a)),Oe(qi.call(null,f,{path:"/settings/backups/?.*"})),Oe(Bn.call(null,f))],d=!0)},p(g,_){g[0]?h&&(h.d(1),h=null):h||(h=b1(),h.c(),h.m(e,null))},d(g){g&&y(e),h&&h.d(),d=!1,Ie(m)}}}function UN(n){let e,t;return e=new vy({props:{class:"settings-sidebar",$$slots:{default:[zN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function VN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class hs extends Se{constructor(e){super(),we(this,e,VN,UN,ke,{})}}function BN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[8]),p(o,"class","txt-hint"),p(l,"for",r=n[8])},m(f,c){v(f,e,c),e.checked=n[0].batch.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=W(e,"change",n[4]),a=!0)},p(f,c){c&256&&t!==(t=f[8])&&p(e,"id",t),c&1&&(e.checked=f[0].batch.enabled),c&256&&r!==(r=f[8])&&p(l,"for",r)},d(f){f&&(y(e),y(i),y(l)),a=!1,u()}}}function WN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Max allowed batch requests"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].batch.maxRequests),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.maxRequests&&he(s,u[0].batch.maxRequests)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function YN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",l=C(),s=b("input"),p(t,"class","txt"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].batch.timeout),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.timeout&&he(s,u[0].batch.timeout)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function KN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max body size (in bytes)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),p(s,"placeholder","Default to 128MB"),s.value=r=n[0].batch.maxBodySize||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[7]),a=!0)},p(f,c){c&256&&i!==(i=f[8])&&p(e,"for",i),c&256&&o!==(o=f[8])&&p(s,"id",o),c&1&&r!==(r=f[0].batch.maxBodySize||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function JN(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[BN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[WN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[YN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[KN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),u=C(),f=b("div"),j(c.$$.fragment),p(l,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){q(e,m,h),v(m,t,h),v(m,i,h),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),w(i,u),w(i,f),q(c,f,null),d=!0},p(m,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:m}),e.$set(g);const _={};h&2&&(_.class="form-field "+(m[1]?"required":"")),h&771&&(_.$$scope={dirty:h,ctx:m}),s.$set(_);const k={};h&2&&(k.class="form-field "+(m[1]?"required":"")),h&771&&(k.$$scope={dirty:h,ctx:m}),a.$set(k);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(O(e.$$.fragment,m),O(s.$$.fragment,m),O(a.$$.fragment,m),O(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(y(t),y(i)),H(e,m),H(s),H(a),H(c)}}}function ZN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function GN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function k1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function XN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?GN:ZN}let a=r(n),u=a(n),f=n[2]&&k1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&O(f,1):(f=k1(),f.c(),O(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function QN(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[XN],default:[JN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xN(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=gt(this.value),t(0,o)}function u(){o.batch.timeout=gt(this.value),t(0,o)}const f=c=>t(0,o.batch.maxBodySize=c.target.value<<0,o);return n.$$set=c=>{"formSettings"in c&&t(0,o=c.formSettings)},n.$$.update=()=>{var c;n.$$.dirty&8&&t(2,i=!V.isEmpty(s==null?void 0:s.batch)),n.$$.dirty&1&&t(1,l=!!((c=o.batch)!=null&&c.enabled))},[o,l,i,s,r,a,u,f]}class e7 extends Se{constructor(e){super(),we(this,e,xN,QN,ke,{formSettings:0})}}function y1(n,e,t){const i=n.slice();return i[17]=e[t],i}function v1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=B(t),l=B(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&oe(i,t)},d(a){a&&(y(e),y(l)),s=!1,o()}}}function t7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function k(M){n[11](M)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new ms({props:S}),ie.push(()=>be(s,"value",k));let $=de(n[2]),T=[];for(let M=0;M<$.length;M+=1)T[M]=v1(y1(n,$,M));return{c(){e=b("label"),t=B("Trusted proxy headers"),l=C(),j(s.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=B(`Comma separated list of headers such as: - `);for(let M=0;Mo=!1)),s.$set(L),(!h||E&1)&&ee(u,"hidden",V.isEmpty(M[0].trustedProxy.headers)),E&68){$=de(M[2]);let I;for(I=0;I<$.length;I+=1){const A=y1(M,$,I);T[I]?T[I].p(A,E):(T[I]=v1(A),T[I].c(),T[I].m(d,null))}for(;Ibe(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[16])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"This is in case the proxy returns more than 1 IP as header value. The rightmost IP is usually considered to be the more trustworthy but this could vary depending on the proxy.",position:"right"})),f=!0)},p(h,g){(!u||g&65536&&s!==(s=h[16]))&&p(e,"for",s);const _={};!a&&g&1&&(a=!0,_.keyOfSelected=h[0].trustedProxy.useLeftmostIP,$e(()=>a=!1)),r.$set(_)},i(h){u||(O(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function i7(n){let e,t,i,l,s,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,g,_,k,S=(n[1].possibleProxyHeader||"N/A")+"",$,T,M,E,L,I,A,P,N,R,z,F,U;return A=new fe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[t7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new fe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[n7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=C(),o=b("strong"),a=B(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=C(),k=b("strong"),$=B(S),T=C(),M=b("div"),M.innerHTML=`

    When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as + `),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[66]),a[0]&1031165|a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&M(o,1)):(o=xg(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(y(t),y(i)),n[67](null),H(e,r),o&&o.d(r)}}}const El="form",io="providers";function aN(n,e,t){let i,l,s,o,r,a,u,f;const c=kt(),d="record_"+V.randomString(5);let{collection:m}=e,h,g,_={},k={},S=null,$=!1,T=!1,O={},E={},L=JSON.stringify(_),I=L,A=El,P=!0,N=!0,R=m,z=[];const F=["id"],U=F.concat("email","emailVisibility","verified","tokenKey","password");function J(se){return ce(se),t(14,T=!0),t(15,A=El),h==null?void 0:h.show()}function Y(){return h==null?void 0:h.hide()}function Z(){t(14,T=!1),Y()}function G(){t(35,R=m),h!=null&&h.isActive()&&(Je(JSON.stringify(k)),Z())}async function pe(se){if(!se)return null;let Me=typeof se=="string"?se:se==null?void 0:se.id;if(Me)try{return await _e.collection(m.id).getOne(Me)}catch(Ne){Ne.isAbort||(Z(),console.warn("resolveModel:",Ne),Ci(`Unable to load record with id "${Me}"`))}return typeof se=="object"?se:null}async function ce(se){t(7,N=!0),Ut({}),t(4,O={}),t(5,E={}),t(2,_=typeof se=="string"?{id:se,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:se||{}),t(3,k=structuredClone(_)),t(2,_=await pe(se)||{}),t(3,k=structuredClone(_)),await dn(),t(12,S=Ke()),!S||et(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(k)),t(7,N=!1)}async function ue(se){var Ne,ze;Ut({}),t(2,_=se||{}),t(4,O={}),t(5,E={});const Me=((ze=(Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(Ge=>Ge.type!="file"))==null?void 0:ze.map(Ge=>Ge.name))||[];for(let Ge in se)Me.includes(Ge)||t(3,k[Ge]=se[Ge],k);await dn(),t(33,L=JSON.stringify(k)),xe()}function Te(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function Ke(se){try{const Me=window.localStorage.getItem(Te());if(Me)return JSON.parse(Me)}catch{}return se}function Je(se){try{window.localStorage.setItem(Te(),se)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(Te())}}function ft(){S&&(t(3,k=S),t(12,S=null))}function et(se,Me){var qt;const Ne=structuredClone(se||{}),ze=structuredClone(Me||{}),Ge=(qt=m==null?void 0:m.fields)==null?void 0:qt.filter(Sn=>Sn.type==="file");for(let Sn of Ge)delete Ne[Sn.name],delete ze[Sn.name];const xt=["expand","password","passwordConfirm"];for(let Sn of xt)delete Ne[Sn],delete ze[Sn];return JSON.stringify(Ne)==JSON.stringify(ze)}function xe(){t(12,S=null),window.localStorage.removeItem(Te())}async function We(se=!0){var Me;if(!($||!u||!(m!=null&&m.id))){t(13,$=!0);try{const Ne=jt();let ze;if(P?ze=await _e.collection(m.id).create(Ne):ze=await _e.collection(m.id).update(k.id,Ne),nn(P?"Successfully created record.":"Successfully updated record."),xe(),l&&(k==null?void 0:k.id)==((Me=_e.authStore.record)==null?void 0:Me.id)&&Ne.get("password"))return _e.logout();se?Z():ue(ze),c("save",{isNew:P,record:ze})}catch(Ne){_e.error(Ne)}t(13,$=!1)}}function at(){_!=null&&_.id&&_n("Do you really want to delete the selected record?",()=>_e.collection(_.collectionId).delete(_.id).then(()=>{Z(),nn("Successfully deleted record."),c("delete",_)}).catch(se=>{_e.error(se)}))}function jt(){const se=structuredClone(k||{}),Me=new FormData,Ne={},ze={};for(const Ge of(m==null?void 0:m.fields)||[])Ge.type=="autodate"||i&&Ge.type=="password"||(Ne[Ge.name]=!0,Ge.type=="json"&&(ze[Ge.name]=!0));i&&se.password&&(Ne.password=!0),i&&se.passwordConfirm&&(Ne.passwordConfirm=!0);for(const Ge in se)if(Ne[Ge]){if(typeof se[Ge]>"u"&&(se[Ge]=null),ze[Ge]&&se[Ge]!=="")try{JSON.parse(se[Ge])}catch(xt){const qt={};throw qt[Ge]={code:"invalid_json",message:xt.toString()},new Fn({status:400,response:{data:qt}})}V.addValueToFormData(Me,Ge,se[Ge])}for(const Ge in O){const xt=V.toArray(O[Ge]);for(const qt of xt)Me.append(Ge+"+",qt)}for(const Ge in E){const xt=V.toArray(E[Ge]);for(const qt of xt)Me.append(Ge+"-",qt)}return Me}function Ve(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent verification email to ${_.email}?`,()=>_e.collection(m.id).requestVerification(_.email).then(()=>{nn(`Successfully sent verification email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function Ee(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent password reset email to ${_.email}?`,()=>_e.collection(m.id).requestPasswordReset(_.email).then(()=>{nn(`Successfully sent password reset email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function st(){a?_n("You have unsaved changes. Do you really want to discard them?",()=>{De()}):De()}async function De(){let se=_?structuredClone(_):null;if(se){const Me=["file","autodate"],Ne=(m==null?void 0:m.fields)||[];for(const ze of Ne)Me.includes(ze.type)&&delete se[ze.name];se.id=""}xe(),J(se),await dn(),t(33,L="")}function Ye(se){(se.ctrlKey||se.metaKey)&&se.code=="KeyS"&&(se.preventDefault(),se.stopPropagation(),We(!1))}function ve(){V.copyToClipboard(JSON.stringify(_,null,2)),Ks("The record JSON was copied to your clipboard!",3e3)}const Ce=()=>Y(),ct=()=>We(!1),Ht=()=>Ve(),Le=()=>Ee(),ot=()=>g==null?void 0:g.show(),on=()=>ve(),En=()=>st(),Re=()=>at(),Ft=()=>t(15,A=El),Yt=()=>t(15,A=io),vn=()=>ft(),fn=()=>xe();function Oi(){k.id=this.value,t(3,k)}function li(se){k=se,t(3,k)}function bt(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function wn(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function sn(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Dt(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Mi(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function ul(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function zi(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Ui(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function fl(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Dn(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function Rl(se,Me){n.$$.not_equal(O[Me.name],se)&&(O[Me.name]=se,t(4,O))}function cl(se,Me){n.$$.not_equal(E[Me.name],se)&&(E[Me.name]=se,t(5,E))}function X(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}function x(se,Me){n.$$.not_equal(k[Me.name],se)&&(k[Me.name]=se,t(3,k))}const le=()=>a&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{Z()}),!1):(Ut({}),xe(),!0);function ge(se){ie[se?"unshift":"push"](()=>{h=se,t(10,h)})}function Fe(se){Pe.call(this,n,se)}function Be(se){Pe.call(this,n,se)}function rt(se){ie[se?"unshift":"push"](()=>{g=se,t(11,g)})}return n.$$set=se=>{"collection"in se&&t(0,m=se.collection)},n.$$.update=()=>{var se,Me,Ne;n.$$.dirty[0]&1&&t(9,i=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&1&&t(17,l=(m==null?void 0:m.name)==="_superusers"),n.$$.dirty[0]&1&&t(20,s=!!((se=m==null?void 0:m.fields)!=null&&se.find(ze=>ze.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Me=m==null?void 0:m.fields)==null?void 0:Me.find(ze=>ze.name==="id")),n.$$.dirty[0]&48&&t(37,r=V.hasNonEmptyProps(O)||V.hasNonEmptyProps(E)),n.$$.dirty[0]&8&&t(34,I=JSON.stringify(k)),n.$$.dirty[1]&76&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!_||!_.id),n.$$.dirty[0]&448&&t(18,u=!N&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&8&&(N||Je(I)),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&m&&(R==null?void 0:R.id)!=(m==null?void 0:m.id)&&G(),n.$$.dirty[0]&512&&t(36,f=i?U:F),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&t(16,z=((Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(ze=>!f.includes(ze.name)&&ze.type!="autodate"))||[])},[m,Y,_,k,O,E,P,N,a,i,h,g,S,$,T,A,z,l,u,o,s,d,Z,ft,xe,We,at,Ve,Ee,st,Ye,ve,J,L,I,R,f,r,Ce,ct,Ht,Le,ot,on,En,Re,Ft,Yt,vn,fn,Oi,li,bt,wn,sn,Dt,Mi,ul,zi,Ui,fl,Dn,Rl,cl,X,x,le,ge,Fe,Be,rt]}class rf extends Se{constructor(e){super(),we(this,e,aN,rN,ke,{collection:0,show:32,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[32]}get hide(){return this.$$.ctx[1]}}function uN(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=C(),l=b("span"),o=B(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,l),w(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&oe(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:te,o:te,d(a){a&&y(e)}}}function fN(n,e,t){const i=kt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=V.getAllCollectionIdentifiers(l),c=await _e.collection(l.id).getList(1,1,{filter:V.normalizeSearchFilter(s,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class cN extends Se{constructor(e){super(),we(this,e,fN,uN,ke,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function e1(n,e,t){const i=n.slice();return i[58]=e[t],i}function t1(n,e,t){const i=n.slice();return i[61]=e[t],i}function n1(n,e,t){const i=n.slice();return i[61]=e[t],i}function i1(n,e,t){const i=n.slice();return i[54]=e[t],i}function l1(n){let e;function t(s,o){return s[9]?pN:dN}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){v(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&y(e),l.d()}}}function dN(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[13],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&8192&&(t.checked=a[13])},d(a){a&&y(e),o=!1,r()}}}function pN(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function mN(n){let e,t;return{c(){e=b("i"),p(e,"class",t=V.getFieldTypeIcon(n[61].type))},m(i,l){v(i,e,l)},p(i,l){l[0]&32768&&t!==(t=V.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function hN(n){let e;return{c(){e=b("i"),p(e,"class",V.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function _N(n){let e,t,i,l=n[61].name+"",s;function o(u,f){return u[61].primaryKey?hN:mN}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){v(u,e,f),a.m(e,null),w(e,t),w(e,i),w(i,s)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,t))),f[0]&32768&&l!==(l=u[61].name+"")&&oe(s,l)},d(u){u&&y(e),a.d()}}}function s1(n,e){let t,i,l,s;function o(a){e[32](a)}let r={class:"col-type-"+e[61].type+" col-field-"+e[61].name,name:e[61].name,$$slots:{default:[_N]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new ir({props:r}),ie.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[61].type+" col-field-"+e[61].name),u[0]&32768&&(f.name=e[61].name),u[0]&32768|u[2]&16&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function o1(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){v(t,e,i),n[33](e)},p:te,d(t){t&&y(e),n[33](null)}}}function r1(n){let e;function t(s,o){return s[9]?bN:gN}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function gN(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return yN;if(!a[16])return kN}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=C(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&y(e),r&&r.d()}}}function bN(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function kN(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){v(l,e,s),t||(i=W(e,"click",n[38]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function yN(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){v(l,e,s),t||(i=W(e,"click",n[37]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function a1(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=C(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[58].id),i.checked=s=n[4][n[58].id],p(r,"for",a="checkbox_"+n[58].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){v(d,e,m),w(e,t),w(t,i),w(t,o),w(t,r),u||(f=[W(i,"change",c),W(t,"click",On(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[58].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[58].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&y(e),u=!1,Ie(f)}}}function u1(n,e){let t,i,l,s;return i=new Sy({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),j(i.$$.fragment),p(t,"class",l="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){v(o,t,r),q(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[58]),r[0]&32768&&(a.field=e[61]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",l)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&y(t),H(i)}}}function f1(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&a1(e),d=de(e[15]);const m=_=>_[61].id;for(let _=0;_',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(_,k){v(_,t,k),c&&c.m(t,null),w(t,i);for(let S=0;SL[61].id;for(let L=0;L<_.length;L+=1){let I=n1(n,_,L),A=k(I);o.set(A,s[L]=s1(A,I))}let S=n[12].length&&o1(n),$=de(n[3]);const T=L=>L[16]?L[58]:L[58].id;for(let L=0;L<$.length;L+=1){let I=e1(n,$,L),A=T(I);d.set(A,c[L]=f1(A,I))}let O=null;$.length||(O=r1(n));let E=n[3].length&&n[14]&&c1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),l=C();for(let L=0;L({57:s}),({uniqueId:s})=>[0,s?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(i,s)}}}function SN(n){let e,t,i=[],l=new Map,s,o,r=de(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u{i=null}),ae())},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&y(e),i&&i.d(l)}}}function m1(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[6]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),ee(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),ee(h,"btn-loading",n[10]),ee(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m($,T){v($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,k||(S=[W(f,"click",n[41]),W(h,"click",n[42])],k=!0)},p($,T){(!_||T[0]&64)&&oe(s,$[6]),(!_||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&oe(a,r),(!_||T[0]&1024)&&ee(f,"btn-disabled",$[10]),(!_||T[0]&1024)&&ee(h,"btn-loading",$[10]),(!_||T[0]&1024)&&ee(h,"btn-disabled",$[10])},i($){_||($&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ie(S)}}}function $N(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[TN],default:[vN]},$$scope:{ctx:n}};e=new Nu({props:s}),n[40](e);let o=n[6]&&m1(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=ye()},m(r,a){q(e,r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l=!0},p(r,a){const u={};a[0]&129851|a[2]&16&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&M(o,1)):(o=m1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(y(t),y(i)),n[40](null),H(e,r),o&&o.d(r)}}}const CN=/^([\+\-])?(\w+)$/,h1=40;function ON(n,e,t){let i,l,s,o,r,a,u,f,c,d,m;Qe(n,Mn,Le=>t(47,d=Le)),Qe(n,Js,Le=>t(28,m=Le));const h=kt();let{collection:g}=e,{sort:_=""}=e,{filter:k=""}=e,S,$=[],T=1,O=0,E={},L=!0,I=!1,A=0,P,N=[],R=[],z="";const F=["verified","emailVisibility"];function U(){g!=null&&g.id&&(N.length?localStorage.setItem(z,JSON.stringify(N)):localStorage.removeItem(z))}function J(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Le=localStorage.getItem(z);Le&&t(5,N=JSON.parse(Le)||[])}catch{}}function Y(Le){return!!$.find(ot=>ot.id==Le)}async function Z(){const Le=T;for(let ot=1;ot<=Le;ot++)(ot===1||u)&&await G(ot,!1)}async function G(Le=1,ot=!0){var fn,Oi,li;if(!(g!=null&&g.id))return;t(9,L=!0);let on=_;const En=on.match(CN),Re=En?r.find(bt=>bt.name===En[2]):null;if(En&&Re){const bt=((li=(Oi=(fn=d==null?void 0:d.find(sn=>sn.id==Re.collectionId))==null?void 0:fn.fields)==null?void 0:Oi.filter(sn=>sn.presentable))==null?void 0:li.map(sn=>sn.name))||[],wn=[];for(const sn of bt)wn.push((En[1]||"")+En[2]+"."+sn);wn.length>0&&(on=wn.join(","))}const Ft=V.getAllCollectionIdentifiers(g),Yt=o.map(bt=>bt.name+":excerpt(200)").concat(r.map(bt=>"expand."+bt.name+".*:excerpt(200)"));Yt.length&&Yt.unshift("*");const vn=[];for(const bt of r){const wn=V.getExpandPresentableRelField(bt,d,2);wn&&vn.push(wn)}return _e.collection(g.id).getList(Le,h1,{sort:on,skipTotal:1,filter:V.normalizeSearchFilter(k,Ft),expand:vn.join(","),fields:Yt.join(","),requestKey:"records_list"}).then(async bt=>{var wn;if(Le<=1&&pe(),t(9,L=!1),t(8,T=bt.page),t(25,O=bt.items.length),h("load",$.concat(bt.items)),o.length)for(let sn of bt.items)sn._partial=!0;if(ot){const sn=++A;for(;(wn=bt.items)!=null&&wn.length&&A==sn;){const Dt=bt.items.splice(0,20);for(let Mi of Dt)V.pushOrReplaceByKey($,Mi);t(3,$),await V.yieldToMain()}}else{for(let sn of bt.items)V.pushOrReplaceByKey($,sn);t(3,$)}}).catch(bt=>{bt!=null&&bt.isAbort||(t(9,L=!1),console.warn(bt),pe(),_e.error(bt,!k||(bt==null?void 0:bt.status)!=400))})}function pe(){S==null||S.resetVerticalScroll(),t(3,$=[]),t(8,T=1),t(25,O=0),t(4,E={})}function ce(){c?ue():Te()}function ue(){t(4,E={})}function Te(){for(const Le of $)t(4,E[Le.id]=Le,E);t(4,E)}function Ke(Le){E[Le.id]?delete E[Le.id]:t(4,E[Le.id]=Le,E),t(4,E)}function Je(){_n(`Do you really want to delete the selected ${f===1?"record":"records"}?`,ft)}async function ft(){if(I||!f||!(g!=null&&g.id))return;let Le=[];for(const ot of Object.keys(E))Le.push(_e.collection(g.id).delete(ot));return t(10,I=!0),Promise.all(Le).then(()=>{nn(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",E),ue()}).catch(ot=>{_e.error(ot)}).finally(()=>(t(10,I=!1),Z()))}function et(Le){Pe.call(this,n,Le)}const xe=(Le,ot)=>{ot.target.checked?V.removeByValue(N,Le.id):V.pushUnique(N,Le.id),t(5,N)},We=()=>ce();function at(Le){_=Le,t(0,_)}function jt(Le){ie[Le?"unshift":"push"](()=>{P=Le,t(11,P)})}const Ve=Le=>Ke(Le),Ee=Le=>h("select",Le),st=(Le,ot)=>{ot.code==="Enter"&&(ot.preventDefault(),h("select",Le))},De=()=>t(1,k=""),Ye=()=>h("new"),ve=()=>G(T+1);function Ce(Le){ie[Le?"unshift":"push"](()=>{S=Le,t(7,S)})}const ct=()=>ue(),Ht=()=>Je();return n.$$set=Le=>{"collection"in Le&&t(22,g=Le.collection),"sort"in Le&&t(0,_=Le.sort),"filter"in Le&&t(1,k=Le.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&g!=null&&g.id&&(z=g.id+"@hiddenColumns",J(),pe()),n.$$.dirty[0]&4194304&&t(16,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(g==null?void 0:g.type)==="auth"&&g.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((g==null?void 0:g.fields)||[]).filter(Le=>!Le.hidden&&(!l||!F.includes(Le.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Le=>Le.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Le=>Le.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Le=>!N.includes(Le.id))),n.$$.dirty[0]&272629763&&!m&&g!=null&&g.id&&_!==-1&&k!==-1&&G(1),n.$$.dirty[0]&33554432&&t(14,u=O>=h1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=$.length&&f===$.length),n.$$.dirty[0]&32&&N!==-1&&U(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Le=>!Le.primaryKey).map(Le=>({id:Le.id,name:Le.name})))},[_,k,G,$,E,N,f,S,T,L,I,P,R,c,u,a,i,h,ce,ue,Ke,Je,g,Y,Z,O,s,l,m,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ve,Ce,ct,Ht]}class MN extends Se{constructor(e){super(),we(this,e,ON,$N,ke,{collection:22,sort:0,filter:1,hasRecord:23,reloadLoadedPages:24,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[23]}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[2]}}function EN(n){let e,t,i,l;return e=new fI({}),i=new pi({props:{class:"flex-content",$$slots:{footer:[AN],default:[LN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function DN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[RN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[FN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,{text:"Edit collection",position:"right"})),W(e,"click",n[21])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function g1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[24]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function LN(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N=!n[12]&&_1(n);c=new Pu({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&g1(n);k=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),O=new MN({props:U}),n[26](O),ie.push(()=>be(O,"filter",z)),ie.push(()=>be(O,"sort",F)),O.$on("select",n[29]),O.$on("delete",n[30]),O.$on("new",n[31]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=C(),s=b("div"),r=B(o),a=C(),u=b("div"),N&&N.c(),f=C(),j(c.$$.fragment),d=C(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',g=C(),R&&R.c(),_=C(),j(k.$$.fragment),S=C(),$=b("div"),T=C(),j(O.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(J,Y){v(J,e,Y),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),N&&N.m(u,null),w(u,f),q(c,u,null),w(e,d),w(e,m),w(m,h),w(m,g),R&&R.m(m,null),v(J,_,Y),q(k,J,Y),v(J,S,Y),v(J,$,Y),v(J,T,Y),q(O,J,Y),I=!0,A||(P=W(h,"click",n[23]),A=!0)},p(J,Y){(!I||Y[0]&4)&&o!==(o=J[2].name+"")&&oe(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,Y):(N=_1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,Y):(R=g1(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const Z={};Y[0]&1&&(Z.value=J[0]),Y[0]&4&&(Z.autocompleteCollection=J[2]),k.$set(Z);const G={};Y[0]&4&&(G.collection=J[2]),!E&&Y[0]&1&&(E=!0,G.filter=J[0],$e(()=>E=!1)),!L&&Y[0]&2&&(L=!0,G.sort=J[1],$e(()=>L=!1)),O.$set(G)},i(J){I||(M(c.$$.fragment,J),M(k.$$.fragment,J),M(O.$$.fragment,J),I=!0)},o(J){D(c.$$.fragment,J),D(k.$$.fragment,J),D(O.$$.fragment,J),I=!1},d(J){J&&(y(e),y(_),y(S),y($),y(T)),N&&N.d(),H(c),R&&R.d(),H(k,J),n[26](null),H(O,J),A=!1,P()}}}function AN(n){let e,t,i;function l(o){n[20](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new cN({props:s}),n[19](e),ie.push(()=>be(e,"totalCount",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[19](null),H(e,o)}}}function PN(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=C(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=W(i,"click",n[18]),l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,s()}}}function NN(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function RN(n){let e,t,i;function l(r,a){return r[12]?NN:PN}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){v(r,e,a),w(e,t),w(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&y(e),o.d()}}}function FN(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function qN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[IN,DN,EN],m=[];function h($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};l=new lf({props:g}),n[32](l),l.$on("truncate",n[33]);let _={};o=new q6({props:_}),n[34](o);let k={collection:n[2]};a=new rf({props:k}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new pL({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),j(f.$$.fragment)},m($,T){m[e].m($,T),v($,i,T),q(l,$,T),v($,s,T),q(o,$,T),v($,r,T),q(a,$,T),v($,u,T),q(f,$,T),c=!0},p($,T){let O=e;e=h($),e===O?m[e].p($,T):(re(),D(m[O],1,1,()=>{m[O]=null}),ae(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),M(t,1),t.m(i.parentNode,i));const E={};l.$set(E);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=$[2]),a.$set(I);const A={};T[0]&4&&(A.collection=$[2]),f.$set(A)},i($){c||(M(t),M(l.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(f.$$.fragment,$),c=!0)},o($){D(t),D(l.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(f.$$.fragment,$),c=!1},d($){$&&(y(i),y(s),y(r),y(u)),m[e].d($),n[32](null),H(l,$),n[34](null),H(o,$),n[35](null),H(a,$),n[39](null),H(f,$)}}}function HN(n,e,t){let i,l,s,o,r,a,u,f;Qe(n,ti,Ee=>t(2,s=Ee)),Qe(n,un,Ee=>t(41,o=Ee)),Qe(n,Js,Ee=>t(3,r=Ee)),Qe(n,Au,Ee=>t(17,a=Ee)),Qe(n,Mn,Ee=>t(11,u=Ee)),Qe(n,Dl,Ee=>t(12,f=Ee));const c=new URLSearchParams(a);let d,m,h,g,_,k,S=c.get("filter")||"",$=c.get("sort")||"-@rowid",T=c.get("collection")||(s==null?void 0:s.id),O=0;Iu(T);async function E(Ee){await dn(),(s==null?void 0:s.type)==="view"?g.show(Ee):h==null||h.show(Ee)}function L(){t(14,T=s==null?void 0:s.id),t(0,S=""),t(1,$="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!$)return;const Ee=V.getAllCollectionIdentifiers(s),st=$.split(",").map(De=>De.startsWith("+")||De.startsWith("-")?De.substring(1):De);st.filter(De=>Ee.includes(De)).length!=st.length&&((s==null?void 0:s.type)!="view"?t(1,$="-@rowid"):Ee.includes("created")?t(1,$="-created"):t(1,$=""))}function A(Ee={}){const st=Object.assign({collection:(s==null?void 0:s.id)||"",filter:S,sort:$},Ee);V.replaceHashQueryParams(st)}const P=()=>d==null?void 0:d.show();function N(Ee){ie[Ee?"unshift":"push"](()=>{k=Ee,t(9,k)})}function R(Ee){O=Ee,t(10,O)}const z=()=>d==null?void 0:d.show(s),F=()=>{_==null||_.load(),k==null||k.reload()},U=()=>m==null?void 0:m.show(s),J=()=>h==null?void 0:h.show(),Y=Ee=>t(0,S=Ee.detail);function Z(Ee){ie[Ee?"unshift":"push"](()=>{_=Ee,t(8,_)})}function G(Ee){S=Ee,t(0,S)}function pe(Ee){$=Ee,t(1,$)}const ce=Ee=>{A({recordId:Ee.detail.id});let st=Ee.detail._partial?Ee.detail.id:Ee.detail;s.type==="view"?g==null||g.show(st):h==null||h.show(st)},ue=()=>{k==null||k.reload()},Te=()=>h==null?void 0:h.show();function Ke(Ee){ie[Ee?"unshift":"push"](()=>{d=Ee,t(4,d)})}const Je=()=>{_==null||_.load(),k==null||k.reload()};function ft(Ee){ie[Ee?"unshift":"push"](()=>{m=Ee,t(5,m)})}function et(Ee){ie[Ee?"unshift":"push"](()=>{h=Ee,t(6,h)})}const xe=()=>{A({recordId:null})},We=Ee=>{S?k==null||k.reload():Ee.detail.isNew&&t(10,O++,O),_==null||_.reloadLoadedPages()},at=Ee=>{(!S||_!=null&&_.hasRecord(Ee.detail.id))&&t(10,O--,O),_==null||_.reloadLoadedPages()};function jt(Ee){ie[Ee?"unshift":"push"](()=>{g=Ee,t(7,g)})}const Ve=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,l=i.get("collection")),n.$$.dirty[0]&49164&&!r&&l&&l!=T&&l!=(s==null?void 0:s.id)&&l!=(s==null?void 0:s.name)&&Bw(l),n.$$.dirty[0]&16388&&s!=null&&s.id&&T!=s.id&&T!=s.name&&L(),n.$$.dirty[0]&4&&s!=null&&s.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&($||S||s!=null&&s.id)&&A(),n.$$.dirty[0]&4&&Rn(un,o=(s==null?void 0:s.name)||"Collections",o)},[S,$,s,r,d,m,h,g,_,k,O,u,f,A,T,l,i,a,P,N,R,z,F,U,J,Y,Z,G,pe,ce,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve]}class jN extends Se{constructor(e){super(),we(this,e,HN,qN,ke,{},null,[-1,-1])}}function b1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=C(),i=b("a"),i.innerHTML=' Export collections',l=C(),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,u){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),o||(r=[Oe(qi.call(null,i,{path:"/settings/export-collections/?.*"})),Oe(Bn.call(null,i)),Oe(qi.call(null,s,{path:"/settings/import-collections/?.*"})),Oe(Bn.call(null,s))],o=!0)},d(a){a&&(y(e),y(t),y(i),y(l),y(s)),o=!1,Ie(r)}}}function zN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&b1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),l=b("a"),l.innerHTML=' Application',s=C(),o=b("a"),o.innerHTML=' Mail settings',r=C(),a=b("a"),a.innerHTML=' Files storage',u=C(),f=b("a"),f.innerHTML=' Backups',c=C(),h&&h.c(),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(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(g,_){v(g,e,_),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),w(e,r),w(e,a),w(e,u),w(e,f),w(e,c),h&&h.m(e,null),d||(m=[Oe(qi.call(null,l,{path:"/settings"})),Oe(Bn.call(null,l)),Oe(qi.call(null,o,{path:"/settings/mail/?.*"})),Oe(Bn.call(null,o)),Oe(qi.call(null,a,{path:"/settings/storage/?.*"})),Oe(Bn.call(null,a)),Oe(qi.call(null,f,{path:"/settings/backups/?.*"})),Oe(Bn.call(null,f))],d=!0)},p(g,_){g[0]?h&&(h.d(1),h=null):h||(h=b1(),h.c(),h.m(e,null))},d(g){g&&y(e),h&&h.d(),d=!1,Ie(m)}}}function UN(n){let e,t;return e=new vy({props:{class:"settings-sidebar",$$slots:{default:[zN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function VN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class hs extends Se{constructor(e){super(),we(this,e,VN,UN,ke,{})}}function BN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[8]),p(o,"class","txt-hint"),p(l,"for",r=n[8])},m(f,c){v(f,e,c),e.checked=n[0].batch.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=W(e,"change",n[4]),a=!0)},p(f,c){c&256&&t!==(t=f[8])&&p(e,"id",t),c&1&&(e.checked=f[0].batch.enabled),c&256&&r!==(r=f[8])&&p(l,"for",r)},d(f){f&&(y(e),y(i),y(l)),a=!1,u()}}}function WN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Max allowed batch requests"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].batch.maxRequests),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.maxRequests&&he(s,u[0].batch.maxRequests)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function YN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",l=C(),s=b("input"),p(t,"class","txt"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),s.required=n[1]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].batch.timeout),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&2&&(s.required=u[1]),f&1&>(s.value)!==u[0].batch.timeout&&he(s,u[0].batch.timeout)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function KN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=B("Max body size (in bytes)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"id",o=n[8]),p(s,"min","0"),p(s,"step","1"),p(s,"placeholder","Default to 128MB"),s.value=r=n[0].batch.maxBodySize||""},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),a||(u=W(s,"input",n[7]),a=!0)},p(f,c){c&256&&i!==(i=f[8])&&p(e,"for",i),c&256&&o!==(o=f[8])&&p(s,"id",o),c&1&&r!==(r=f[0].batch.maxBodySize||"")&&s.value!==r&&(s.value=r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function JN(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[BN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[WN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[YN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[KN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),u=C(),f=b("div"),j(c.$$.fragment),p(l,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){q(e,m,h),v(m,t,h),v(m,i,h),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),w(i,u),w(i,f),q(c,f,null),d=!0},p(m,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:m}),e.$set(g);const _={};h&2&&(_.class="form-field "+(m[1]?"required":"")),h&771&&(_.$$scope={dirty:h,ctx:m}),s.$set(_);const k={};h&2&&(k.class="form-field "+(m[1]?"required":"")),h&771&&(k.$$scope={dirty:h,ctx:m}),a.$set(k);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(M(e.$$.fragment,m),M(s.$$.fragment,m),M(a.$$.fragment,m),M(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(y(t),y(i)),H(e,m),H(s),H(a),H(c)}}}function ZN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function GN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function k1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function XN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?GN:ZN}let a=r(n),u=a(n),f=n[2]&&k1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&M(f,1):(f=k1(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function QN(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[XN],default:[JN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xN(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=gt(this.value),t(0,o)}function u(){o.batch.timeout=gt(this.value),t(0,o)}const f=c=>t(0,o.batch.maxBodySize=c.target.value<<0,o);return n.$$set=c=>{"formSettings"in c&&t(0,o=c.formSettings)},n.$$.update=()=>{var c;n.$$.dirty&8&&t(2,i=!V.isEmpty(s==null?void 0:s.batch)),n.$$.dirty&1&&t(1,l=!!((c=o.batch)!=null&&c.enabled))},[o,l,i,s,r,a,u,f]}class e7 extends Se{constructor(e){super(),we(this,e,xN,QN,ke,{formSettings:0})}}function y1(n,e,t){const i=n.slice();return i[17]=e[t],i}function v1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=B(t),l=B(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&oe(i,t)},d(a){a&&(y(e),y(l)),s=!1,o()}}}function t7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function k(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new ms({props:S}),ie.push(()=>be(s,"value",k));let $=de(n[2]),T=[];for(let O=0;O<$.length;O+=1)T[O]=v1(y1(n,$,O));return{c(){e=b("label"),t=B("Trusted proxy headers"),l=C(),j(s.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=B(`Comma separated list of headers such as: + `);for(let O=0;Oo=!1)),s.$set(L),(!h||E&1)&&ee(u,"hidden",V.isEmpty(O[0].trustedProxy.headers)),E&68){$=de(O[2]);let I;for(I=0;I<$.length;I+=1){const A=y1(O,$,I);T[I]?T[I].p(A,E):(T[I]=v1(A),T[I].c(),T[I].m(d,null))}for(;Ibe(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[16])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"This is in case the proxy returns more than 1 IP as header value. The rightmost IP is usually considered to be the more trustworthy but this could vary depending on the proxy.",position:"right"})),f=!0)},p(h,g){(!u||g&65536&&s!==(s=h[16]))&&p(e,"for",s);const _={};!a&&g&1&&(a=!0,_.keyOfSelected=h[0].trustedProxy.useLeftmostIP,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function i7(n){let e,t,i,l,s,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,g,_,k,S=(n[1].possibleProxyHeader||"N/A")+"",$,T,O,E,L,I,A,P,N,R,z,F,U;return A=new fe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[t7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new fe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[n7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=C(),o=b("strong"),a=B(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=C(),k=b("strong"),$=B(S),T=C(),O=b("div"),O.innerHTML=`

    When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as NGINX, requests from different users will originate from the same IP address (the IP of the proxy connecting to your PocketBase app).

    In this case to retrieve the actual user IP (used for rate limiting, logging, etc.) you need to properly configure your proxy and list below the trusted headers that PocketBase could use to - extract the user IP.

    When using such proxy, to avoid spoofing it is recommended to:

    • use headers that are controlled only by the proxy and cannot be manually set by the users
    • make sure that the PocketBase server can be accessed only through the proxy

    You can clear the headers field if PocketBase is not deployed behind a proxy.

    `,E=C(),L=b("div"),I=b("div"),j(A.$$.fragment),P=C(),N=b("div"),j(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(h,"class","inline-flex flex-gap-5"),p(t,"class","content"),p(e,"class","alert alert-info m-b-sm"),p(M,"class","content m-b-sm"),p(I,"class","col-lg-9"),p(N,"class","col-lg-3"),p(L,"class","grid grid-sm")},m(J,Y){v(J,e,Y),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,a),w(i,u),w(i,f),w(t,c),w(t,d),w(t,m),w(t,h),w(h,g),w(h,_),w(h,k),w(k,$),v(J,T,Y),v(J,M,Y),v(J,E,Y),v(J,L,Y),w(L,I),q(A,I,null),w(L,P),w(L,N),q(R,N,null),z=!0,F||(U=Oe(qe.call(null,f,`Must show your actual IP. -If not, set the correct proxy header.`)),F=!0)},p(J,Y){(!z||Y&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&oe(a,r),(!z||Y&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&oe($,S);const Z={};Y&1114117&&(Z.$$scope={dirty:Y,ctx:J}),A.$set(Z);const G={};Y&1114113&&(G.$$scope={dirty:Y,ctx:J}),R.$set(G)},i(J){z||(O(A.$$.fragment,J),O(R.$$.fragment,J),z=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),z=!1},d(J){J&&(y(e),y(T),y(M),y(E),y(L)),H(A),H(R),F=!1,U()}}}function l7(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(l){l&&y(e),t=!1,i()}}}function s7(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,`Detected proxy header. -It is recommend to list it as trusted.`)),t=!0)},d(l){l&&y(e),t=!1,i()}}}function o7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function r7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function w1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function a7(n){let e,t,i,l,s,o,r,a,u,f,c;function d($,T){if(T&43&&(o=null),!$[3]&&$[1].possibleProxyHeader)return s7;if(o==null&&(o=!!($[3]&&!$[5]&&!$[0].trustedProxy.headers.includes($[1].possibleProxyHeader))),o)return l7}let m=d(n,-1),h=m&&m(n);function g($,T){return $[3]?r7:o7}let _=g(n),k=_(n),S=n[4]&&w1();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),l.textContent="User IP proxy headers",s=C(),h&&h.c(),r=C(),a=b("div"),u=C(),k.c(),f=C(),S&&S.c(),c=ye(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m($,T){v($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),v($,r,T),v($,a,T),v($,u,T),k.m($,T),v($,f,T),S&&S.m($,T),v($,c,T)},p($,T){m!==(m=d($,T))&&(h&&h.d(1),h=m&&m($),h&&(h.c(),h.m(e,null))),_!==(_=g($))&&(k.d(1),k=_($),k&&(k.c(),k.m(f.parentNode,f))),$[4]?S?T&16&&O(S,1):(S=w1(),S.c(),O(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d($){$&&(y(e),y(r),y(a),y(u),y(f),y(c)),h&&h.d(),k.d($),S&&S.d($)}}}function u7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[a7],default:[i7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f7(n,e,t){let i,l,s,o,r,a;Qe(n,yn,$=>t(10,a=$));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m($){t(0,f.trustedProxy.headers=[$],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g($){n.$$.not_equal(f.trustedProxy.headers,$)&&(f.trustedProxy.headers=$,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),k=$=>m($);function S($){n.$$.not_equal(f.trustedProxy.useLeftmostIP,$)&&(f.trustedProxy.useLeftmostIP=$,t(0,f))}return n.$$set=$=>{"formSettings"in $&&t(0,f=$.formSettings),"healthData"in $&&t(1,c=$.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!V.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!V.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter($=>$!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,k,S]}class c7 extends Se{constructor(e){super(),we(this,e,f7,u7,ke,{formSettings:0,healthData:1})}}function S1(n,e,t){const i=n.slice();return i[5]=e[t],i}function T1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=B(t),e.__value=l=n[5].value,he(e,e.__value)},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&oe(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,he(e,e.__value))},d(s){s&&y(e)}}}function d7(n){let e,t,i,l,s,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c{t(0,s=u.target.value)};return n.$$set=u=>{e=je(je({},e),Wt(u)),t(3,l=lt(e,i)),"value"in u&&t(0,s=u.value),"options"in u&&t(1,o=u.options)},[s,o,r,l,a]}class m7 extends Se{constructor(e){super(),we(this,e,p7,d7,ke,{value:0,options:1})}}function $1(n,e,t){const i=n.slice();return i[22]=e[t],i}function C1(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function h7(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[28]),p(o,"class","txt-hint"),p(l,"for",r=n[28])},m(f,c){v(f,e,c),e.checked=n[0].rateLimits.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=W(e,"change",n[9]),a=!0)},p(f,c){c&268435456&&t!==(t=f[28])&&p(e,"id",t),c&1&&(e.checked=f[0].rateLimits.enabled),c&268435456&&r!==(r=f[28])&&p(l,"for",r)},d(f){f&&(y(e),y(i),y(l)),a=!1,u()}}}function O1(n){let e,t,i,l,s,o=de(n[0].rateLimits.rules||[]),r=[];for(let u=0;uD(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML='Rate limit label Max requests
    (per IP) Interval
    (in seconds) Targeted users ',i=C(),l=b("tbody");for(let u=0;ube(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r&4&&(a.options=n[2]),!t&&r&1&&(t=!0,a.value=n[25].label,$e(()=>t=!1)),e.$set(a)},i(o){i||(O(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function g7(n){let e,t,i;function l(){n[11].call(e,n[26],n[27])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Max requests*"),p(e,"min","1"),p(e,"step","1")},m(s,o){v(s,e,o),he(e,n[25].maxRequests),t||(i=W(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[25].maxRequests&&he(e,n[25].maxRequests)},d(s){s&&y(e),t=!1,i()}}}function b7(n){let e,t,i;function l(){n[12].call(e,n[26],n[27])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Interval*"),p(e,"min","1"),p(e,"step","1")},m(s,o){v(s,e,o),he(e,n[25].duration),t||(i=W(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[25].duration&&he(e,n[25].duration)},d(s){s&&y(e),t=!1,i()}}}function k7(n){let e,t,i;function l(r){n[13](r,n[25])}function s(){return n[14](n[27])}let o={items:n[5]};return n[25].audience!==void 0&&(o.keyOfSelected=n[25].audience),e=new zn({props:o}),ie.push(()=>be(e,"keyOfSelected",l)),e.$on("change",s),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,a){n=r;const u={};!t&&a&1&&(t=!0,u.keyOfSelected=n[25].audience,$e(()=>t=!1)),e.$set(u)},i(r){i||(O(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function M1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$;i=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".label",inlineError:!0,$$slots:{default:[_7]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".maxRequests",inlineError:!0,$$slots:{default:[g7]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".duration",inlineError:!0,$$slots:{default:[b7]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".audience",inlineError:!0,$$slots:{default:[k7]},$$scope:{ctx:n}}});function T(){return n[15](n[27])}return{c(){e=b("tr"),t=b("td"),j(i.$$.fragment),l=C(),s=b("td"),j(o.$$.fragment),r=C(),a=b("td"),j(u.$$.fragment),f=C(),c=b("td"),j(d.$$.fragment),m=C(),h=b("td"),g=b("button"),g.innerHTML='',_=C(),p(t,"class","col-label"),p(s,"class","col-requests"),p(a,"class","col-duration"),p(c,"class","col-audience"),p(g,"type","button"),p(g,"title","Remove rule"),p(g,"aria-label","Remove rule"),p(g,"class","btn btn-xs btn-circle btn-hint btn-transparent"),p(h,"class","col-action"),p(e,"class","rate-limit-row")},m(M,E){v(M,e,E),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),w(h,g),w(e,_),k=!0,S||($=W(g,"click",T),S=!0)},p(M,E){n=M;const L={};E&536870917&&(L.$$scope={dirty:E,ctx:n}),i.$set(L);const I={};E&536870913&&(I.$$scope={dirty:E,ctx:n}),o.$set(I);const A={};E&536870913&&(A.$$scope={dirty:E,ctx:n}),u.$set(A);const P={};E&536870913&&(P.$$scope={dirty:E,ctx:n}),d.$set(P)},i(M){k||(O(i.$$.fragment,M),O(o.$$.fragment,M),O(u.$$.fragment,M),O(d.$$.fragment,M),k=!0)},o(M){D(i.$$.fragment,M),D(o.$$.fragment,M),D(u.$$.fragment,M),D(d.$$.fragment,M),k=!1},d(M){M&&y(e),H(i),H(o),H(u),H(d),S=!1,$()}}}function y7(n){let e,t,i=!V.isEmpty(n[0].rateLimits.rules),l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[h7,({uniqueId:m})=>({28:m}),({uniqueId:m})=>m?268435456:0]},$$scope:{ctx:n}}});let d=i&&O1(n);return{c(){var m,h,g;j(e.$$.fragment),t=C(),d&&d.c(),l=C(),s=b("div"),o=b("button"),o.innerHTML=' Add rate limit rule',r=C(),a=b("button"),a.innerHTML="Learn more about the rate limit rules",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),ee(o,"btn-danger",(g=(h=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:h.rules)==null?void 0:g.message),p(a,"type","button"),p(a,"class","txt-nowrap txt-sm link-hint"),p(s,"class","flex m-t-sm")},m(m,h){q(e,m,h),v(m,t,h),d&&d.m(m,h),v(m,l,h),v(m,s,h),w(s,o),w(s,r),w(s,a),u=!0,f||(c=[W(o,"click",n[16]),W(a,"click",n[17])],f=!0)},p(m,h){var _,k,S;const g={};h&805306369&&(g.$$scope={dirty:h,ctx:m}),e.$set(g),h&1&&(i=!V.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&O(d,1)):(d=O1(m),d.c(),O(d,1),d.m(l.parentNode,l)):d&&(re(),D(d,1,1,()=>{d=null}),ae()),(!u||h&2)&&ee(o,"btn-danger",(S=(k=(_=m[1])==null?void 0:_.rateLimits)==null?void 0:k.rules)==null?void 0:S.message)},i(m){u||(O(e.$$.fragment,m),O(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(y(t),y(l),y(s)),H(e,m),d&&d.d(m),f=!1,Ie(c)}}}function E1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function v7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function w7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function S7(n){let e,t,i,l,s,o,r=n[4]&&E1();function a(c,d){return c[0].rateLimits.enabled?w7:v7}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML=' Rate limiting',t=C(),i=b("div"),l=C(),r&&r.c(),s=C(),f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),r&&r.m(c,d),v(c,s,d),f.m(c,d),v(c,o,d)},p(c,d){c[4]?r?d&16&&O(r,1):(r=E1(),r.c(),O(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),r&&r.d(c),f.d(c)}}}function T7(n){let e;return{c(){e=b("em"),e.textContent=`(${n[22].description})`,p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function D1(n){let e,t=n[22].value.replace("*:",":")+"",i,l,s,o=n[22].description&&T7(n);return{c(){e=b("li"),i=B(t),l=C(),o&&o.c(),s=C(),p(e,"class","m-0")},m(r,a){v(r,e,a),w(e,i),w(e,l),o&&o.m(e,null),w(e,s)},p(r,a){r[22].description&&o.p(r,a)},d(r){r&&y(e),o&&o.d()}}}function $7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P,N,R,z,F,U,J=de(n[6]),Y=[];for(let Z=0;Zexact tag (e.g. users:create)
  • wildcard tag (e.g. *:create)
  • METHOD + exact path (e.g. POST /a/b)
  • METHOD + prefix path (e.g. POST /a/b/)
  • exact path (e.g. /a/b)
  • prefix path (e.g. /a/b/)
  • ",l=C(),s=b("p"),s.textContent=`In case of multiple rules with the same label but different target user audience (e.g. "guest" vs + extract the user IP.

    When using such proxy, to avoid spoofing it is recommended to:

    • use headers that are controlled only by the proxy and cannot be manually set by the users
    • make sure that the PocketBase server can be accessed only through the proxy

    You can clear the headers field if PocketBase is not deployed behind a proxy.

    `,E=C(),L=b("div"),I=b("div"),j(A.$$.fragment),P=C(),N=b("div"),j(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(h,"class","inline-flex flex-gap-5"),p(t,"class","content"),p(e,"class","alert alert-info m-b-sm"),p(O,"class","content m-b-sm"),p(I,"class","col-lg-9"),p(N,"class","col-lg-3"),p(L,"class","grid grid-sm")},m(J,Y){v(J,e,Y),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,a),w(i,u),w(i,f),w(t,c),w(t,d),w(t,m),w(t,h),w(h,g),w(h,_),w(h,k),w(k,$),v(J,T,Y),v(J,O,Y),v(J,E,Y),v(J,L,Y),w(L,I),q(A,I,null),w(L,P),w(L,N),q(R,N,null),z=!0,F||(U=Oe(qe.call(null,f,`Must show your actual IP. +If not, set the correct proxy header.`)),F=!0)},p(J,Y){(!z||Y&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&oe(a,r),(!z||Y&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&oe($,S);const Z={};Y&1114117&&(Z.$$scope={dirty:Y,ctx:J}),A.$set(Z);const G={};Y&1114113&&(G.$$scope={dirty:Y,ctx:J}),R.$set(G)},i(J){z||(M(A.$$.fragment,J),M(R.$$.fragment,J),z=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),z=!1},d(J){J&&(y(e),y(T),y(O),y(E),y(L)),H(A),H(R),F=!1,U()}}}function l7(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(l){l&&y(e),t=!1,i()}}}function s7(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,`Detected proxy header. +It is recommend to list it as trusted.`)),t=!0)},d(l){l&&y(e),t=!1,i()}}}function o7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function r7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function w1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function a7(n){let e,t,i,l,s,o,r,a,u,f,c;function d($,T){if(T&43&&(o=null),!$[3]&&$[1].possibleProxyHeader)return s7;if(o==null&&(o=!!($[3]&&!$[5]&&!$[0].trustedProxy.headers.includes($[1].possibleProxyHeader))),o)return l7}let m=d(n,-1),h=m&&m(n);function g($,T){return $[3]?r7:o7}let _=g(n),k=_(n),S=n[4]&&w1();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),l.textContent="User IP proxy headers",s=C(),h&&h.c(),r=C(),a=b("div"),u=C(),k.c(),f=C(),S&&S.c(),c=ye(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m($,T){v($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),v($,r,T),v($,a,T),v($,u,T),k.m($,T),v($,f,T),S&&S.m($,T),v($,c,T)},p($,T){m!==(m=d($,T))&&(h&&h.d(1),h=m&&m($),h&&(h.c(),h.m(e,null))),_!==(_=g($))&&(k.d(1),k=_($),k&&(k.c(),k.m(f.parentNode,f))),$[4]?S?T&16&&M(S,1):(S=w1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d($){$&&(y(e),y(r),y(a),y(u),y(f),y(c)),h&&h.d(),k.d($),S&&S.d($)}}}function u7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[a7],default:[i7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f7(n,e,t){let i,l,s,o,r,a;Qe(n,yn,$=>t(10,a=$));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m($){t(0,f.trustedProxy.headers=[$],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g($){n.$$.not_equal(f.trustedProxy.headers,$)&&(f.trustedProxy.headers=$,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),k=$=>m($);function S($){n.$$.not_equal(f.trustedProxy.useLeftmostIP,$)&&(f.trustedProxy.useLeftmostIP=$,t(0,f))}return n.$$set=$=>{"formSettings"in $&&t(0,f=$.formSettings),"healthData"in $&&t(1,c=$.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!V.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!V.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter($=>$!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,k,S]}class c7 extends Se{constructor(e){super(),we(this,e,f7,u7,ke,{formSettings:0,healthData:1})}}function S1(n,e,t){const i=n.slice();return i[5]=e[t],i}function T1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=B(t),e.__value=l=n[5].value,he(e,e.__value)},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&oe(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,he(e,e.__value))},d(s){s&&y(e)}}}function d7(n){let e,t,i,l,s,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c{t(0,s=u.target.value)};return n.$$set=u=>{e=je(je({},e),Wt(u)),t(3,l=lt(e,i)),"value"in u&&t(0,s=u.value),"options"in u&&t(1,o=u.options)},[s,o,r,l,a]}class m7 extends Se{constructor(e){super(),we(this,e,p7,d7,ke,{value:0,options:1})}}function $1(n,e,t){const i=n.slice();return i[22]=e[t],i}function C1(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function h7(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[28]),p(o,"class","txt-hint"),p(l,"for",r=n[28])},m(f,c){v(f,e,c),e.checked=n[0].rateLimits.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=W(e,"change",n[9]),a=!0)},p(f,c){c&268435456&&t!==(t=f[28])&&p(e,"id",t),c&1&&(e.checked=f[0].rateLimits.enabled),c&268435456&&r!==(r=f[28])&&p(l,"for",r)},d(f){f&&(y(e),y(i),y(l)),a=!1,u()}}}function O1(n){let e,t,i,l,s,o=de(n[0].rateLimits.rules||[]),r=[];for(let u=0;uD(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML='Rate limit label Max requests
    (per IP) Interval
    (in seconds) Targeted users ',i=C(),l=b("tbody");for(let u=0;ube(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r&4&&(a.options=n[2]),!t&&r&1&&(t=!0,a.value=n[25].label,$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function g7(n){let e,t,i;function l(){n[11].call(e,n[26],n[27])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Max requests*"),p(e,"min","1"),p(e,"step","1")},m(s,o){v(s,e,o),he(e,n[25].maxRequests),t||(i=W(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[25].maxRequests&&he(e,n[25].maxRequests)},d(s){s&&y(e),t=!1,i()}}}function b7(n){let e,t,i;function l(){n[12].call(e,n[26],n[27])}return{c(){e=b("input"),p(e,"type","number"),e.required=!0,p(e,"placeholder","Interval*"),p(e,"min","1"),p(e,"step","1")},m(s,o){v(s,e,o),he(e,n[25].duration),t||(i=W(e,"input",l),t=!0)},p(s,o){n=s,o&1&>(e.value)!==n[25].duration&&he(e,n[25].duration)},d(s){s&&y(e),t=!1,i()}}}function k7(n){let e,t,i;function l(r){n[13](r,n[25])}function s(){return n[14](n[27])}let o={items:n[5]};return n[25].audience!==void 0&&(o.keyOfSelected=n[25].audience),e=new zn({props:o}),ie.push(()=>be(e,"keyOfSelected",l)),e.$on("change",s),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,a){n=r;const u={};!t&&a&1&&(t=!0,u.keyOfSelected=n[25].audience,$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function M1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$;i=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".label",inlineError:!0,$$slots:{default:[_7]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".maxRequests",inlineError:!0,$$slots:{default:[g7]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".duration",inlineError:!0,$$slots:{default:[b7]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".audience",inlineError:!0,$$slots:{default:[k7]},$$scope:{ctx:n}}});function T(){return n[15](n[27])}return{c(){e=b("tr"),t=b("td"),j(i.$$.fragment),l=C(),s=b("td"),j(o.$$.fragment),r=C(),a=b("td"),j(u.$$.fragment),f=C(),c=b("td"),j(d.$$.fragment),m=C(),h=b("td"),g=b("button"),g.innerHTML='',_=C(),p(t,"class","col-label"),p(s,"class","col-requests"),p(a,"class","col-duration"),p(c,"class","col-audience"),p(g,"type","button"),p(g,"title","Remove rule"),p(g,"aria-label","Remove rule"),p(g,"class","btn btn-xs btn-circle btn-hint btn-transparent"),p(h,"class","col-action"),p(e,"class","rate-limit-row")},m(O,E){v(O,e,E),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),w(h,g),w(e,_),k=!0,S||($=W(g,"click",T),S=!0)},p(O,E){n=O;const L={};E&536870917&&(L.$$scope={dirty:E,ctx:n}),i.$set(L);const I={};E&536870913&&(I.$$scope={dirty:E,ctx:n}),o.$set(I);const A={};E&536870913&&(A.$$scope={dirty:E,ctx:n}),u.$set(A);const P={};E&536870913&&(P.$$scope={dirty:E,ctx:n}),d.$set(P)},i(O){k||(M(i.$$.fragment,O),M(o.$$.fragment,O),M(u.$$.fragment,O),M(d.$$.fragment,O),k=!0)},o(O){D(i.$$.fragment,O),D(o.$$.fragment,O),D(u.$$.fragment,O),D(d.$$.fragment,O),k=!1},d(O){O&&y(e),H(i),H(o),H(u),H(d),S=!1,$()}}}function y7(n){let e,t,i=!V.isEmpty(n[0].rateLimits.rules),l,s,o,r,a,u,f,c;e=new fe({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[h7,({uniqueId:m})=>({28:m}),({uniqueId:m})=>m?268435456:0]},$$scope:{ctx:n}}});let d=i&&O1(n);return{c(){var m,h,g;j(e.$$.fragment),t=C(),d&&d.c(),l=C(),s=b("div"),o=b("button"),o.innerHTML=' Add rate limit rule',r=C(),a=b("button"),a.innerHTML="Learn more about the rate limit rules",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),ee(o,"btn-danger",(g=(h=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:h.rules)==null?void 0:g.message),p(a,"type","button"),p(a,"class","txt-nowrap txt-sm link-hint"),p(s,"class","flex m-t-sm")},m(m,h){q(e,m,h),v(m,t,h),d&&d.m(m,h),v(m,l,h),v(m,s,h),w(s,o),w(s,r),w(s,a),u=!0,f||(c=[W(o,"click",n[16]),W(a,"click",n[17])],f=!0)},p(m,h){var _,k,S;const g={};h&805306369&&(g.$$scope={dirty:h,ctx:m}),e.$set(g),h&1&&(i=!V.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&M(d,1)):(d=O1(m),d.c(),M(d,1),d.m(l.parentNode,l)):d&&(re(),D(d,1,1,()=>{d=null}),ae()),(!u||h&2)&&ee(o,"btn-danger",(S=(k=(_=m[1])==null?void 0:_.rateLimits)==null?void 0:k.rules)==null?void 0:S.message)},i(m){u||(M(e.$$.fragment,m),M(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(y(t),y(l),y(s)),H(e,m),d&&d.d(m),f=!1,Ie(c)}}}function E1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function v7(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function w7(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function S7(n){let e,t,i,l,s,o,r=n[4]&&E1();function a(c,d){return c[0].rateLimits.enabled?w7:v7}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML=' Rate limiting',t=C(),i=b("div"),l=C(),r&&r.c(),s=C(),f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),r&&r.m(c,d),v(c,s,d),f.m(c,d),v(c,o,d)},p(c,d){c[4]?r?d&16&&M(r,1):(r=E1(),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),r&&r.d(c),f.d(c)}}}function T7(n){let e;return{c(){e=b("em"),e.textContent=`(${n[22].description})`,p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function D1(n){let e,t=n[22].value.replace("*:",":")+"",i,l,s,o=n[22].description&&T7(n);return{c(){e=b("li"),i=B(t),l=C(),o&&o.c(),s=C(),p(e,"class","m-0")},m(r,a){v(r,e,a),w(e,i),w(e,l),o&&o.m(e,null),w(e,s)},p(r,a){r[22].description&&o.p(r,a)},d(r){r&&y(e),o&&o.d()}}}function $7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,U,J=de(n[6]),Y=[];for(let Z=0;Zexact tag (e.g. users:create)
  • wildcard tag (e.g. *:create)
  • METHOD + exact path (e.g. POST /a/b)
  • METHOD + prefix path (e.g. POST /a/b/)
  • exact path (e.g. /a/b)
  • prefix path (e.g. /a/b/)
  • ",l=C(),s=b("p"),s.textContent=`In case of multiple rules with the same label but different target user audience (e.g. "guest" vs "auth"), only the matching audience rule is taken in consideration.`,o=C(),r=b("hr"),a=C(),u=b("p"),u.textContent="The rate limit label could be in one of the following formats:",f=C(),c=b("ul"),d=b("li"),d.innerHTML=`[METHOD ]/my/path - full exact route match ( must be without trailing slash ; "METHOD" is optional).
    For example: @@ -181,34 +181,34 @@ It is recommend to list it as trusted.`)),t=!0)},d(l){l&&y(e),t=!1,i()}}}functio POST /hello/a/b/c, etc.
  • POST /hello/ - matches POST /hello, POST /hello/a/b/c, etc.
  • `,g=C(),_=b("li"),k=b("code"),k.textContent="collectionName:predefinedTag",S=B(` - targets a specific action of a single collection. To apply the rule for all collections you can use the `),$=b("code"),$.textContent="*",T=B(` wildcard. For example: - `),M=b("code"),M.textContent="posts:create",E=B(", "),L=b("code"),L.textContent="users:listAuthMethods",I=B(", "),A=b("code"),A.textContent="*:auth",P=B(`. + `),O=b("code"),O.textContent="posts:create",E=B(", "),L=b("code"),L.textContent="users:listAuthMethods",I=B(", "),A=b("code"),A.textContent="*:auth",P=B(`. `),N=b("br"),R=B(` The predifined collection tags are (`),z=b("em"),z.textContent="there should be autocomplete once you start typing",F=B(`): - `),U=b("ul");for(let Z=0;Zt(20,l=A)),Qe(n,yn,A=>t(1,s=A));let{formSettings:o}=e;const r=[{value:"",label:"All"},{value:"@guest",label:"Guest only"},{value:"@auth",label:"Auth only"}],a=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file",description:"targets the files download endpoint"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth",description:"targets all auth methods"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let u=a,f;c();async function c(){await Iu(),t(2,u=[]);for(let A of l)A.system||(u.push({value:A.name+":list"}),u.push({value:A.name+":view"}),A.type!="view"&&(u.push({value:A.name+":create"}),u.push({value:A.name+":update"}),u.push({value:A.name+":delete"})),A.type=="auth"&&(u.push({value:A.name+":listAuthMethods"}),u.push({value:A.name+":authRefresh"}),u.push({value:A.name+":auth"}),u.push({value:A.name+":authWithPassword"}),u.push({value:A.name+":authWithOAuth2"}),u.push({value:A.name+":authWithOTP"}),u.push({value:A.name+":requestOTP"}),u.push({value:A.name+":requestPasswordReset"}),u.push({value:A.name+":confirmPasswordReset"}),u.push({value:A.name+":requestVerification"}),u.push({value:A.name+":confirmVerification"}),u.push({value:A.name+":requestEmailChange"}),u.push({value:A.name+":confirmEmailChange"})),A.fields.find(P=>P.type=="file")&&u.push({value:A.name+":file"}));t(2,u=u.concat(a))}function d(){Ut({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10,audience:""}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function m(A){Ut({}),o.rateLimits.rules.splice(A,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function h(){o.rateLimits.enabled=this.checked,t(0,o)}function g(A,P){n.$$.not_equal(P.label,A)&&(P.label=A,t(0,o))}function _(A,P){A[P].maxRequests=gt(this.value),t(0,o)}function k(A,P){A[P].duration=gt(this.value),t(0,o)}function S(A,P){n.$$.not_equal(P.audience,A)&&(P.audience=A,t(0,o))}const $=A=>{Yn("rateLimits.rules."+A)},T=A=>m(A),M=()=>d(),E=()=>f==null?void 0:f.show(),L=()=>f==null?void 0:f.hide();function I(A){ie[A?"unshift":"push"](()=>{f=A,t(3,f)})}return n.$$set=A=>{"formSettings"in A&&t(0,o=A.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(4,i=!V.isEmpty(s==null?void 0:s.rateLimits))},[o,s,u,f,i,r,a,d,m,h,g,_,k,S,$,T,M,E,L,I]}class D7 extends Se{constructor(e){super(),we(this,e,E7,M7,ke,{formSettings:0})}}function I7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P,N,R,z,F,U;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[A7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[P7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});function J(Te){n[11](Te)}let Y={healthData:n[3]};n[0]!==void 0&&(Y.formSettings=n[0]),f=new c7({props:Y}),ie.push(()=>be(f,"formSettings",J));function Z(Te){n[12](Te)}let G={};n[0]!==void 0&&(G.formSettings=n[0]),m=new D7({props:G}),ie.push(()=>be(m,"formSettings",Z));function pe(Te){n[13](Te)}let ce={};n[0]!==void 0&&(ce.formSettings=n[0]),_=new e7({props:ce}),ie.push(()=>be(_,"formSettings",pe)),T=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[N7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});let ue=n[4]&&I1(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),u=b("div"),j(f.$$.fragment),d=C(),j(m.$$.fragment),g=C(),j(_.$$.fragment),S=C(),$=b("div"),j(T.$$.fragment),M=C(),E=b("div"),L=b("div"),I=C(),ue&&ue.c(),A=C(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],ee(P,"btn-loading",n[2]),p(E,"class","flex m-t-base")},m(Te,Ke){v(Te,e,Ke),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),w(a,u),q(f,u,null),w(u,d),q(m,u,null),w(u,g),q(_,u,null),w(e,S),w(e,$),q(T,$,null),v(Te,M,Ke),v(Te,E,Ke),w(E,L),w(E,I),ue&&ue.m(E,null),w(E,A),w(E,P),w(P,N),z=!0,F||(U=W(P,"click",n[16]),F=!0)},p(Te,Ke){const Je={};Ke&25165825&&(Je.$$scope={dirty:Ke,ctx:Te}),i.$set(Je);const ft={};Ke&25165825&&(ft.$$scope={dirty:Ke,ctx:Te}),o.$set(ft);const et={};Ke&8&&(et.healthData=Te[3]),!c&&Ke&1&&(c=!0,et.formSettings=Te[0],$e(()=>c=!1)),f.$set(et);const xe={};!h&&Ke&1&&(h=!0,xe.formSettings=Te[0],$e(()=>h=!1)),m.$set(xe);const We={};!k&&Ke&1&&(k=!0,We.formSettings=Te[0],$e(()=>k=!1)),_.$set(We);const at={};Ke&25165825&&(at.$$scope={dirty:Ke,ctx:Te}),T.$set(at),Te[4]?ue?ue.p(Te,Ke):(ue=I1(Te),ue.c(),ue.m(E,A)):ue&&(ue.d(1),ue=null),(!z||Ke&20&&R!==(R=!Te[4]||Te[2]))&&(P.disabled=R),(!z||Ke&4)&&ee(P,"btn-loading",Te[2])},i(Te){z||(O(i.$$.fragment,Te),O(o.$$.fragment,Te),O(f.$$.fragment,Te),O(m.$$.fragment,Te),O(_.$$.fragment,Te),O(T.$$.fragment,Te),z=!0)},o(Te){D(i.$$.fragment,Te),D(o.$$.fragment,Te),D(f.$$.fragment,Te),D(m.$$.fragment,Te),D(_.$$.fragment,Te),D(T.$$.fragment,Te),z=!1},d(Te){Te&&(y(e),y(M),y(E)),H(i),H(o),H(f),H(m),H(_),H(T),ue&&ue.d(),F=!1,U()}}}function L7(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function A7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Application name"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.appName),r||(a=W(s,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&he(s,u[0].meta.appName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function P7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Application URL"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.appURL),r||(a=W(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appURL&&he(s,u[0].meta.appURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function N7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){v(c,e,d),e.checked=n[0].meta.hideControls,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[14]),Oe(qe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function I1(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){v(s,e,o),w(e,t),i||(l=W(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&y(e),i=!1,l()}}}function R7(n){let e,t,i,l,s,o,r,a,u;const f=[L7,I7],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='',t=C(),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){v(m,e,h),v(m,t,h),v(m,i,h),w(i,l),c[s].m(l,null),r=!0,a||(u=W(l,"submit",nt(n[5])),a=!0)},p(m,h){let g=s;s=d(m),s===g?c[s].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),O(o,1),o.m(l,null))},i(m){r||(O(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(y(e),y(t),y(i)),c[s].d(),a=!1,u()}}}function F7(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[R7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function L1(n){if(!n)return;let e=[{},{}];return n.sort((t,i)=>{e[0].length=t.label.length,e[0].isTag=t.label.includes(":")||!t.label.includes("/"),e[0].isWildcardTag=e[0].isTag&&t.label.startsWith("*"),e[0].isExactTag=e[0].isTag&&!e[0].isWildcardTag,e[0].isPrefix=!e[0].isTag&&t.label.endsWith("/"),e[0].hasMethod=!e[0].isTag&&t.label.includes(" /"),e[1].length=i.label.length,e[1].isTag=i.label.includes(":")||!i.label.includes("/"),e[1].isWildcardTag=e[1].isTag&&i.label.startsWith("*"),e[1].isExactTag=e[1].isTag&&!e[1].isWildcardTag,e[1].isPrefix=!e[1].isTag&&i.label.endsWith("/"),e[1].hasMethod=!e[1].isTag&&i.label.includes(" /");for(let l of e)l.priority=0,l.isTag?(l.priority+=1e3,l.isExactTag?l.priority+=10:l.priority+=5):(l.hasMethod&&(l.priority+=10),l.isPrefix||(l.priority+=5));return e[0].isPrefix&&e[1].isPrefix&&(e[0].hasMethod&&e[1].hasMethod||!e[0].hasMethod&&!e[1].hasMethod)&&(e[0].length>e[1].length?e[0].priority+=1:e[0].lengthe[1].priority?-1:e[0].priorityt(17,l=P)),Qe(n,_r,P=>t(18,s=P)),Qe(n,un,P=>t(19,o=P)),Rn(un,o="Application settings",o);let r={},a={},u=!1,f=!1,c="",d={};h();async function m(){var P;try{t(3,d=((P=await _e.health.check()||{})==null?void 0:P.data)||{})}catch(N){console.warn("Health check failed:",N)}}async function h(){t(1,u=!0);try{const P=await _e.settings.getAll()||{};_(P),await m()}catch(P){_e.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0),t(0,a.rateLimits.rules=L1(a.rateLimits.rules),a);try{const P=await _e.settings.update(V.filterRedactedProps(a));_(P),await m(),Ut({}),nn("Successfully saved application settings.")}catch(P){_e.error(P)}t(2,f=!1)}}function _(P={}){var N,R;Rn(_r,s=(N=P==null?void 0:P.meta)==null?void 0:N.appName,s),Rn(Dl,l=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),l),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{rules:[]}}),L1(a.rateLimits.rules),t(7,r=JSON.parse(JSON.stringify(a)))}function k(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function $(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function M(P){a=P,t(0,a)}function E(P){a=P,t(0,a)}function L(){a.meta.hideControls=this.checked,t(0,a)}const I=()=>k(),A=()=>g();return n.$$.update=()=>{n.$$.dirty&128&&t(8,c=JSON.stringify(r)),n.$$.dirty&257&&t(4,i=c!=JSON.stringify(a))},[a,u,f,d,i,g,k,r,c,S,$,T,M,E,L,I,A]}class H7 extends Se{constructor(e){super(),we(this,e,q7,F7,ke,{})}}function j7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Backup name"),l=C(),s=b("input"),r=C(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[2]),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&he(s,c[2])},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function z7(n){let e,t,i,l,s,o,r;return l=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[j7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + `),U=b("ul");for(let Z=0;Zt(20,l=A)),Qe(n,yn,A=>t(1,s=A));let{formSettings:o}=e;const r=[{value:"",label:"All"},{value:"@guest",label:"Guest only"},{value:"@auth",label:"Auth only"}],a=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file",description:"targets the files download endpoint"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth",description:"targets all auth methods"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let u=a,f;c();async function c(){await Iu(),t(2,u=[]);for(let A of l)A.system||(u.push({value:A.name+":list"}),u.push({value:A.name+":view"}),A.type!="view"&&(u.push({value:A.name+":create"}),u.push({value:A.name+":update"}),u.push({value:A.name+":delete"})),A.type=="auth"&&(u.push({value:A.name+":listAuthMethods"}),u.push({value:A.name+":authRefresh"}),u.push({value:A.name+":auth"}),u.push({value:A.name+":authWithPassword"}),u.push({value:A.name+":authWithOAuth2"}),u.push({value:A.name+":authWithOTP"}),u.push({value:A.name+":requestOTP"}),u.push({value:A.name+":requestPasswordReset"}),u.push({value:A.name+":confirmPasswordReset"}),u.push({value:A.name+":requestVerification"}),u.push({value:A.name+":confirmVerification"}),u.push({value:A.name+":requestEmailChange"}),u.push({value:A.name+":confirmEmailChange"})),A.fields.find(P=>P.type=="file")&&u.push({value:A.name+":file"}));t(2,u=u.concat(a))}function d(){Ut({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10,audience:""}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function m(A){Ut({}),o.rateLimits.rules.splice(A,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function h(){o.rateLimits.enabled=this.checked,t(0,o)}function g(A,P){n.$$.not_equal(P.label,A)&&(P.label=A,t(0,o))}function _(A,P){A[P].maxRequests=gt(this.value),t(0,o)}function k(A,P){A[P].duration=gt(this.value),t(0,o)}function S(A,P){n.$$.not_equal(P.audience,A)&&(P.audience=A,t(0,o))}const $=A=>{Yn("rateLimits.rules."+A)},T=A=>m(A),O=()=>d(),E=()=>f==null?void 0:f.show(),L=()=>f==null?void 0:f.hide();function I(A){ie[A?"unshift":"push"](()=>{f=A,t(3,f)})}return n.$$set=A=>{"formSettings"in A&&t(0,o=A.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(4,i=!V.isEmpty(s==null?void 0:s.rateLimits))},[o,s,u,f,i,r,a,d,m,h,g,_,k,S,$,T,O,E,L,I]}class D7 extends Se{constructor(e){super(),we(this,e,E7,M7,ke,{formSettings:0})}}function I7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,U;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[A7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[P7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});function J(Te){n[11](Te)}let Y={healthData:n[3]};n[0]!==void 0&&(Y.formSettings=n[0]),f=new c7({props:Y}),ie.push(()=>be(f,"formSettings",J));function Z(Te){n[12](Te)}let G={};n[0]!==void 0&&(G.formSettings=n[0]),m=new D7({props:G}),ie.push(()=>be(m,"formSettings",Z));function pe(Te){n[13](Te)}let ce={};n[0]!==void 0&&(ce.formSettings=n[0]),_=new e7({props:ce}),ie.push(()=>be(_,"formSettings",pe)),T=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[N7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});let ue=n[4]&&I1(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),u=b("div"),j(f.$$.fragment),d=C(),j(m.$$.fragment),g=C(),j(_.$$.fragment),S=C(),$=b("div"),j(T.$$.fragment),O=C(),E=b("div"),L=b("div"),I=C(),ue&&ue.c(),A=C(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],ee(P,"btn-loading",n[2]),p(E,"class","flex m-t-base")},m(Te,Ke){v(Te,e,Ke),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),w(a,u),q(f,u,null),w(u,d),q(m,u,null),w(u,g),q(_,u,null),w(e,S),w(e,$),q(T,$,null),v(Te,O,Ke),v(Te,E,Ke),w(E,L),w(E,I),ue&&ue.m(E,null),w(E,A),w(E,P),w(P,N),z=!0,F||(U=W(P,"click",n[16]),F=!0)},p(Te,Ke){const Je={};Ke&25165825&&(Je.$$scope={dirty:Ke,ctx:Te}),i.$set(Je);const ft={};Ke&25165825&&(ft.$$scope={dirty:Ke,ctx:Te}),o.$set(ft);const et={};Ke&8&&(et.healthData=Te[3]),!c&&Ke&1&&(c=!0,et.formSettings=Te[0],$e(()=>c=!1)),f.$set(et);const xe={};!h&&Ke&1&&(h=!0,xe.formSettings=Te[0],$e(()=>h=!1)),m.$set(xe);const We={};!k&&Ke&1&&(k=!0,We.formSettings=Te[0],$e(()=>k=!1)),_.$set(We);const at={};Ke&25165825&&(at.$$scope={dirty:Ke,ctx:Te}),T.$set(at),Te[4]?ue?ue.p(Te,Ke):(ue=I1(Te),ue.c(),ue.m(E,A)):ue&&(ue.d(1),ue=null),(!z||Ke&20&&R!==(R=!Te[4]||Te[2]))&&(P.disabled=R),(!z||Ke&4)&&ee(P,"btn-loading",Te[2])},i(Te){z||(M(i.$$.fragment,Te),M(o.$$.fragment,Te),M(f.$$.fragment,Te),M(m.$$.fragment,Te),M(_.$$.fragment,Te),M(T.$$.fragment,Te),z=!0)},o(Te){D(i.$$.fragment,Te),D(o.$$.fragment,Te),D(f.$$.fragment,Te),D(m.$$.fragment,Te),D(_.$$.fragment,Te),D(T.$$.fragment,Te),z=!1},d(Te){Te&&(y(e),y(O),y(E)),H(i),H(o),H(f),H(m),H(_),H(T),ue&&ue.d(),F=!1,U()}}}function L7(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function A7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Application name"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.appName),r||(a=W(s,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&he(s,u[0].meta.appName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function P7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Application URL"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.appURL),r||(a=W(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appURL&&he(s,u[0].meta.appURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function N7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){v(c,e,d),e.checked=n[0].meta.hideControls,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[14]),Oe(qe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function I1(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){v(s,e,o),w(e,t),i||(l=W(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&y(e),i=!1,l()}}}function R7(n){let e,t,i,l,s,o,r,a,u;const f=[L7,I7],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='

    ',t=C(),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){v(m,e,h),v(m,t,h),v(m,i,h),w(i,l),c[s].m(l,null),r=!0,a||(u=W(l,"submit",nt(n[5])),a=!0)},p(m,h){let g=s;s=d(m),s===g?c[s].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(l,null))},i(m){r||(M(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(y(e),y(t),y(i)),c[s].d(),a=!1,u()}}}function F7(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[R7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function L1(n){if(!n)return;let e=[{},{}];return n.sort((t,i)=>{e[0].length=t.label.length,e[0].isTag=t.label.includes(":")||!t.label.includes("/"),e[0].isWildcardTag=e[0].isTag&&t.label.startsWith("*"),e[0].isExactTag=e[0].isTag&&!e[0].isWildcardTag,e[0].isPrefix=!e[0].isTag&&t.label.endsWith("/"),e[0].hasMethod=!e[0].isTag&&t.label.includes(" /"),e[1].length=i.label.length,e[1].isTag=i.label.includes(":")||!i.label.includes("/"),e[1].isWildcardTag=e[1].isTag&&i.label.startsWith("*"),e[1].isExactTag=e[1].isTag&&!e[1].isWildcardTag,e[1].isPrefix=!e[1].isTag&&i.label.endsWith("/"),e[1].hasMethod=!e[1].isTag&&i.label.includes(" /");for(let l of e)l.priority=0,l.isTag?(l.priority+=1e3,l.isExactTag?l.priority+=10:l.priority+=5):(l.hasMethod&&(l.priority+=10),l.isPrefix||(l.priority+=5));return e[0].isPrefix&&e[1].isPrefix&&(e[0].hasMethod&&e[1].hasMethod||!e[0].hasMethod&&!e[1].hasMethod)&&(e[0].length>e[1].length?e[0].priority+=1:e[0].lengthe[1].priority?-1:e[0].priorityt(17,l=P)),Qe(n,_r,P=>t(18,s=P)),Qe(n,un,P=>t(19,o=P)),Rn(un,o="Application settings",o);let r={},a={},u=!1,f=!1,c="",d={};h();async function m(){var P;try{t(3,d=((P=await _e.health.check()||{})==null?void 0:P.data)||{})}catch(N){console.warn("Health check failed:",N)}}async function h(){t(1,u=!0);try{const P=await _e.settings.getAll()||{};_(P),await m()}catch(P){_e.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0),t(0,a.rateLimits.rules=L1(a.rateLimits.rules),a);try{const P=await _e.settings.update(V.filterRedactedProps(a));_(P),await m(),Ut({}),nn("Successfully saved application settings.")}catch(P){_e.error(P)}t(2,f=!1)}}function _(P={}){var N,R;Rn(_r,s=(N=P==null?void 0:P.meta)==null?void 0:N.appName,s),Rn(Dl,l=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),l),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{rules:[]}}),L1(a.rateLimits.rules),t(7,r=JSON.parse(JSON.stringify(a)))}function k(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function $(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function O(P){a=P,t(0,a)}function E(P){a=P,t(0,a)}function L(){a.meta.hideControls=this.checked,t(0,a)}const I=()=>k(),A=()=>g();return n.$$.update=()=>{n.$$.dirty&128&&t(8,c=JSON.stringify(r)),n.$$.dirty&257&&t(4,i=c!=JSON.stringify(a))},[a,u,f,d,i,g,k,r,c,S,$,T,O,E,L,I,A]}class H7 extends Se{constructor(e){super(),we(this,e,q7,F7,ke,{})}}function j7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Backup name"),l=C(),s=b("input"),r=C(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[2]),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&he(s,c[2])},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function z7(n){let e,t,i,l,s,o,r;return l=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[j7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    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!

    `,t=C(),i=b("form"),j(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),q(l,i,null),s=!0,o||(r=W(i,"submit",nt(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(O(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(y(e),y(t),y(i)),H(l),o=!1,r()}}}function U7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function V7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Start backup",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[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],ee(l,"btn-loading",n[3])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(a,l,u),w(l,s),o||(r=W(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&ee(l,"btn-loading",a[3])},d(a){a&&(y(e),y(i),y(l)),o=!1,r()}}}function B7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[V7],header:[U7],default:[z7]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function W7(n,e,t){const i=kt(),l="backup_create_"+V.randomString(5);let s,o="",r=!1,a;function u(S){Ut({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await _e.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),nn("Successfully generated new backup.")}catch(S){S.isAbort||_e.error(S)}clearTimeout(a),t(3,r=!1)}}oo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,g,_,k]}class Y7 extends Se{constructor(e){super(),we(this,e,W7,B7,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function K7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Backup name"),l=C(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[2]),r||(a=W(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&he(s,u[2])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function J7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new $i({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[K7,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    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 + separately since they are not locally stored and will not be included in the final backup!

    `,t=C(),i=b("form"),j(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),q(l,i,null),s=!0,o||(r=W(i,"submit",nt(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(y(e),y(t),y(i)),H(l),o=!1,r()}}}function U7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function V7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Start backup",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[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],ee(l,"btn-loading",n[3])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(a,l,u),w(l,s),o||(r=W(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&ee(l,"btn-loading",a[3])},d(a){a&&(y(e),y(i),y(l)),o=!1,r()}}}function B7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[V7],header:[U7],default:[z7]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function W7(n,e,t){const i=kt(),l="backup_create_"+V.randomString(5);let s,o="",r=!1,a;function u(S){Ut({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await _e.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),nn("Successfully generated new backup.")}catch(S){S.isAbort||_e.error(S)}clearTimeout(a),t(3,r=!1)}}oo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,g,_,k]}class Y7 extends Se{constructor(e){super(),we(this,e,W7,B7,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function K7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Backup name"),l=C(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[2]),r||(a=W(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&he(s,u[2])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function J7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new $i({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[K7,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    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, superusers, 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).

    `,t=C(),i=b("div"),l=B(`Type the backup name `),s=b("div"),o=b("span"),r=B(n[1]),a=C(),j(u.$$.fragment),f=B(` - to confirm:`),c=C(),d=b("form"),j(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){v(k,e,S),v(k,t,S),v(k,i,S),w(i,l),w(i,s),w(s,o),w(o,r),w(s,a),q(u,s,null),w(i,f),v(k,c,S),v(k,d,S),q(m,d,null),h=!0,g||(_=W(d,"submit",nt(n[7])),g=!0)},p(k,S){(!h||S&2)&&oe(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){h||(O(u.$$.fragment,k),O(m.$$.fragment,k),h=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),h=!1},d(k){k&&(y(e),y(t),y(i),y(c),y(d)),H(u),H(m),g=!1,_()}}}function Z7(n){let e,t,i,l;return{c(){e=b("h4"),t=B("Restore "),i=b("strong"),l=B(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&y(e)}}}function G7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=B("Cancel"),i=C(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],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[4],ee(l,"btn-loading",n[4])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&ee(l,"btn-loading",u[4])},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function X7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[G7],header:[Z7],default:[J7]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(O(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function Q7(n,e,t){let i;const l="backup_restore_"+V.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Ut({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await _e.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),Ci(((S=$.response)==null?void 0:S.message)||$.message))}}}oo(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function g(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,h,g,_,k]}class x7 extends Se{constructor(e){super(),we(this,e,Q7,X7,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function A1(n,e,t){const i=n.slice();return i[22]=e[t],i}function P1(n,e,t){const i=n.slice();return i[19]=e[t],i}function eR(n){let e=[],t=new Map,i,l,s=de(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function R1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=V.formattedFileSize(e[22].size)+"",h,g,_,k,S,$,T,M,E,L,I,A,P,N,R,z,F,U,J,Y;function Z(){return e[10](e[22])}function G(){return e[11](e[22])}function pe(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=C(),s=b("div"),o=b("span"),a=B(r),f=C(),c=b("span"),d=B("("),h=B(m),g=B(")"),_=C(),k=b("div"),S=b("button"),$=b("i"),M=C(),E=b("button"),L=b("i"),A=C(),P=b("button"),N=b("i"),z=C(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p($,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),ee(S,"btn-loading",e[5][e[22].key]),p(L,"class","ri-restart-line"),p(E,"type","button"),p(E,"class","btn btn-sm btn-circle btn-hint btn-transparent"),E.disabled=I=e[6][e[22].key],p(E,"aria-label","Restore"),p(N,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=R=e[6][e[22].key],p(P,"aria-label","Delete"),ee(P,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ce,ue){v(ce,t,ue),w(t,i),w(t,l),w(t,s),w(s,o),w(o,a),w(s,f),w(s,c),w(c,d),w(c,h),w(c,g),w(t,_),w(t,k),w(k,S),w(S,$),w(k,M),w(k,E),w(E,L),w(k,A),w(k,P),w(P,N),w(t,z),U=!0,J||(Y=[Oe(qe.call(null,S,"Download")),W(S,"click",nt(Z)),Oe(qe.call(null,E,"Restore")),W(E,"click",nt(G)),Oe(qe.call(null,P,"Delete")),W(P,"click",nt(pe))],J=!0)},p(ce,ue){e=ce,(!U||ue&8)&&r!==(r=e[22].key+"")&&oe(a,r),(!U||ue&8&&u!==(u=e[22].key))&&p(o,"title",u),(!U||ue&8)&&m!==(m=V.formattedFileSize(e[22].size)+"")&&oe(h,m),(!U||ue&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!U||ue&40)&&ee(S,"btn-loading",e[5][e[22].key]),(!U||ue&72&&I!==(I=e[6][e[22].key]))&&(E.disabled=I),(!U||ue&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!U||ue&72)&&ee(P,"btn-loading",e[6][e[22].key])},i(ce){U||(ce&&tt(()=>{U&&(F||(F=He(t,mt,{duration:150},!0)),F.run(1))}),U=!0)},o(ce){ce&&(F||(F=He(t,mt,{duration:150},!1)),F.run(0)),U=!1},d(ce){ce&&y(t),ce&&F&&F.end(),J=!1,Ie(Y)}}}function F1(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function nR(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function iR(n){let e,t,i;return{c(){e=b("i"),t=C(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function lR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;const _=[tR,eR],k=[];function S(I,A){return I[4]?0:1}i=S(n),l=k[i]=_[i](n);function $(I,A){return I[7]?iR:nR}let T=$(n),M=T(n),E={};f=new Y7({props:E}),n[14](f),f.$on("submit",n[15]);let L={};return d=new x7({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=C(),o=b("div"),r=b("button"),M.c(),u=C(),j(f.$$.fragment),c=C(),j(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,A){v(I,e,A),w(e,t),k[i].m(t,null),w(e,s),w(e,o),w(o,r),M.m(r,null),v(I,u,A),q(f,I,A),v(I,c,A),q(d,I,A),m=!0,h||(g=W(r,"click",n[13]),h=!0)},p(I,[A]){let P=i;i=S(I),i===P?k[i].p(I,A):(re(),D(k[P],1,1,()=>{k[P]=null}),ae(),l=k[i],l?l.p(I,A):(l=k[i]=_[i](I),l.c()),O(l,1),l.m(t,null)),T!==(T=$(I))&&(M.d(1),M=T(I),M&&(M.c(),M.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(I){m||(O(l),O(f.$$.fragment,I),O(d.$$.fragment,I),m=!0)},o(I){D(l),D(f.$$.fragment,I),D(d.$$.fragment,I),m=!1},d(I){I&&(y(e),y(u),y(c)),k[i].d(),M.d(),n[14](null),H(f,I),n[16](null),H(d,I),h=!1,g()}}}function sR(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),h();async function f(){t(4,o=!0);try{t(3,s=await _e.backups.getFullList()),s.sort((E,L)=>E.modifiedL.modified?-1:0),t(4,o=!1)}catch(E){E.isAbort||(_e.error(E),t(4,o=!1))}}async function c(E){if(!r[E]){t(5,r[E]=!0,r);try{const L=await _e.getSuperuserFileToken(),I=_e.backups.getDownloadURL(L,E);V.download(I)}catch(L){L.isAbort||_e.error(L)}delete r[E],t(5,r)}}function d(E){_n(`Do you really want to delete ${E}?`,()=>m(E))}async function m(E){if(!a[E]){t(6,a[E]=!0,a);try{await _e.backups.delete(E),V.removeByKey(s,"name",E),f(),nn(`Successfully deleted ${E}.`)}catch(L){L.isAbort||_e.error(L)}delete a[E],t(6,a)}}async function h(){var E;try{const L=await _e.health.check({$autoCancel:!1}),I=u;t(7,u=((E=L==null?void 0:L.data)==null?void 0:E.canBackup)||!1),I!=u&&u&&f()}catch{}}Xt(()=>{let E=setInterval(()=>{h()},3e3);return()=>{clearInterval(E)}});const g=E=>c(E.key),_=E=>l.show(E.key),k=E=>d(E.key),S=()=>i==null?void 0:i.show();function $(E){ie[E?"unshift":"push"](()=>{i=E,t(1,i)})}const T=()=>{f()};function M(E){ie[E?"unshift":"push"](()=>{l=E,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,g,_,k,S,$,T,M]}class oR extends Se{constructor(e){super(),we(this,e,sR,lR,ke,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const rR=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),q1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function aR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[0].enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&oe(s,u[4]),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function H1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[uR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[fR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[cR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[dR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[pR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),S=new fe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[mR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("div"),j(g.$$.fragment),_=C(),k=b("div"),j(S.$$.fragment),$=C(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(L,I){v(L,e,I),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),q(g,h,null),w(e,_),w(e,k),q(S,k,null),w(e,$),w(e,T),E=!0},p(L,I){const A={};I&8&&(A.name=L[3]+".endpoint"),I&8519681&&(A.$$scope={dirty:I,ctx:L}),i.$set(A);const P={};I&8&&(P.name=L[3]+".bucket"),I&8519681&&(P.$$scope={dirty:I,ctx:L}),o.$set(P);const N={};I&8&&(N.name=L[3]+".region"),I&8519681&&(N.$$scope={dirty:I,ctx:L}),u.$set(N);const R={};I&8&&(R.name=L[3]+".accessKey"),I&8519681&&(R.$$scope={dirty:I,ctx:L}),d.$set(R);const z={};I&8&&(z.name=L[3]+".secret"),I&8519713&&(z.$$scope={dirty:I,ctx:L}),g.$set(z);const F={};I&8&&(F.name=L[3]+".forcePathStyle"),I&8519681&&(F.$$scope={dirty:I,ctx:L}),S.$set(F)},i(L){E||(O(i.$$.fragment,L),O(o.$$.fragment,L),O(u.$$.fragment,L),O(d.$$.fragment,L),O(g.$$.fragment,L),O(S.$$.fragment,L),L&&tt(()=>{E&&(M||(M=He(e,mt,{duration:150},!0)),M.run(1))}),E=!0)},o(L){D(i.$$.fragment,L),D(o.$$.fragment,L),D(u.$$.fragment,L),D(d.$$.fragment,L),D(g.$$.fragment,L),D(S.$$.fragment,L),L&&(M||(M=He(e,mt,{duration:150},!1)),M.run(0)),E=!1},d(L){L&&y(e),H(i),H(o),H(u),H(d),H(g),H(S),L&&M&&M.end()}}}function uR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Endpoint"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].endpoint),r||(a=W(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].endpoint&&he(s,u[0].endpoint)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function fR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Bucket"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].bucket),r||(a=W(s,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].bucket&&he(s,u[0].bucket)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function cR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Region"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].region),r||(a=W(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].region&&he(s,u[0].region)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function dR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Access key"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].accessKey),r||(a=W(s,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].accessKey&&he(s,u[0].accessKey)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pR(n){let e,t,i,l,s,o,r,a;function u(d){n[14](d)}function f(d){n[15](d)}let c={required:!0,id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[0].secret!==void 0&&(c.value=n[0].secret),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function mR(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){v(c,e,d),e.checked=n[0].forcePathStyle,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[16]),Oe(qe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function hR(n){let e,t,i,l,s;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[aR,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Lt(o,n,n[17],q1);let a=n[0].enabled&&H1(n);return{c(){j(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),l=ye()},m(u,f){q(e,u,f),v(u,t,f),r&&r.m(u,f),v(u,i,f),a&&a.m(u,f),v(u,l,f),s=!0},p(u,[f]){const c={};f&8519697&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&131079)&&Pt(r,o,u,u[17],s?At(o,u[17],f,rR):Nt(u[17]),q1),u[0].enabled?a?(a.p(u,f),f&1&&O(a,1)):(a=H1(u),a.c(),O(a,1),a.m(l.parentNode,l)):a&&(re(),D(a,1,1,()=>{a=null}),ae())},i(u){s||(O(e.$$.fragment,u),O(r,u),O(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(y(t),y(i),y(l)),H(e,u),r&&r.d(u),a&&a.d(u)}}}const Pa="s3_test_request";function _R(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null,h=!1;function g(){t(5,h=!!(s!=null&&s.accessKey))}function _(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{k()},P)}async function k(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;_e.cancelRequest(Pa),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Pa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await _e.settings.testS3(u,{$cancelKey:Pa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}Xt(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function $(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function M(){o.region=this.value,t(0,o)}function E(){o.accessKey=this.value,t(0,o)}function L(P){h=P,t(5,h)}function I(P){n.$$.not_equal(o.secret,P)&&(o.secret=P,t(0,o))}function A(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=P=>{"originalConfig"in P&&t(6,s=P.originalConfig),"config"in P&&t(0,o=P.config),"configKey"in P&&t(3,r=P.configKey),"toggleLabel"in P&&t(4,a=P.toggleLabel),"testFilesystem"in P&&t(7,u=P.testFilesystem),"testError"in P&&t(1,f=P.testError),"isTesting"in P&&t(2,c=P.isTesting),"$$scope"in P&&t(17,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&s!=null&&s.enabled&&(g(),_(100)),n.$$.dirty&9&&(o.enabled||Yn(r))},[o,f,c,r,a,h,s,u,i,S,$,T,M,E,L,I,A,l]}class $y extends Se{constructor(e){super(),we(this,e,_R,hR,ke,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function gR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=C(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),ee(e,"btn-loading",n[2]),ee(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){v(a,e,u),w(e,t),v(a,l,u),v(a,s,u),n[5](s),o||(r=[Oe(qe.call(null,e,"Upload backup")),W(e,"click",n[4]),W(s,"change",n[6])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&ee(e,"btn-loading",a[2]),u&5&&ee(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(y(e),y(l),y(s)),n[5](null),o=!1,Ie(r)}}}const j1="upload_backup";function bR(n,e,t){const i=kt();let{class:l=""}=e,s,o=!1;function r(){s&&t(1,s.value="",s)}function a(m){m&&_n(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the source. + to confirm:`),c=C(),d=b("form"),j(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){v(k,e,S),v(k,t,S),v(k,i,S),w(i,l),w(i,s),w(s,o),w(o,r),w(s,a),q(u,s,null),w(i,f),v(k,c,S),v(k,d,S),q(m,d,null),h=!0,g||(_=W(d,"submit",nt(n[7])),g=!0)},p(k,S){(!h||S&2)&&oe(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){h||(M(u.$$.fragment,k),M(m.$$.fragment,k),h=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),h=!1},d(k){k&&(y(e),y(t),y(i),y(c),y(d)),H(u),H(m),g=!1,_()}}}function Z7(n){let e,t,i,l;return{c(){e=b("h4"),t=B("Restore "),i=b("strong"),l=B(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&y(e)}}}function G7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=B("Cancel"),i=C(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],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[4],ee(l,"btn-loading",n[4])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&ee(l,"btn-loading",u[4])},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function X7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[G7],header:[Z7],default:[J7]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function Q7(n,e,t){let i;const l="backup_restore_"+V.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Ut({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await _e.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),Ci(((S=$.response)==null?void 0:S.message)||$.message))}}}oo(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function g(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,h,g,_,k]}class x7 extends Se{constructor(e){super(),we(this,e,Q7,X7,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function A1(n,e,t){const i=n.slice();return i[22]=e[t],i}function P1(n,e,t){const i=n.slice();return i[19]=e[t],i}function eR(n){let e=[],t=new Map,i,l,s=de(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function R1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=V.formattedFileSize(e[22].size)+"",h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,U,J,Y;function Z(){return e[10](e[22])}function G(){return e[11](e[22])}function pe(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=C(),s=b("div"),o=b("span"),a=B(r),f=C(),c=b("span"),d=B("("),h=B(m),g=B(")"),_=C(),k=b("div"),S=b("button"),$=b("i"),O=C(),E=b("button"),L=b("i"),A=C(),P=b("button"),N=b("i"),z=C(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p($,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),ee(S,"btn-loading",e[5][e[22].key]),p(L,"class","ri-restart-line"),p(E,"type","button"),p(E,"class","btn btn-sm btn-circle btn-hint btn-transparent"),E.disabled=I=e[6][e[22].key],p(E,"aria-label","Restore"),p(N,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=R=e[6][e[22].key],p(P,"aria-label","Delete"),ee(P,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ce,ue){v(ce,t,ue),w(t,i),w(t,l),w(t,s),w(s,o),w(o,a),w(s,f),w(s,c),w(c,d),w(c,h),w(c,g),w(t,_),w(t,k),w(k,S),w(S,$),w(k,O),w(k,E),w(E,L),w(k,A),w(k,P),w(P,N),w(t,z),U=!0,J||(Y=[Oe(qe.call(null,S,"Download")),W(S,"click",nt(Z)),Oe(qe.call(null,E,"Restore")),W(E,"click",nt(G)),Oe(qe.call(null,P,"Delete")),W(P,"click",nt(pe))],J=!0)},p(ce,ue){e=ce,(!U||ue&8)&&r!==(r=e[22].key+"")&&oe(a,r),(!U||ue&8&&u!==(u=e[22].key))&&p(o,"title",u),(!U||ue&8)&&m!==(m=V.formattedFileSize(e[22].size)+"")&&oe(h,m),(!U||ue&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!U||ue&40)&&ee(S,"btn-loading",e[5][e[22].key]),(!U||ue&72&&I!==(I=e[6][e[22].key]))&&(E.disabled=I),(!U||ue&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!U||ue&72)&&ee(P,"btn-loading",e[6][e[22].key])},i(ce){U||(ce&&tt(()=>{U&&(F||(F=He(t,mt,{duration:150},!0)),F.run(1))}),U=!0)},o(ce){ce&&(F||(F=He(t,mt,{duration:150},!1)),F.run(0)),U=!1},d(ce){ce&&y(t),ce&&F&&F.end(),J=!1,Ie(Y)}}}function F1(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function nR(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function iR(n){let e,t,i;return{c(){e=b("i"),t=C(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function lR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;const _=[tR,eR],k=[];function S(I,A){return I[4]?0:1}i=S(n),l=k[i]=_[i](n);function $(I,A){return I[7]?iR:nR}let T=$(n),O=T(n),E={};f=new Y7({props:E}),n[14](f),f.$on("submit",n[15]);let L={};return d=new x7({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=C(),o=b("div"),r=b("button"),O.c(),u=C(),j(f.$$.fragment),c=C(),j(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,A){v(I,e,A),w(e,t),k[i].m(t,null),w(e,s),w(e,o),w(o,r),O.m(r,null),v(I,u,A),q(f,I,A),v(I,c,A),q(d,I,A),m=!0,h||(g=W(r,"click",n[13]),h=!0)},p(I,[A]){let P=i;i=S(I),i===P?k[i].p(I,A):(re(),D(k[P],1,1,()=>{k[P]=null}),ae(),l=k[i],l?l.p(I,A):(l=k[i]=_[i](I),l.c()),M(l,1),l.m(t,null)),T!==(T=$(I))&&(O.d(1),O=T(I),O&&(O.c(),O.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(I){m||(M(l),M(f.$$.fragment,I),M(d.$$.fragment,I),m=!0)},o(I){D(l),D(f.$$.fragment,I),D(d.$$.fragment,I),m=!1},d(I){I&&(y(e),y(u),y(c)),k[i].d(),O.d(),n[14](null),H(f,I),n[16](null),H(d,I),h=!1,g()}}}function sR(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),h();async function f(){t(4,o=!0);try{t(3,s=await _e.backups.getFullList()),s.sort((E,L)=>E.modifiedL.modified?-1:0),t(4,o=!1)}catch(E){E.isAbort||(_e.error(E),t(4,o=!1))}}async function c(E){if(!r[E]){t(5,r[E]=!0,r);try{const L=await _e.getSuperuserFileToken(),I=_e.backups.getDownloadURL(L,E);V.download(I)}catch(L){L.isAbort||_e.error(L)}delete r[E],t(5,r)}}function d(E){_n(`Do you really want to delete ${E}?`,()=>m(E))}async function m(E){if(!a[E]){t(6,a[E]=!0,a);try{await _e.backups.delete(E),V.removeByKey(s,"name",E),f(),nn(`Successfully deleted ${E}.`)}catch(L){L.isAbort||_e.error(L)}delete a[E],t(6,a)}}async function h(){var E;try{const L=await _e.health.check({$autoCancel:!1}),I=u;t(7,u=((E=L==null?void 0:L.data)==null?void 0:E.canBackup)||!1),I!=u&&u&&f()}catch{}}Xt(()=>{let E=setInterval(()=>{h()},3e3);return()=>{clearInterval(E)}});const g=E=>c(E.key),_=E=>l.show(E.key),k=E=>d(E.key),S=()=>i==null?void 0:i.show();function $(E){ie[E?"unshift":"push"](()=>{i=E,t(1,i)})}const T=()=>{f()};function O(E){ie[E?"unshift":"push"](()=>{l=E,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,g,_,k,S,$,T,O]}class oR extends Se{constructor(e){super(),we(this,e,sR,lR,ke,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const rR=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),q1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function aR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[0].enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&oe(s,u[4]),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function H1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[uR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[fR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[cR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[dR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[pR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),S=new fe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[mR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("div"),j(g.$$.fragment),_=C(),k=b("div"),j(S.$$.fragment),$=C(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(L,I){v(L,e,I),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),q(g,h,null),w(e,_),w(e,k),q(S,k,null),w(e,$),w(e,T),E=!0},p(L,I){const A={};I&8&&(A.name=L[3]+".endpoint"),I&8519681&&(A.$$scope={dirty:I,ctx:L}),i.$set(A);const P={};I&8&&(P.name=L[3]+".bucket"),I&8519681&&(P.$$scope={dirty:I,ctx:L}),o.$set(P);const N={};I&8&&(N.name=L[3]+".region"),I&8519681&&(N.$$scope={dirty:I,ctx:L}),u.$set(N);const R={};I&8&&(R.name=L[3]+".accessKey"),I&8519681&&(R.$$scope={dirty:I,ctx:L}),d.$set(R);const z={};I&8&&(z.name=L[3]+".secret"),I&8519713&&(z.$$scope={dirty:I,ctx:L}),g.$set(z);const F={};I&8&&(F.name=L[3]+".forcePathStyle"),I&8519681&&(F.$$scope={dirty:I,ctx:L}),S.$set(F)},i(L){E||(M(i.$$.fragment,L),M(o.$$.fragment,L),M(u.$$.fragment,L),M(d.$$.fragment,L),M(g.$$.fragment,L),M(S.$$.fragment,L),L&&tt(()=>{E&&(O||(O=He(e,mt,{duration:150},!0)),O.run(1))}),E=!0)},o(L){D(i.$$.fragment,L),D(o.$$.fragment,L),D(u.$$.fragment,L),D(d.$$.fragment,L),D(g.$$.fragment,L),D(S.$$.fragment,L),L&&(O||(O=He(e,mt,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&y(e),H(i),H(o),H(u),H(d),H(g),H(S),L&&O&&O.end()}}}function uR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Endpoint"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].endpoint),r||(a=W(s,"input",n[10]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].endpoint&&he(s,u[0].endpoint)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function fR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Bucket"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].bucket),r||(a=W(s,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].bucket&&he(s,u[0].bucket)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function cR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Region"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].region),r||(a=W(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].region&&he(s,u[0].region)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function dR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Access key"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].accessKey),r||(a=W(s,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&s.value!==u[0].accessKey&&he(s,u[0].accessKey)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pR(n){let e,t,i,l,s,o,r,a;function u(d){n[14](d)}function f(d){n[15](d)}let c={required:!0,id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[0].secret!==void 0&&(c.value=n[0].secret),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,$e(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function mR(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[23])},m(c,d){v(c,e,d),e.checked=n[0].forcePathStyle,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[16]),Oe(qe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&8388608&&a!==(a=c[23])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function hR(n){let e,t,i,l,s;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[aR,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Lt(o,n,n[17],q1);let a=n[0].enabled&&H1(n);return{c(){j(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),l=ye()},m(u,f){q(e,u,f),v(u,t,f),r&&r.m(u,f),v(u,i,f),a&&a.m(u,f),v(u,l,f),s=!0},p(u,[f]){const c={};f&8519697&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&131079)&&Pt(r,o,u,u[17],s?At(o,u[17],f,rR):Nt(u[17]),q1),u[0].enabled?a?(a.p(u,f),f&1&&M(a,1)):(a=H1(u),a.c(),M(a,1),a.m(l.parentNode,l)):a&&(re(),D(a,1,1,()=>{a=null}),ae())},i(u){s||(M(e.$$.fragment,u),M(r,u),M(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(y(t),y(i),y(l)),H(e,u),r&&r.d(u),a&&a.d(u)}}}const Pa="s3_test_request";function _R(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null,h=!1;function g(){t(5,h=!!(s!=null&&s.accessKey))}function _(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{k()},P)}async function k(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;_e.cancelRequest(Pa),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Pa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await _e.settings.testS3(u,{$cancelKey:Pa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}Xt(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function $(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function O(){o.region=this.value,t(0,o)}function E(){o.accessKey=this.value,t(0,o)}function L(P){h=P,t(5,h)}function I(P){n.$$.not_equal(o.secret,P)&&(o.secret=P,t(0,o))}function A(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=P=>{"originalConfig"in P&&t(6,s=P.originalConfig),"config"in P&&t(0,o=P.config),"configKey"in P&&t(3,r=P.configKey),"toggleLabel"in P&&t(4,a=P.toggleLabel),"testFilesystem"in P&&t(7,u=P.testFilesystem),"testError"in P&&t(1,f=P.testError),"isTesting"in P&&t(2,c=P.isTesting),"$$scope"in P&&t(17,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&s!=null&&s.enabled&&(g(),_(100)),n.$$.dirty&9&&(o.enabled||Yn(r))},[o,f,c,r,a,h,s,u,i,S,$,T,O,E,L,I,A,l]}class $y extends Se{constructor(e){super(),we(this,e,_R,hR,ke,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function gR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=C(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),ee(e,"btn-loading",n[2]),ee(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){v(a,e,u),w(e,t),v(a,l,u),v(a,s,u),n[5](s),o||(r=[Oe(qe.call(null,e,"Upload backup")),W(e,"click",n[4]),W(s,"change",n[6])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&ee(e,"btn-loading",a[2]),u&5&&ee(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(y(e),y(l),y(s)),n[5](null),o=!1,Ie(r)}}}const j1="upload_backup";function bR(n,e,t){const i=kt();let{class:l=""}=e,s,o=!1;function r(){s&&t(1,s.value="",s)}function a(m){m&&_n(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the source. -Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function u(m){var g,_,k;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await _e.backups.upload(h,{requestKey:j1}),t(2,o=!1),i("success"),nn("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(_=(g=S.response)==null?void 0:g.data)==null?void 0:_.file)!=null&&k.message?Ci(S.response.data.file.message):_e.error(S))}r()}oo(()=>{_e.cancelRequest(j1)});const f=()=>s==null?void 0:s.click();function c(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}const d=m=>{var h,g;a((g=(h=m==null?void 0:m.target)==null?void 0:h.files)==null?void 0:g[0])};return n.$$set=m=>{"class"in m&&t(0,l=m.class)},[l,s,o,a,f,c,d]}class kR extends Se{constructor(e){super(),we(this,e,bR,gR,ke,{class:0})}}function yR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function vR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function z1(n){var U,J,Y;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L;t=new fe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[wR,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&U1(n);function A(Z){n[24](Z)}function P(Z){n[25](Z)}function N(Z){n[26](Z)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new $y({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",P)),ie.push(()=>be(r,"testError",N));let z=((Y=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:Y.enabled)&&!n[9]&&!n[5]&&V1(n),F=n[9]&&B1(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),I&&I.c(),l=C(),s=b("div"),o=C(),j(r.$$.fragment),c=C(),d=b("div"),m=b("div"),h=C(),z&&z.c(),g=C(),F&&F.c(),_=C(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],ee(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){v(Z,e,G),q(t,e,null),w(e,i),I&&I.m(e,null),w(e,l),w(e,s),w(e,o),q(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),z&&z.m(d,null),w(d,g),F&&F.m(d,null),w(d,_),w(d,k),w(k,S),M=!0,E||(L=[W(k,"click",n[28]),W(e,"submit",nt(n[11]))],E=!0)},p(Z,G){var ue,Te,Ke;const pe={};G[0]&4|G[1]&3&&(pe.$$scope={dirty:G,ctx:Z}),t.$set(pe),Z[2]?I?(I.p(Z,G),G[0]&4&&O(I,1)):(I=U1(Z),I.c(),O(I,1),I.m(e,l)):I&&(re(),D(I,1,1,()=>{I=null}),ae());const ce={};G[0]&1&&(ce.originalConfig=(ue=Z[0].backups)==null?void 0:ue.s3),!a&&G[0]&2&&(a=!0,ce.config=Z[1].backups.s3,$e(()=>a=!1)),!u&&G[0]&128&&(u=!0,ce.isTesting=Z[7],$e(()=>u=!1)),!f&&G[0]&256&&(f=!0,ce.testError=Z[8],$e(()=>f=!1)),r.$set(ce),(Ke=(Te=Z[1].backups)==null?void 0:Te.s3)!=null&&Ke.enabled&&!Z[9]&&!Z[5]?z?z.p(Z,G):(z=V1(Z),z.c(),z.m(d,g)):z&&(z.d(1),z=null),Z[9]?F?F.p(Z,G):(F=B1(Z),F.c(),F.m(d,_)):F&&(F.d(1),F=null),(!M||G[0]&544&&$!==($=!Z[9]||Z[5]))&&(k.disabled=$),(!M||G[0]&32)&&ee(k,"btn-loading",Z[5])},i(Z){M||(O(t.$$.fragment,Z),O(I),O(r.$$.fragment,Z),Z&&tt(()=>{M&&(T||(T=He(e,mt,{duration:150},!0)),T.run(1))}),M=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=He(e,mt,{duration:150},!1)),T.run(0)),M=!1},d(Z){Z&&y(e),H(t),I&&I.d(),H(r),z&&z.d(),F&&F.d(),Z&&T&&T.end(),E=!1,Ie(L)}}}function wR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function U1(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[TR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[$R,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(O(l.$$.fragment,f),O(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),H(l),H(r),f&&a&&a.end()}}}function SR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=C(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=C(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=C(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(f,r,c),a||(u=[W(e,"click",n[19]),W(i,"click",n[20]),W(s,"click",n[21]),W(r,"click",n[22])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r)),a=!1,Ie(u)}}}function TR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P;return g=new jn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[SR]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=B("Cron expression"),l=C(),s=b("input"),a=C(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=C(),m=b("i"),h=C(),j(g.$$.fragment),_=C(),k=b("div"),S=b("p"),$=B(`Supports numeric list, steps, ranges or - `),T=b("span"),T.textContent="macros",M=B(`. +Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function u(m){var g,_,k;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await _e.backups.upload(h,{requestKey:j1}),t(2,o=!1),i("success"),nn("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(_=(g=S.response)==null?void 0:g.data)==null?void 0:_.file)!=null&&k.message?Ci(S.response.data.file.message):_e.error(S))}r()}oo(()=>{_e.cancelRequest(j1)});const f=()=>s==null?void 0:s.click();function c(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}const d=m=>{var h,g;a((g=(h=m==null?void 0:m.target)==null?void 0:h.files)==null?void 0:g[0])};return n.$$set=m=>{"class"in m&&t(0,l=m.class)},[l,s,o,a,f,c,d]}class kR extends Se{constructor(e){super(),we(this,e,bR,gR,ke,{class:0})}}function yR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function vR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function z1(n){var U,J,Y;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L;t=new fe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[wR,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&U1(n);function A(Z){n[24](Z)}function P(Z){n[25](Z)}function N(Z){n[26](Z)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new $y({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",P)),ie.push(()=>be(r,"testError",N));let z=((Y=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:Y.enabled)&&!n[9]&&!n[5]&&V1(n),F=n[9]&&B1(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),I&&I.c(),l=C(),s=b("div"),o=C(),j(r.$$.fragment),c=C(),d=b("div"),m=b("div"),h=C(),z&&z.c(),g=C(),F&&F.c(),_=C(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],ee(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){v(Z,e,G),q(t,e,null),w(e,i),I&&I.m(e,null),w(e,l),w(e,s),w(e,o),q(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),z&&z.m(d,null),w(d,g),F&&F.m(d,null),w(d,_),w(d,k),w(k,S),O=!0,E||(L=[W(k,"click",n[28]),W(e,"submit",nt(n[11]))],E=!0)},p(Z,G){var ue,Te,Ke;const pe={};G[0]&4|G[1]&3&&(pe.$$scope={dirty:G,ctx:Z}),t.$set(pe),Z[2]?I?(I.p(Z,G),G[0]&4&&M(I,1)):(I=U1(Z),I.c(),M(I,1),I.m(e,l)):I&&(re(),D(I,1,1,()=>{I=null}),ae());const ce={};G[0]&1&&(ce.originalConfig=(ue=Z[0].backups)==null?void 0:ue.s3),!a&&G[0]&2&&(a=!0,ce.config=Z[1].backups.s3,$e(()=>a=!1)),!u&&G[0]&128&&(u=!0,ce.isTesting=Z[7],$e(()=>u=!1)),!f&&G[0]&256&&(f=!0,ce.testError=Z[8],$e(()=>f=!1)),r.$set(ce),(Ke=(Te=Z[1].backups)==null?void 0:Te.s3)!=null&&Ke.enabled&&!Z[9]&&!Z[5]?z?z.p(Z,G):(z=V1(Z),z.c(),z.m(d,g)):z&&(z.d(1),z=null),Z[9]?F?F.p(Z,G):(F=B1(Z),F.c(),F.m(d,_)):F&&(F.d(1),F=null),(!O||G[0]&544&&$!==($=!Z[9]||Z[5]))&&(k.disabled=$),(!O||G[0]&32)&&ee(k,"btn-loading",Z[5])},i(Z){O||(M(t.$$.fragment,Z),M(I),M(r.$$.fragment,Z),Z&&tt(()=>{O&&(T||(T=He(e,mt,{duration:150},!0)),T.run(1))}),O=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=He(e,mt,{duration:150},!1)),T.run(0)),O=!1},d(Z){Z&&y(e),H(t),I&&I.d(),H(r),z&&z.d(),F&&F.d(),Z&&T&&T.end(),E=!1,Ie(L)}}}function wR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function U1(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[TR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[$R,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),H(l),H(r),f&&a&&a.end()}}}function SR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=C(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=C(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=C(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),v(f,s,c),v(f,o,c),v(f,r,c),a||(u=[W(e,"click",n[19]),W(i,"click",n[20]),W(s,"click",n[21]),W(r,"click",n[22])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r)),a=!1,Ie(u)}}}function TR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P;return g=new jn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[SR]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=B("Cron expression"),l=C(),s=b("input"),a=C(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=C(),m=b("i"),h=C(),j(g.$$.fragment),_=C(),k=b("div"),S=b("p"),$=B(`Supports numeric list, steps, ranges or + `),T=b("span"),T.textContent="macros",O=B(`. `),E=b("br"),L=B(` - The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((R=(N=n[0])==null?void 0:N.backups)!=null&&R.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(N,R){var z,F;v(N,e,R),w(e,t),v(N,l,R),v(N,s,R),he(s,n[1].backups.cron),v(N,a,R),v(N,u,R),w(u,f),w(f,c),w(f,d),w(f,m),w(f,h),q(g,f,null),v(N,_,R),v(N,k,R),w(k,S),w(S,$),w(S,T),w(S,M),w(S,E),w(S,L),I=!0,(F=(z=n[0])==null?void 0:z.backups)!=null&&F.cron||s.focus(),A||(P=[W(s,"input",n[18]),Oe(qe.call(null,T,`@yearly + The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((R=(N=n[0])==null?void 0:N.backups)!=null&&R.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(N,R){var z,F;v(N,e,R),w(e,t),v(N,l,R),v(N,s,R),he(s,n[1].backups.cron),v(N,a,R),v(N,u,R),w(u,f),w(f,c),w(f,d),w(f,m),w(f,h),q(g,f,null),v(N,_,R),v(N,k,R),w(k,S),w(S,$),w(S,T),w(S,O),w(S,E),w(S,L),I=!0,(F=(z=n[0])==null?void 0:z.backups)!=null&&F.cron||s.focus(),A||(P=[W(s,"input",n[18]),Oe(qe.call(null,T,`@yearly @annually @monthly @weekly @daily @midnight -@hourly`))],A=!0)},p(N,R){var F,U;(!I||R[1]&1&&i!==(i=N[31]))&&p(e,"for",i),(!I||R[1]&1&&o!==(o=N[31]))&&p(s,"id",o),(!I||R[0]&1&&r!==(r=!((U=(F=N[0])==null?void 0:F.backups)!=null&&U.cron)))&&(s.autofocus=r),R[0]&2&&s.value!==N[1].backups.cron&&he(s,N[1].backups.cron);const z={};R[0]&2|R[1]&2&&(z.$$scope={dirty:R,ctx:N}),g.$set(z)},i(N){I||(O(g.$$.fragment,N),I=!0)},o(N){D(g.$$.fragment,N),I=!1},d(N){N&&(y(e),y(l),y(s),y(a),y(u),y(_),y(k)),H(g),A=!1,Ie(P)}}}function $R(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Max @auto backups to keep"),l=C(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[1].backups.cronMaxKeep),r||(a=W(s,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(s,"id",o),f[0]&2&>(s.value)!==u[1].backups.cronMaxKeep&&he(s,u[1].backups.cronMaxKeep)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function V1(n){let e;function t(s,o){return s[7]?MR:s[8]?OR:CR}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function CR(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function OR(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function MR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function B1(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){v(o,e,r),w(e,t),l||(s=W(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&y(e),l=!1,s()}}}function ER(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P,N;m=new Pu({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new kR({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};k=new oR({props:R}),n[15](k);function z(Y,Z){return Y[6]?vR:yR}let F=z(n),U=F(n),J=n[6]&&!n[4]&&z1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[10]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=C(),j(m.$$.fragment),h=C(),j(g.$$.fragment),_=C(),j(k.$$.fragment),S=C(),$=b("hr"),T=C(),M=b("button"),E=b("span"),E.textContent="Backups options",L=C(),U.c(),I=C(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(M,"type","button"),p(M,"class","btn btn-secondary"),M.disabled=n[4],ee(M,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(Y,Z){v(Y,e,Z),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(Y,r,Z),v(Y,a,Z),w(a,u),w(u,f),w(f,c),w(f,d),q(m,f,null),w(f,h),q(g,f,null),w(u,_),q(k,u,null),w(u,S),w(u,$),w(u,T),w(u,M),w(M,E),w(M,L),U.m(M,null),w(u,I),J&&J.m(u,null),A=!0,P||(N=[W(M,"click",n[16]),W(u,"submit",nt(n[11]))],P=!0)},p(Y,Z){(!A||Z[0]&1024)&&oe(o,Y[10]);const G={};k.$set(G),F!==(F=z(Y))&&(U.d(1),U=F(Y),U&&(U.c(),U.m(M,null))),(!A||Z[0]&16)&&(M.disabled=Y[4]),(!A||Z[0]&16)&&ee(M,"btn-loading",Y[4]),Y[6]&&!Y[4]?J?(J.p(Y,Z),Z[0]&80&&O(J,1)):(J=z1(Y),J.c(),O(J,1),J.m(u,null)):J&&(re(),D(J,1,1,()=>{J=null}),ae())},i(Y){A||(O(m.$$.fragment,Y),O(g.$$.fragment,Y),O(k.$$.fragment,Y),O(J),A=!0)},o(Y){D(m.$$.fragment,Y),D(g.$$.fragment,Y),D(k.$$.fragment,Y),D(J),A=!1},d(Y){Y&&(y(e),y(r),y(a)),H(m),H(g),n[15](null),H(k),U.d(),J&&J.d(),P=!1,Ie(N)}}}function DR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[ER]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function IR(n,e,t){let i,l;Qe(n,un,Z=>t(10,l=Z)),Rn(un,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,h=null;g();async function g(){t(4,a=!0);try{const Z=await _e.settings.getAll()||{};k(Z)}catch(Z){_e.error(Z)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const Z=await _e.settings.update(V.filterRedactedProps(r));Ut({}),await $(),k(Z),nn("Successfully saved application settings.")}catch(Z){_e.error(Z)}t(5,u=!1)}}function k(Z={}){t(1,r={backups:(Z==null?void 0:Z.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function $(){return s==null?void 0:s.loadBackups()}function T(Z){ie[Z?"unshift":"push"](()=>{s=Z,t(3,s)})}const M=()=>t(6,d=!d);function E(){c=this.checked,t(2,c)}function L(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},A=()=>{t(1,r.backups.cron="0 0 * * 0",r)},P=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},N=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function R(){r.backups.cronMaxKeep=gt(this.value),t(1,r),t(2,c)}function z(Z){n.$$.not_equal(r.backups.s3,Z)&&(r.backups.s3=Z,t(1,r),t(2,c))}function F(Z){m=Z,t(7,m)}function U(Z){h=Z,t(8,h)}const J=()=>S(),Y=()=>_();return n.$$.update=()=>{var Z;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(Z=r==null?void 0:r.backups)!=null&&Z.cron&&(Yn("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,h,i,l,_,S,$,f,T,M,E,L,I,A,P,N,R,z,F,U,J,Y]}class LR extends Se{constructor(e){super(),we(this,e,IR,DR,ke,{},null,[-1,-1])}}function W1(n,e,t){const i=n.slice();return i[22]=e[t],i}function AR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I,A,P,N,R,z;o=new fe({props:{class:"form-field",$$slots:{default:[NR,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=de(n[0]);const U=J=>J[22].id;for(let J=0;JBelow you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=C(),i=b("div"),l=b("div"),s=b("div"),j(o.$$.fragment),r=C();for(let J=0;J({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){v(o,t,r),q(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(O(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&y(t),H(i)}}}function FR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[PR,AR],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,k),v(_,a,k),w(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k&128)&&oe(o,_[7]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),O(c,1),c.m(u,null))},i(_){d||(O(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function qR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[FR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function HR(n,e,t){let i,l,s,o;Qe(n,un,A=>t(7,o=A)),Rn(un,o="Export collections",o);const r="export_"+V.randomString(5);let a,u=[],f={},c=!1;d();async function d(){var A;t(4,c=!0);try{t(0,u=await _e.collections.getFullList({batch:100,$cancelKey:r})),t(0,u=V.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;k()}catch(P){_e.error(P)}t(4,c=!1)}function m(){V.downloadJson(Object.values(f),"pb_schema")}function h(){V.copyToClipboard(i),Ks("The configuration was copied to your clipboard!",3e3)}function g(){s?_():k()}function _(){t(1,f={})}function k(){t(1,f={});for(const A of u)t(1,f[A.id]=A,f)}function S(A){f[A.id]?delete f[A.id]:t(1,f[A.id]=A,f),t(1,f)}const $=()=>g(),T=A=>S(A),M=()=>h();function E(A){ie[A?"unshift":"push"](()=>{a=A,t(3,a)})}const L=A=>{if(A.ctrlKey&&A.code==="KeyA"){A.preventDefault();const P=window.getSelection(),N=document.createRange();N.selectNodeContents(a),P.removeAllRanges(),P.addRange(N)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(f),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(f).length),n.$$.dirty&5&&t(5,s=u.length&&l===u.length)},[u,f,l,a,c,s,i,o,m,h,g,S,r,$,T,M,E,L,I]}class jR extends Se{constructor(e){super(),we(this,e,HR,qR,ke,{})}}function K1(n,e,t){const i=n.slice();return i[14]=e[t],i}function J1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Z1(n,e,t){const i=n.slice();return i[14]=e[t],i}function G1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function X1(n,e,t){const i=n.slice();return i[14]=e[t],i}function Q1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function x1(n,e,t){const i=n.slice();return i[30]=e[t],i}function zR(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&eb(),a=n[0].name!==n[1].name&&tb(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),l=b("strong"),o=B(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){v(u,e,f),r&&r.m(e,null),w(e,t),a&&a.m(e,null),w(e,i),w(e,l),w(l,o)},p(u,f){u[10]?r||(r=eb(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=tb(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&oe(o,s)},d(u){u&&y(e),r&&r.d(),a&&a.d()}}}function UR(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=C(),i=b("strong"),s=B(l),p(e,"class","label label-danger")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&oe(s,l)},d(r){r&&(y(e),y(t),y(i))}}}function VR(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=C(),i=b("strong"),s=B(l),p(e,"class","label label-success")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&oe(s,l)},d(r){r&&(y(e),y(t),y(i))}}}function eb(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function tb(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=B(t),l=C(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){v(o,e,r),w(e,i),v(o,l,r),v(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&oe(i,t)},d(o){o&&(y(e),y(l),y(s))}}}function nb(n){var _,k;let e,t,i,l=n[30]+"",s,o,r,a,u=n[12]((_=n[0])==null?void 0:_[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var S,$,T,M,E,L;e=b("tr"),t=b("td"),i=b("span"),s=B(l),o=C(),r=b("td"),a=b("pre"),f=B(u),c=C(),d=b("td"),m=b("pre"),g=B(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),ee(r,"changed-old-col",!n[11]&&Pn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),ee(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),ee(d,"changed-new-col",!n[5]&&Pn((T=n[0])==null?void 0:T[n[30]],(M=n[1])==null?void 0:M[n[30]])),ee(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),ee(e,"txt-primary",Pn((E=n[0])==null?void 0:E[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,$){v(S,e,$),w(e,t),w(t,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(e,c),w(e,d),w(d,m),w(m,g)},p(S,$){var T,M,E,L,I,A,P,N;$[0]&512&&l!==(l=S[30]+"")&&oe(s,l),$[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&oe(f,u),$[0]&2563&&ee(r,"changed-old-col",!S[11]&&Pn((M=S[0])==null?void 0:M[S[30]],(E=S[1])==null?void 0:E[S[30]])),$[0]&2048&&ee(r,"changed-none-col",S[11]),$[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&oe(g,h),$[0]&547&&ee(d,"changed-new-col",!S[5]&&Pn((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),$[0]&32&&ee(d,"changed-none-col",S[5]),$[0]&515&&ee(e,"txt-primary",Pn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&y(e)}}}function ib(n){let e,t=de(n[6]),i=[];for(let l=0;lProps Old New',s=C(),o=b("tbody");for(let T=0;T!c.find(S=>k.id==S.id))))}function _(k){return typeof k>"u"?"":V.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,r=k.collectionA),"collectionB"in k&&t(1,a=k.collectionB),"deleteMissing"in k&&t(2,u=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)&&!(a!=null&&a.name)),n.$$.dirty[0]&33&&t(11,l=!i&&!(r!=null&&r.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(r==null?void 0:r.fields)?r==null?void 0:r.fields.concat():[]),n.$$.dirty[0]&7&&(typeof(r==null?void 0:r.fields)<"u"||typeof(a==null?void 0:a.fields)<"u"||typeof u<"u")&&g(),n.$$.dirty[0]&24&&t(6,d=f.filter(k=>!c.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(k=>f.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,h=c.filter(k=>!f.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(10,s=V.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=V.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(k=>!["fields","created","updated"].includes(k)))},[r,a,u,f,c,i,d,m,h,o,s,l,_]}class YR extends Se{constructor(e){super(),we(this,e,WR,BR,ke,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function cb(n,e,t){const i=n.slice();return i[17]=e[t],i}function db(n){let e,t;return e=new YR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KR(n){let e,t,i=de(n[2]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function OR(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function MR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function B1(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){v(o,e,r),w(e,t),l||(s=W(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&y(e),l=!1,s()}}}function ER(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N;m=new Pu({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new kR({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};k=new oR({props:R}),n[15](k);function z(Y,Z){return Y[6]?vR:yR}let F=z(n),U=F(n),J=n[6]&&!n[4]&&z1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[10]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=C(),j(m.$$.fragment),h=C(),j(g.$$.fragment),_=C(),j(k.$$.fragment),S=C(),$=b("hr"),T=C(),O=b("button"),E=b("span"),E.textContent="Backups options",L=C(),U.c(),I=C(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],ee(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(Y,Z){v(Y,e,Z),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(Y,r,Z),v(Y,a,Z),w(a,u),w(u,f),w(f,c),w(f,d),q(m,f,null),w(f,h),q(g,f,null),w(u,_),q(k,u,null),w(u,S),w(u,$),w(u,T),w(u,O),w(O,E),w(O,L),U.m(O,null),w(u,I),J&&J.m(u,null),A=!0,P||(N=[W(O,"click",n[16]),W(u,"submit",nt(n[11]))],P=!0)},p(Y,Z){(!A||Z[0]&1024)&&oe(o,Y[10]);const G={};k.$set(G),F!==(F=z(Y))&&(U.d(1),U=F(Y),U&&(U.c(),U.m(O,null))),(!A||Z[0]&16)&&(O.disabled=Y[4]),(!A||Z[0]&16)&&ee(O,"btn-loading",Y[4]),Y[6]&&!Y[4]?J?(J.p(Y,Z),Z[0]&80&&M(J,1)):(J=z1(Y),J.c(),M(J,1),J.m(u,null)):J&&(re(),D(J,1,1,()=>{J=null}),ae())},i(Y){A||(M(m.$$.fragment,Y),M(g.$$.fragment,Y),M(k.$$.fragment,Y),M(J),A=!0)},o(Y){D(m.$$.fragment,Y),D(g.$$.fragment,Y),D(k.$$.fragment,Y),D(J),A=!1},d(Y){Y&&(y(e),y(r),y(a)),H(m),H(g),n[15](null),H(k),U.d(),J&&J.d(),P=!1,Ie(N)}}}function DR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[ER]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function IR(n,e,t){let i,l;Qe(n,un,Z=>t(10,l=Z)),Rn(un,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,h=null;g();async function g(){t(4,a=!0);try{const Z=await _e.settings.getAll()||{};k(Z)}catch(Z){_e.error(Z)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const Z=await _e.settings.update(V.filterRedactedProps(r));Ut({}),await $(),k(Z),nn("Successfully saved application settings.")}catch(Z){_e.error(Z)}t(5,u=!1)}}function k(Z={}){t(1,r={backups:(Z==null?void 0:Z.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function $(){return s==null?void 0:s.loadBackups()}function T(Z){ie[Z?"unshift":"push"](()=>{s=Z,t(3,s)})}const O=()=>t(6,d=!d);function E(){c=this.checked,t(2,c)}function L(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},A=()=>{t(1,r.backups.cron="0 0 * * 0",r)},P=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},N=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function R(){r.backups.cronMaxKeep=gt(this.value),t(1,r),t(2,c)}function z(Z){n.$$.not_equal(r.backups.s3,Z)&&(r.backups.s3=Z,t(1,r),t(2,c))}function F(Z){m=Z,t(7,m)}function U(Z){h=Z,t(8,h)}const J=()=>S(),Y=()=>_();return n.$$.update=()=>{var Z;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(Z=r==null?void 0:r.backups)!=null&&Z.cron&&(Yn("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,h,i,l,_,S,$,f,T,O,E,L,I,A,P,N,R,z,F,U,J,Y]}class LR extends Se{constructor(e){super(),we(this,e,IR,DR,ke,{},null,[-1,-1])}}function W1(n,e,t){const i=n.slice();return i[22]=e[t],i}function AR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z;o=new fe({props:{class:"form-field",$$slots:{default:[NR,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=de(n[0]);const U=J=>J[22].id;for(let J=0;JBelow you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=C(),i=b("div"),l=b("div"),s=b("div"),j(o.$$.fragment),r=C();for(let J=0;J({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){v(o,t,r),q(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&y(t),H(i)}}}function FR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[PR,AR],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,k),v(_,a,k),w(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k&128)&&oe(o,_[7]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function qR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[FR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function HR(n,e,t){let i,l,s,o;Qe(n,un,A=>t(7,o=A)),Rn(un,o="Export collections",o);const r="export_"+V.randomString(5);let a,u=[],f={},c=!1;d();async function d(){var A;t(4,c=!0);try{t(0,u=await _e.collections.getFullList({batch:100,$cancelKey:r})),t(0,u=V.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;k()}catch(P){_e.error(P)}t(4,c=!1)}function m(){V.downloadJson(Object.values(f),"pb_schema")}function h(){V.copyToClipboard(i),Ks("The configuration was copied to your clipboard!",3e3)}function g(){s?_():k()}function _(){t(1,f={})}function k(){t(1,f={});for(const A of u)t(1,f[A.id]=A,f)}function S(A){f[A.id]?delete f[A.id]:t(1,f[A.id]=A,f),t(1,f)}const $=()=>g(),T=A=>S(A),O=()=>h();function E(A){ie[A?"unshift":"push"](()=>{a=A,t(3,a)})}const L=A=>{if(A.ctrlKey&&A.code==="KeyA"){A.preventDefault();const P=window.getSelection(),N=document.createRange();N.selectNodeContents(a),P.removeAllRanges(),P.addRange(N)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(f),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(f).length),n.$$.dirty&5&&t(5,s=u.length&&l===u.length)},[u,f,l,a,c,s,i,o,m,h,g,S,r,$,T,O,E,L,I]}class jR extends Se{constructor(e){super(),we(this,e,HR,qR,ke,{})}}function K1(n,e,t){const i=n.slice();return i[14]=e[t],i}function J1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Z1(n,e,t){const i=n.slice();return i[14]=e[t],i}function G1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function X1(n,e,t){const i=n.slice();return i[14]=e[t],i}function Q1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function x1(n,e,t){const i=n.slice();return i[30]=e[t],i}function zR(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&eb(),a=n[0].name!==n[1].name&&tb(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),l=b("strong"),o=B(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){v(u,e,f),r&&r.m(e,null),w(e,t),a&&a.m(e,null),w(e,i),w(e,l),w(l,o)},p(u,f){u[10]?r||(r=eb(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=tb(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&oe(o,s)},d(u){u&&y(e),r&&r.d(),a&&a.d()}}}function UR(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=C(),i=b("strong"),s=B(l),p(e,"class","label label-danger")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&oe(s,l)},d(r){r&&(y(e),y(t),y(i))}}}function VR(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=C(),i=b("strong"),s=B(l),p(e,"class","label label-success")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),w(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&oe(s,l)},d(r){r&&(y(e),y(t),y(i))}}}function eb(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function tb(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=B(t),l=C(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){v(o,e,r),w(e,i),v(o,l,r),v(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&oe(i,t)},d(o){o&&(y(e),y(l),y(s))}}}function nb(n){var _,k;let e,t,i,l=n[30]+"",s,o,r,a,u=n[12]((_=n[0])==null?void 0:_[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var S,$,T,O,E,L;e=b("tr"),t=b("td"),i=b("span"),s=B(l),o=C(),r=b("td"),a=b("pre"),f=B(u),c=C(),d=b("td"),m=b("pre"),g=B(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),ee(r,"changed-old-col",!n[11]&&Pn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),ee(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),ee(d,"changed-new-col",!n[5]&&Pn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),ee(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),ee(e,"txt-primary",Pn((E=n[0])==null?void 0:E[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,$){v(S,e,$),w(e,t),w(t,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(e,c),w(e,d),w(d,m),w(m,g)},p(S,$){var T,O,E,L,I,A,P,N;$[0]&512&&l!==(l=S[30]+"")&&oe(s,l),$[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&oe(f,u),$[0]&2563&&ee(r,"changed-old-col",!S[11]&&Pn((O=S[0])==null?void 0:O[S[30]],(E=S[1])==null?void 0:E[S[30]])),$[0]&2048&&ee(r,"changed-none-col",S[11]),$[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&oe(g,h),$[0]&547&&ee(d,"changed-new-col",!S[5]&&Pn((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),$[0]&32&&ee(d,"changed-none-col",S[5]),$[0]&515&&ee(e,"txt-primary",Pn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&y(e)}}}function ib(n){let e,t=de(n[6]),i=[];for(let l=0;lProps Old New',s=C(),o=b("tbody");for(let T=0;T!c.find(S=>k.id==S.id))))}function _(k){return typeof k>"u"?"":V.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,r=k.collectionA),"collectionB"in k&&t(1,a=k.collectionB),"deleteMissing"in k&&t(2,u=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)&&!(a!=null&&a.name)),n.$$.dirty[0]&33&&t(11,l=!i&&!(r!=null&&r.id)),n.$$.dirty[0]&1&&t(3,f=Array.isArray(r==null?void 0:r.fields)?r==null?void 0:r.fields.concat():[]),n.$$.dirty[0]&7&&(typeof(r==null?void 0:r.fields)<"u"||typeof(a==null?void 0:a.fields)<"u"||typeof u<"u")&&g(),n.$$.dirty[0]&24&&t(6,d=f.filter(k=>!c.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(k=>f.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,h=c.filter(k=>!f.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(10,s=V.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=V.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(k=>!["fields","created","updated"].includes(k)))},[r,a,u,f,c,i,d,m,h,o,s,l,_]}class YR extends Se{constructor(e){super(),we(this,e,WR,BR,ke,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function cb(n,e,t){const i=n.slice();return i[17]=e[t],i}function db(n){let e,t;return e=new YR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KR(n){let e,t,i=de(n[2]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await _e.collections.import(o,a),nn("Successfully imported collections configuration."),i("submit")}catch(T){_e.error(T)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function k(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,g,_,k,S,$]}class QR extends Se{constructor(e){super(),we(this,e,XR,GR,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function pb(n,e,t){const i=n.slice();return i[34]=e[t],i}function mb(n,e,t){const i=n.slice();return i[37]=e[t],i}function hb(n,e,t){const i=n.slice();return i[34]=e[t],i}function xR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,M,E,L,I;a=new fe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[tF,({uniqueId:U})=>({42:U}),({uniqueId:U})=>[0,U?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&gb(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&bb(),R=n[6]&&n[1].length&&n[7]&&kb(n),z=n[13].length&&Db(n),F=!!n[0]&&Ib(n);return{c(){e=b("input"),t=C(),i=b("div"),l=b("p"),s=B(`Paste below the collections configuration you want to import or - `),o=b("button"),o.innerHTML='Load from JSON file',r=C(),j(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),N&&N.c(),d=C(),R&&R.c(),m=C(),z&&z.c(),h=C(),g=b("div"),F&&F.c(),_=C(),k=b("div"),S=C(),$=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ee(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(k,"class","flex-fill"),p(T,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=M=!n[14],p(g,"class","flex m-t-base")},m(U,J){v(U,e,J),n[22](e),v(U,t,J),v(U,i,J),w(i,l),w(l,s),w(l,o),v(U,r,J),q(a,U,J),v(U,u,J),A&&A.m(U,J),v(U,f,J),v(U,c,J),N&&N.m(U,J),v(U,d,J),R&&R.m(U,J),v(U,m,J),z&&z.m(U,J),v(U,h,J),v(U,g,J),F&&F.m(g,null),w(g,_),w(g,k),w(g,S),w(g,$),w($,T),E=!0,L||(I=[W(e,"change",n[23]),W(o,"click",n[24]),W($,"click",n[20])],L=!0)},p(U,J){(!E||J[0]&4096)&&ee(o,"btn-loading",U[12]);const Y={};J[0]&64&&(Y.class="form-field "+(U[6]?"":"field-error")),J[0]&65|J[1]&6144&&(Y.$$scope={dirty:J,ctx:U}),a.$set(Y),U[1].length?A?(A.p(U,J),J[0]&2&&O(A,1)):(A=gb(U),A.c(),O(A,1),A.m(f.parentNode,f)):A&&(re(),D(A,1,1,()=>{A=null}),ae()),U[6]&&U[1].length&&!U[7]?N||(N=bb(),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),U[6]&&U[1].length&&U[7]?R?R.p(U,J):(R=kb(U),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),U[13].length?z?z.p(U,J):(z=Db(U),z.c(),z.m(h.parentNode,h)):z&&(z.d(1),z=null),U[0]?F?F.p(U,J):(F=Ib(U),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!E||J[0]&16384&&M!==(M=!U[14]))&&($.disabled=M)},i(U){E||(O(a.$$.fragment,U),O(A),O(P),E=!0)},o(U){D(a.$$.fragment,U),D(A),D(P),E=!1},d(U){U&&(y(e),y(t),y(i),y(r),y(u),y(f),y(c),y(d),y(m),y(h),y(g)),n[22](null),H(a,U),A&&A.d(U),N&&N.d(U),R&&R.d(U),z&&z.d(U),F&&F.d(),L=!1,Ie(I)}}}function eF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function _b(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function tF(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&_b();return{c(){e=b("label"),t=B("Collections"),l=C(),s=b("textarea"),r=C(),c&&c.c(),a=ye(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[0]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(s,"input",n[25]),u=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&he(s,d[0]),d[0]&&!d[6]?c||(c=_b(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function gb(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[nF,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function nF(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(f,c){v(f,e,c),e.checked=n[5],v(f,l,c),v(f,s,c),w(s,o),a||(u=W(e,"change",n[26]),a=!0)},p(f,c){c[1]&2048&&t!==(t=f[42])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&2048&&r!==(r=f[42])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function bb(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function kb(n){let e,t,i,l,s,o=n[9].length&&yb(n),r=n[3].length&&Sb(n),a=n[8].length&&Ob(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=C(),i=b("div"),o&&o.c(),l=C(),r&&r.c(),s=C(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){v(u,e,f),v(u,t,f),v(u,i,f),o&&o.m(i,null),w(i,l),r&&r.m(i,null),w(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=yb(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=Sb(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Ob(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(y(e),y(t),y(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function yb(n){let e=[],t=new Map,i,l=de(n[9]);const s=o=>o[34].id;for(let o=0;oo[37].old.id+o[37].new.id;for(let o=0;oo[34].id;for(let o=0;o',i=C(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await _e.collections.import(o,a),nn("Successfully imported collections configuration."),i("submit")}catch(T){_e.error(T)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function k(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,g,_,k,S,$]}class QR extends Se{constructor(e){super(),we(this,e,XR,GR,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function pb(n,e,t){const i=n.slice();return i[34]=e[t],i}function mb(n,e,t){const i=n.slice();return i[37]=e[t],i}function hb(n,e,t){const i=n.slice();return i[34]=e[t],i}function xR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I;a=new fe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[tF,({uniqueId:U})=>({42:U}),({uniqueId:U})=>[0,U?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&gb(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&bb(),R=n[6]&&n[1].length&&n[7]&&kb(n),z=n[13].length&&Db(n),F=!!n[0]&&Ib(n);return{c(){e=b("input"),t=C(),i=b("div"),l=b("p"),s=B(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=C(),j(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),N&&N.c(),d=C(),R&&R.c(),m=C(),z&&z.c(),h=C(),g=b("div"),F&&F.c(),_=C(),k=b("div"),S=C(),$=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ee(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(k,"class","flex-fill"),p(T,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=O=!n[14],p(g,"class","flex m-t-base")},m(U,J){v(U,e,J),n[22](e),v(U,t,J),v(U,i,J),w(i,l),w(l,s),w(l,o),v(U,r,J),q(a,U,J),v(U,u,J),A&&A.m(U,J),v(U,f,J),v(U,c,J),N&&N.m(U,J),v(U,d,J),R&&R.m(U,J),v(U,m,J),z&&z.m(U,J),v(U,h,J),v(U,g,J),F&&F.m(g,null),w(g,_),w(g,k),w(g,S),w(g,$),w($,T),E=!0,L||(I=[W(e,"change",n[23]),W(o,"click",n[24]),W($,"click",n[20])],L=!0)},p(U,J){(!E||J[0]&4096)&&ee(o,"btn-loading",U[12]);const Y={};J[0]&64&&(Y.class="form-field "+(U[6]?"":"field-error")),J[0]&65|J[1]&6144&&(Y.$$scope={dirty:J,ctx:U}),a.$set(Y),U[1].length?A?(A.p(U,J),J[0]&2&&M(A,1)):(A=gb(U),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(re(),D(A,1,1,()=>{A=null}),ae()),U[6]&&U[1].length&&!U[7]?N||(N=bb(),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),U[6]&&U[1].length&&U[7]?R?R.p(U,J):(R=kb(U),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),U[13].length?z?z.p(U,J):(z=Db(U),z.c(),z.m(h.parentNode,h)):z&&(z.d(1),z=null),U[0]?F?F.p(U,J):(F=Ib(U),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!U[14]))&&($.disabled=O)},i(U){E||(M(a.$$.fragment,U),M(A),M(P),E=!0)},o(U){D(a.$$.fragment,U),D(A),D(P),E=!1},d(U){U&&(y(e),y(t),y(i),y(r),y(u),y(f),y(c),y(d),y(m),y(h),y(g)),n[22](null),H(a,U),A&&A.d(U),N&&N.d(U),R&&R.d(U),z&&z.d(U),F&&F.d(),L=!1,Ie(I)}}}function eF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function _b(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function tF(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&_b();return{c(){e=b("label"),t=B("Collections"),l=C(),s=b("textarea"),r=C(),c&&c.c(),a=ye(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[0]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(s,"input",n[25]),u=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&he(s,d[0]),d[0]&&!d[6]?c||(c=_b(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function gb(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[nF,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function nF(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(f,c){v(f,e,c),e.checked=n[5],v(f,l,c),v(f,s,c),w(s,o),a||(u=W(e,"change",n[26]),a=!0)},p(f,c){c[1]&2048&&t!==(t=f[42])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&2048&&r!==(r=f[42])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function bb(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function kb(n){let e,t,i,l,s,o=n[9].length&&yb(n),r=n[3].length&&Sb(n),a=n[8].length&&Ob(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=C(),i=b("div"),o&&o.c(),l=C(),r&&r.c(),s=C(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){v(u,e,f),v(u,t,f),v(u,i,f),o&&o.m(i,null),w(i,l),r&&r.m(i,null),w(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=yb(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=Sb(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Ob(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(y(e),y(t),y(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function yb(n){let e=[],t=new Map,i,l=de(n[9]);const s=o=>o[34].id;for(let o=0;oo[37].old.id+o[37].new.id;for(let o=0;oo[34].id;for(let o=0;o',i=C(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,s=C(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),r||(a=W(o,"click",n[28]),r=!0)},p:te,d(u){u&&y(e),r=!1,a()}}}function Ib(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[29]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function iF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[eF,xR],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[15]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,k),v(_,a,k),w(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&oe(o,_[15]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),O(c,1),c.m(u,null))},i(_){d||(O(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function lF(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[iF]},$$scope:{ctx:n}}});let r={};return s=new QR({props:r}),n[30](s),s.$on("submit",n[31]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&4096&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(O(e.$$.fragment,a),O(i.$$.fragment,a),O(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function sF(n,e,t){let i,l,s,o,r,a,u;Qe(n,un,ce=>t(15,u=ce)),Rn(un,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,k=[],S=!1,$=!1;T();async function T(){var ce;t(4,S=!0);try{t(21,g=await _e.collections.getFullList(200));for(let ue of g)delete ue.created,delete ue.updated,(ce=ue.oauth2)==null||delete ce.providers}catch(ue){_e.error(ue)}t(4,S=!1)}function M(){if(t(3,k=[]),!!i)for(let ce of h){const ue=V.findByKey(g,"id",ce.id);!(ue!=null&&ue.id)||!V.hasCollectionChanges(ue,ce,_)||k.push({new:ce,old:ue})}}function E(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=V.filterDuplicatesByKey(h)):t(1,h=[]);for(let ce of h)delete ce.created,delete ce.updated,ce.fields=V.filterDuplicatesByKey(ce.fields)}function L(){var ce;for(let ue of h){const Te=V.findByKey(g,"name",ue.name)||V.findByKey(g,"id",ue.id);if(!Te)continue;const Ke=ue.id,Je=Te.id;ue.id=Je;const ft=Array.isArray(Te.fields)?Te.fields:[],et=Array.isArray(ue.fields)?ue.fields:[];for(const xe of et){const We=V.findByKey(ft,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===Ke&&(We.collectionId=Je);for(let xe=0;xe<((ce=ue.indexes)==null?void 0:ce.length);xe++)ue.indexes[xe]=ue.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,We=>We.replace(Ke,Je))}t(0,d=JSON.stringify(h,null,4))}function I(ce){t(12,m=!0);const ue=new FileReader;ue.onload=async Te=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Te.target.result),await dn(),h.length||(Ci("Invalid collections configuration."),A())},ue.onerror=Te=>{console.warn(Te),Ci("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(ce)}function A(){t(0,d=""),t(10,f.value="",f),Ut({})}function P(){const ce=$?V.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,ce,_)}function N(ce){ie[ce?"unshift":"push"](()=>{f=ce,t(10,f)})}const R=()=>{f.files.length&&I(f.files[0])},z=()=>{f.click()};function F(){d=this.value,t(0,d)}function U(){$=this.checked,t(5,$)}function J(){_=this.checked,t(2,_)}const Y=()=>L(),Z=()=>A();function G(ce){ie[ce?"unshift":"push"](()=>{c=ce,t(11,c)})}const pe=()=>{A(),T()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&$!==null&&E(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(ce=>!!ce.id&&!!ce.name).length),n.$$.dirty[0]&2097254&&t(9,l=g.filter(ce=>i&&!$&&_&&!V.findByKey(h,"id",ce.id))),n.$$.dirty[0]&2097218&&t(8,s=h.filter(ce=>i&&!V.findByKey(g,"id",ce.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof _<"u")&&M(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||k.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&2097154&&t(13,a=h.filter(ce=>{let ue=V.findByKey(g,"name",ce.name)||V.findByKey(g,"id",ce.id);if(!ue)return!1;if(ue.id!=ce.id)return!0;const Te=Array.isArray(ue.fields)?ue.fields:[],Ke=Array.isArray(ce.fields)?ce.fields:[];for(const Je of Ke){if(V.findByKey(Te,"id",Je.id))continue;const et=V.findByKey(Te,"name",Je.name);if(et&&Je.id!=et.id)return!0}return!1}))},[d,h,_,k,S,$,i,o,s,l,f,c,m,a,r,u,T,L,I,A,P,g,N,R,z,F,U,J,Y,Z,G,pe]}class oF extends Se{constructor(e){super(),we(this,e,sF,lF,ke,{},null,[-1,-1])}}function rF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;i=new fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[uF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[fF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[cF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&Lb(n);function _($,T){return $[6]?wF:vF}let k=_(n),S=k(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),g&&g.c(),f=C(),c=b("div"),d=b("div"),m=C(),S.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(d,"class","flex-fill"),p(c,"class","flex")},m($,T){v($,e,T),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),v($,r,T),q(a,$,T),v($,u,T),g&&g.m($,T),v($,f,T),v($,c,T),w(c,d),w(c,m),S.m(c,null),h=!0},p($,T){const M={};T[0]&1|T[1]&12&&(M.$$scope={dirty:T,ctx:$}),i.$set(M);const E={};T[0]&1|T[1]&12&&(E.$$scope={dirty:T,ctx:$}),o.$set(E);const L={};T[0]&1|T[1]&12&&(L.$$scope={dirty:T,ctx:$}),a.$set(L),$[0].smtp.enabled?g?(g.p($,T),T[0]&1&&O(g,1)):(g=Lb($),g.c(),O(g,1),g.m(f.parentNode,f)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),k===(k=_($))&&S?S.p($,T):(S.d(1),S=k($),S&&(S.c(),S.m(c,null)))},i($){h||(O(i.$$.fragment,$),O(o.$$.fragment,$),O(a.$$.fragment,$),O(g),h=!0)},o($){D(i.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(g),h=!1},d($){$&&(y(e),y(r),y(u),y(f),y(c)),H(i),H(o),H(a,$),g&&g.d($),S.d()}}}function aF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function uF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Sender name"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.senderName),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&he(s,u[0].meta.senderName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function fF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Sender address"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","email"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.senderAddress),r||(a=W(s,"input",n[15]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&he(s,u[0].meta.senderAddress)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function cF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[33]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[33])},m(c,d){v(c,e,d),e.checked=n[0].smtp.enabled,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[16]),Oe(qe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&4&&t!==(t=c[33])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&4&&a!==(a=c[33])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function Lb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T;l=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[dF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[pF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[mF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[hF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function M(A,P){return A[5]?gF:_F}let E=M(n),L=E(n),I=n[5]&&Ab(n);return{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),g=b("button"),L.c(),_=C(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(A,P){v(A,e,P),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(e,h),w(e,g),L.m(g,null),w(e,_),I&&I.m(e,null),S=!0,$||(T=W(g,"click",nt(n[22])),$=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),l.$set(N);const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),r.$set(R);const z={};P[0]&1|P[1]&12&&(z.$$scope={dirty:P,ctx:A}),f.$set(z);const F={};P[0]&17|P[1]&12&&(F.$$scope={dirty:P,ctx:A}),m.$set(F),E!==(E=M(A))&&(L.d(1),L=E(A),L&&(L.c(),L.m(g,null))),A[5]?I?(I.p(A,P),P[0]&32&&O(I,1)):(I=Ab(A),I.c(),O(I,1),I.m(e,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae())},i(A){S||(O(l.$$.fragment,A),O(r.$$.fragment,A),O(f.$$.fragment,A),O(m.$$.fragment,A),O(I),A&&tt(()=>{S&&(k||(k=He(e,mt,{duration:150},!0)),k.run(1))}),S=!0)},o(A){D(l.$$.fragment,A),D(r.$$.fragment,A),D(f.$$.fragment,A),D(m.$$.fragment,A),D(I),A&&(k||(k=He(e,mt,{duration:150},!1)),k.run(0)),S=!1},d(A){A&&y(e),H(l),H(r),H(f),H(m),L.d(),I&&I.d(),A&&k&&k.end(),$=!1,T()}}}function dF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("SMTP server host"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].smtp.host),r||(a=W(s,"input",n[17]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&he(s,u[0].smtp.host)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Port"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","number"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].smtp.port),r||(a=W(s,"input",n[18]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&>(s.value)!==u[0].smtp.port&&he(s,u[0].smtp.port)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function mF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Username"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].smtp.username),r||(a=W(s,"input",n[19]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&he(s,u[0].smtp.username)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function hF(n){let e,t,i,l,s,o,r,a;function u(d){n[20](d)}function f(d){n[21](d)}let c={id:n[33]};return n[4]!==void 0&&(c.mask=n[4]),n[0].smtp.password!==void 0&&(c.value=n[0].smtp.password),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Password"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const h={};m[1]&4&&(h.id=d[33]),!o&&m[0]&16&&(o=!0,h.mask=d[4],$e(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,$e(()=>r=!1)),s.$set(h)},i(d){a||(O(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function _F(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function gF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function Ab(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[bF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[kF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[yF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),m=!0},p(h,g){const _={};g[0]&1|g[1]&12&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g[0]&1|g[1]&12&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g[0]&1|g[1]&12&&(S.$$scope={dirty:g,ctx:h}),u.$set(S)},i(h){m||(O(i.$$.fragment,h),O(o.$$.fragment,h),O(u.$$.fragment,h),h&&tt(()=>{m&&(d||(d=He(e,mt,{duration:150},!0)),d.run(1))}),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),h&&(d||(d=He(e,mt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&y(e),H(i),H(o),H(u),h&&d&&d.end()}}}function bF(n){let e,t,i,l,s,o,r;function a(f){n[23](f)}let u={id:n[33],items:n[8]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("TLS encryption"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function kF(n){let e,t,i,l,s,o,r;function a(f){n[24](f)}let u={id:n[33],items:n[9]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("AUTH method"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,$e(()=>o=!1)),s.$set(d)},i(f){r||(O(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function yF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[33]),p(r,"type","text"),p(r,"id",a=n[33]),p(r,"placeholder","Default to localhost")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].smtp.localName),u||(f=[Oe(qe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),W(r,"input",n[25])],u=!0)},p(c,d){d[1]&4&&s!==(s=c[33])&&p(e,"for",s),d[1]&4&&a!==(a=c[33])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&he(r,c[0].smtp.localName)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function vF(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[28]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function wF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[6]||n[3],ee(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=[W(e,"click",n[26]),W(l,"click",n[27])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&72&&o!==(o=!u[6]||u[3])&&(l.disabled=o),f[0]&8&&ee(l,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(l)),r=!1,Ie(a)}}}function SF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[aF,rF],S=[];function $(T,M){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){v(T,e,M),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,M),v(T,a,M),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=W(u,"submit",nt(n[29])),g=!0)},p(T,M){(!h||M[0]&128)&&oe(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,M):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,M):(m=S[d]=k[d](T),m.c()),O(m,1),m.m(u,null))},i(T){h||(O(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function TF(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[SF]},$$scope:{ctx:n}}});let r={};return s=new gy({props:r}),n[30](s),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&255|u[1]&8&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(O(e.$$.fragment,a),O(i.$$.fragment,a),O(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function $F(n,e,t){let i,l,s;Qe(n,un,pe=>t(7,s=pe));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Rn(un,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;g();async function g(){t(2,c=!0);try{const pe=await _e.settings.getAll()||{};k(pe)}catch(pe){_e.error(pe)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const pe=await _e.settings.update(V.filterRedactedProps(f));k(pe),Ut({}),nn("Successfully saved mail settings.")}catch(pe){_e.error(pe)}t(3,d=!1)}}function k(pe={}){t(0,f={meta:(pe==null?void 0:pe.meta)||{},smtp:(pe==null?void 0:pe.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(12,u=JSON.parse(JSON.stringify(f))),t(4,m=!!f.smtp.username)}function S(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function $(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function M(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=gt(this.value),t(0,f)}function I(){f.smtp.username=this.value,t(0,f)}function A(pe){m=pe,t(4,m)}function P(pe){n.$$.not_equal(f.smtp.password,pe)&&(f.smtp.password=pe,t(0,f))}const N=()=>{t(5,h=!h)};function R(pe){n.$$.not_equal(f.smtp.tls,pe)&&(f.smtp.tls=pe,t(0,f))}function z(pe){n.$$.not_equal(f.smtp.authMethod,pe)&&(f.smtp.authMethod=pe,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const U=()=>S(),J=()=>_(),Y=()=>a==null?void 0:a.show(),Z=()=>_();function G(pe){ie[pe?"unshift":"push"](()=>{a=pe,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&4096&&t(13,i=JSON.stringify(u)),n.$$.dirty[0]&8193&&t(6,l=i!=JSON.stringify(f))},[f,a,c,d,m,h,l,s,o,r,_,S,u,i,$,T,M,E,L,I,A,P,N,R,z,F,U,J,Y,Z,G]}class CF extends Se{constructor(e){super(),we(this,e,$F,TF,ke,{},null,[-1,-1])}}function OF(n){var L;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function k(I){n[11](I)}function S(I){n[12](I)}function $(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[EF]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new $y({props:T}),ie.push(()=>be(e,"config",k)),ie.push(()=>be(e,"isTesting",S)),ie.push(()=>be(e,"testError",$));let M=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&Nb(n),E=n[6]&&Rb(n);return{c(){j(e.$$.fragment),s=C(),o=b("div"),r=b("div"),a=C(),M&&M.c(),u=C(),E&&E.c(),f=C(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],ee(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),v(I,s,A),v(I,o,A),w(o,r),w(o,a),M&&M.m(o,null),w(o,u),E&&E.m(o,null),w(o,f),w(o,c),w(c,d),h=!0,g||(_=W(c,"click",n[15]),g=!0)},p(I,A){var N;const P={};A&1&&(P.originalConfig=I[0].s3),A&524291&&(P.$$scope={dirty:A,ctx:I}),!t&&A&2&&(t=!0,P.config=I[1].s3,$e(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],$e(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=I[5],$e(()=>l=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?M?M.p(I,A):(M=Nb(I),M.c(),M.m(o,u)):M&&(M.d(1),M=null),I[6]?E?E.p(I,A):(E=Rb(I),E.c(),E.m(o,f)):E&&(E.d(1),E=null),(!h||A&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||A&8)&&ee(c,"btn-loading",I[3])},i(I){h||(O(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(y(s),y(o)),H(e,I),M&&M.d(),E&&E.d(),g=!1,_()}}}function MF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function Pb(n){var A;let e,t,i,l,s,o,r,a=(A=n[0].s3)!=null&&A.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,g,_,k,S,$,T,M,E,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=B(`If you have existing uploaded files, you'll have to migrate them manually + to.
    `,s=C(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),r||(a=W(o,"click",n[28]),r=!0)},p:te,d(u){u&&y(e),r=!1,a()}}}function Ib(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[29]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function iF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[eF,xR],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[15]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,k),v(_,a,k),w(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&oe(o,_[15]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function lF(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[iF]},$$scope:{ctx:n}}});let r={};return s=new QR({props:r}),n[30](s),s.$on("submit",n[31]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&4096&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function sF(n,e,t){let i,l,s,o,r,a,u;Qe(n,un,ce=>t(15,u=ce)),Rn(un,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,k=[],S=!1,$=!1;T();async function T(){var ce;t(4,S=!0);try{t(21,g=await _e.collections.getFullList(200));for(let ue of g)delete ue.created,delete ue.updated,(ce=ue.oauth2)==null||delete ce.providers}catch(ue){_e.error(ue)}t(4,S=!1)}function O(){if(t(3,k=[]),!!i)for(let ce of h){const ue=V.findByKey(g,"id",ce.id);!(ue!=null&&ue.id)||!V.hasCollectionChanges(ue,ce,_)||k.push({new:ce,old:ue})}}function E(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=V.filterDuplicatesByKey(h)):t(1,h=[]);for(let ce of h)delete ce.created,delete ce.updated,ce.fields=V.filterDuplicatesByKey(ce.fields)}function L(){var ce;for(let ue of h){const Te=V.findByKey(g,"name",ue.name)||V.findByKey(g,"id",ue.id);if(!Te)continue;const Ke=ue.id,Je=Te.id;ue.id=Je;const ft=Array.isArray(Te.fields)?Te.fields:[],et=Array.isArray(ue.fields)?ue.fields:[];for(const xe of et){const We=V.findByKey(ft,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===Ke&&(We.collectionId=Je);for(let xe=0;xe<((ce=ue.indexes)==null?void 0:ce.length);xe++)ue.indexes[xe]=ue.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,We=>We.replace(Ke,Je))}t(0,d=JSON.stringify(h,null,4))}function I(ce){t(12,m=!0);const ue=new FileReader;ue.onload=async Te=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Te.target.result),await dn(),h.length||(Ci("Invalid collections configuration."),A())},ue.onerror=Te=>{console.warn(Te),Ci("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(ce)}function A(){t(0,d=""),t(10,f.value="",f),Ut({})}function P(){const ce=$?V.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,ce,_)}function N(ce){ie[ce?"unshift":"push"](()=>{f=ce,t(10,f)})}const R=()=>{f.files.length&&I(f.files[0])},z=()=>{f.click()};function F(){d=this.value,t(0,d)}function U(){$=this.checked,t(5,$)}function J(){_=this.checked,t(2,_)}const Y=()=>L(),Z=()=>A();function G(ce){ie[ce?"unshift":"push"](()=>{c=ce,t(11,c)})}const pe=()=>{A(),T()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&$!==null&&E(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(ce=>!!ce.id&&!!ce.name).length),n.$$.dirty[0]&2097254&&t(9,l=g.filter(ce=>i&&!$&&_&&!V.findByKey(h,"id",ce.id))),n.$$.dirty[0]&2097218&&t(8,s=h.filter(ce=>i&&!V.findByKey(g,"id",ce.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof _<"u")&&O(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||k.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&2097154&&t(13,a=h.filter(ce=>{let ue=V.findByKey(g,"name",ce.name)||V.findByKey(g,"id",ce.id);if(!ue)return!1;if(ue.id!=ce.id)return!0;const Te=Array.isArray(ue.fields)?ue.fields:[],Ke=Array.isArray(ce.fields)?ce.fields:[];for(const Je of Ke){if(V.findByKey(Te,"id",Je.id))continue;const et=V.findByKey(Te,"name",Je.name);if(et&&Je.id!=et.id)return!0}return!1}))},[d,h,_,k,S,$,i,o,s,l,f,c,m,a,r,u,T,L,I,A,P,g,N,R,z,F,U,J,Y,Z,G,pe]}class oF extends Se{constructor(e){super(),we(this,e,sF,lF,ke,{},null,[-1,-1])}}function rF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;i=new fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[uF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[fF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[cF,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&Lb(n);function _($,T){return $[6]?wF:vF}let k=_(n),S=k(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),j(a.$$.fragment),u=C(),g&&g.c(),f=C(),c=b("div"),d=b("div"),m=C(),S.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(d,"class","flex-fill"),p(c,"class","flex")},m($,T){v($,e,T),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),v($,r,T),q(a,$,T),v($,u,T),g&&g.m($,T),v($,f,T),v($,c,T),w(c,d),w(c,m),S.m(c,null),h=!0},p($,T){const O={};T[0]&1|T[1]&12&&(O.$$scope={dirty:T,ctx:$}),i.$set(O);const E={};T[0]&1|T[1]&12&&(E.$$scope={dirty:T,ctx:$}),o.$set(E);const L={};T[0]&1|T[1]&12&&(L.$$scope={dirty:T,ctx:$}),a.$set(L),$[0].smtp.enabled?g?(g.p($,T),T[0]&1&&M(g,1)):(g=Lb($),g.c(),M(g,1),g.m(f.parentNode,f)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),k===(k=_($))&&S?S.p($,T):(S.d(1),S=k($),S&&(S.c(),S.m(c,null)))},i($){h||(M(i.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(g),h=!0)},o($){D(i.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(g),h=!1},d($){$&&(y(e),y(r),y(u),y(f),y(c)),H(i),H(o),H(a,$),g&&g.d($),S.d()}}}function aF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function uF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Sender name"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.senderName),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&he(s,u[0].meta.senderName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function fF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Sender address"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","email"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].meta.senderAddress),r||(a=W(s,"input",n[15]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&he(s,u[0].meta.senderAddress)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function cF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[33]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[33])},m(c,d){v(c,e,d),e.checked=n[0].smtp.enabled,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[16]),Oe(qe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&4&&t!==(t=c[33])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&4&&a!==(a=c[33])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function Lb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T;l=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[dF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[pF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[mF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[hF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function O(A,P){return A[5]?gF:_F}let E=O(n),L=E(n),I=n[5]&&Ab(n);return{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),g=b("button"),L.c(),_=C(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(A,P){v(A,e,P),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(e,h),w(e,g),L.m(g,null),w(e,_),I&&I.m(e,null),S=!0,$||(T=W(g,"click",nt(n[22])),$=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),l.$set(N);const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),r.$set(R);const z={};P[0]&1|P[1]&12&&(z.$$scope={dirty:P,ctx:A}),f.$set(z);const F={};P[0]&17|P[1]&12&&(F.$$scope={dirty:P,ctx:A}),m.$set(F),E!==(E=O(A))&&(L.d(1),L=E(A),L&&(L.c(),L.m(g,null))),A[5]?I?(I.p(A,P),P[0]&32&&M(I,1)):(I=Ab(A),I.c(),M(I,1),I.m(e,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae())},i(A){S||(M(l.$$.fragment,A),M(r.$$.fragment,A),M(f.$$.fragment,A),M(m.$$.fragment,A),M(I),A&&tt(()=>{S&&(k||(k=He(e,mt,{duration:150},!0)),k.run(1))}),S=!0)},o(A){D(l.$$.fragment,A),D(r.$$.fragment,A),D(f.$$.fragment,A),D(m.$$.fragment,A),D(I),A&&(k||(k=He(e,mt,{duration:150},!1)),k.run(0)),S=!1},d(A){A&&y(e),H(l),H(r),H(f),H(m),L.d(),I&&I.d(),A&&k&&k.end(),$=!1,T()}}}function dF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("SMTP server host"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].smtp.host),r||(a=W(s,"input",n[17]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&he(s,u[0].smtp.host)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Port"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","number"),p(s,"id",o=n[33]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].smtp.port),r||(a=W(s,"input",n[18]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&>(s.value)!==u[0].smtp.port&&he(s,u[0].smtp.port)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function mF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Username"),l=C(),s=b("input"),p(e,"for",i=n[33]),p(s,"type","text"),p(s,"id",o=n[33])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].smtp.username),r||(a=W(s,"input",n[19]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&p(e,"for",i),f[1]&4&&o!==(o=u[33])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&he(s,u[0].smtp.username)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function hF(n){let e,t,i,l,s,o,r,a;function u(d){n[20](d)}function f(d){n[21](d)}let c={id:n[33]};return n[4]!==void 0&&(c.mask=n[4]),n[0].smtp.password!==void 0&&(c.value=n[0].smtp.password),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Password"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const h={};m[1]&4&&(h.id=d[33]),!o&&m[0]&16&&(o=!0,h.mask=d[4],$e(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,$e(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function _F(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function gF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function Ab(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[bF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[kF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[yF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),f=C(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),m=!0},p(h,g){const _={};g[0]&1|g[1]&12&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g[0]&1|g[1]&12&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g[0]&1|g[1]&12&&(S.$$scope={dirty:g,ctx:h}),u.$set(S)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),h&&tt(()=>{m&&(d||(d=He(e,mt,{duration:150},!0)),d.run(1))}),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),h&&(d||(d=He(e,mt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&y(e),H(i),H(o),H(u),h&&d&&d.end()}}}function bF(n){let e,t,i,l,s,o,r;function a(f){n[23](f)}let u={id:n[33],items:n[8]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("TLS encryption"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function kF(n){let e,t,i,l,s,o,r;function a(f){n[24](f)}let u={id:n[33],items:n[9]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("AUTH method"),l=C(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function yF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[33]),p(r,"type","text"),p(r,"id",a=n[33]),p(r,"placeholder","Default to localhost")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].smtp.localName),u||(f=[Oe(qe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),W(r,"input",n[25])],u=!0)},p(c,d){d[1]&4&&s!==(s=c[33])&&p(e,"for",s),d[1]&4&&a!==(a=c[33])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&he(r,c[0].smtp.localName)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function vF(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[28]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function wF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[6]||n[3],ee(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=[W(e,"click",n[26]),W(l,"click",n[27])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&72&&o!==(o=!u[6]||u[3])&&(l.disabled=o),f[0]&8&&ee(l,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(l)),r=!1,Ie(a)}}}function SF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[aF,rF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=W(u,"submit",nt(n[29])),g=!0)},p(T,O){(!h||O[0]&128)&&oe(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function TF(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[SF]},$$scope:{ctx:n}}});let r={};return s=new gy({props:r}),n[30](s),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&255|u[1]&8&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function $F(n,e,t){let i,l,s;Qe(n,un,pe=>t(7,s=pe));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Rn(un,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;g();async function g(){t(2,c=!0);try{const pe=await _e.settings.getAll()||{};k(pe)}catch(pe){_e.error(pe)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const pe=await _e.settings.update(V.filterRedactedProps(f));k(pe),Ut({}),nn("Successfully saved mail settings.")}catch(pe){_e.error(pe)}t(3,d=!1)}}function k(pe={}){t(0,f={meta:(pe==null?void 0:pe.meta)||{},smtp:(pe==null?void 0:pe.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(12,u=JSON.parse(JSON.stringify(f))),t(4,m=!!f.smtp.username)}function S(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function $(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=gt(this.value),t(0,f)}function I(){f.smtp.username=this.value,t(0,f)}function A(pe){m=pe,t(4,m)}function P(pe){n.$$.not_equal(f.smtp.password,pe)&&(f.smtp.password=pe,t(0,f))}const N=()=>{t(5,h=!h)};function R(pe){n.$$.not_equal(f.smtp.tls,pe)&&(f.smtp.tls=pe,t(0,f))}function z(pe){n.$$.not_equal(f.smtp.authMethod,pe)&&(f.smtp.authMethod=pe,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const U=()=>S(),J=()=>_(),Y=()=>a==null?void 0:a.show(),Z=()=>_();function G(pe){ie[pe?"unshift":"push"](()=>{a=pe,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&4096&&t(13,i=JSON.stringify(u)),n.$$.dirty[0]&8193&&t(6,l=i!=JSON.stringify(f))},[f,a,c,d,m,h,l,s,o,r,_,S,u,i,$,T,O,E,L,I,A,P,N,R,z,F,U,J,Y,Z,G]}class CF extends Se{constructor(e){super(),we(this,e,$F,TF,ke,{},null,[-1,-1])}}function OF(n){var L;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function k(I){n[11](I)}function S(I){n[12](I)}function $(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[EF]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new $y({props:T}),ie.push(()=>be(e,"config",k)),ie.push(()=>be(e,"isTesting",S)),ie.push(()=>be(e,"testError",$));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&Nb(n),E=n[6]&&Rb(n);return{c(){j(e.$$.fragment),s=C(),o=b("div"),r=b("div"),a=C(),O&&O.c(),u=C(),E&&E.c(),f=C(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],ee(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),v(I,s,A),v(I,o,A),w(o,r),w(o,a),O&&O.m(o,null),w(o,u),E&&E.m(o,null),w(o,f),w(o,c),w(c,d),h=!0,g||(_=W(c,"click",n[15]),g=!0)},p(I,A){var N;const P={};A&1&&(P.originalConfig=I[0].s3),A&524291&&(P.$$scope={dirty:A,ctx:I}),!t&&A&2&&(t=!0,P.config=I[1].s3,$e(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],$e(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=I[5],$e(()=>l=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?O?O.p(I,A):(O=Nb(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?E?E.p(I,A):(E=Rb(I),E.c(),E.m(o,f)):E&&(E.d(1),E=null),(!h||A&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||A&8)&&ee(c,"btn-loading",I[3])},i(I){h||(M(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(y(s),y(o)),H(e,I),O&&O.d(),E&&E.d(),g=!1,_()}}}function MF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function Pb(n){var A;let e,t,i,l,s,o,r,a=(A=n[0].s3)!=null&&A.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,g,_,k,S,$,T,O,E,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=C(),s=b("div"),o=B(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),u=B(a),f=B(` to the @@ -218,6 +218,6 @@ Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function `),k=b("a"),k.textContent=`rclone `,S=B(`, `),$=b("a"),$.textContent=`s5cmd - `,T=B(", etc."),M=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){v(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,g),w(s,_),w(s,k),w(s,S),w(s,$),w(s,T),w(e,M),w(e,E),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),P&&L&&L.end()}}}function EF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Pb(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),v(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&O(t,1)):(t=Pb(l),t.c(),O(t,1),t.m(e.parentNode,e)):t&&(re(),D(t,1,1,()=>{t=null}),ae())},d(l){l&&y(e),t&&t.d(l)}}}function Nb(n){let e;function t(s,o){return s[4]?LF:s[5]?IF:DF}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function DF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function IF(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function LF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Rb(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&y(e),i=!1,l()}}}function AF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[MF,OF],S=[];function $(T,M){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    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.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){v(T,e,M),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,M),v(T,a,M),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=W(u,"submit",nt(n[16])),g=!0)},p(T,M){(!h||M&128)&&oe(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,M):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,M):(m=S[d]=k[d](T),m.c()),O(m,1),m.m(u,null))},i(T){h||(O(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function PF(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[AF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(O(e.$$.fragment,s),O(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}const NF="s3_test_request";function RF(n,e,t){let i,l,s;Qe(n,un,E=>t(7,s=E)),Rn(un,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await _e.settings.getAll()||{};h(E)}catch(E){_e.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{_e.cancelRequest(NF);const E=await _e.settings.update(V.filterRedactedProps(r));Ut({}),await h(E),Ls(),c?yw("Successfully saved but failed to establish S3 connection."):nn("Successfully saved files storage settings.")}catch(E){_e.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>g(),T=()=>m(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,g,i,_,k,S,$,T,M]}class FF extends Se{constructor(e){super(),we(this,e,RF,PF,ke,{})}}function Fb(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function qF(n){let e,t,i,l=!n[0]&&Fb();const s=n[1].default,o=Lt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){v(r,e,a),l&&l.m(e,null),w(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Fb(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&Pt(o,s,r,r[2],i?At(s,r[2],a,null):Nt(r[2]),null)},i(r){i||(O(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&y(e),l&&l.d(),o&&o.d(r)}}}function HF(n){let e,t;return e=new pi({props:{class:"full-page",center:!0,$$slots:{default:[qF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jF(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class zF extends Se{constructor(e){super(),we(this,e,jF,HF,ke,{nobranding:0})}}function qb(n){let e,t,i,l,s;return{c(){e=B("("),t=B(n[1]),i=B("/"),l=B(n[2]),s=B(")")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p(o,r){r&2&&oe(t,o[1]),r&4&&oe(l,o[2])},d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function UF(n){let e,t,i,l;const s=[YF,WF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),O(t,1),t.m(i.parentNode,i))},i(a){l||(O(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function VF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[GF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[XF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),o=b("button"),r=b("span"),u=B(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),ee(o,"btn-disabled",n[7]),ee(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){v(g,e,_),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=W(e,"submit",nt(n[14])),m=!0)},p(g,_){const k={};_&201326625&&(k.$$scope={dirty:_,ctx:g}),t.$set(k);const S={};_&201326656&&(S.$$scope={dirty:_,ctx:g}),l.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&oe(u,a),(!d||_&128)&&ee(o,"btn-disabled",g[7]),(!d||_&128)&&ee(o,"btn-loading",g[7])},i(g){d||(O(t.$$.fragment,g),O(l.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(l.$$.fragment,g),d=!1},d(g){g&&y(e),H(t),H(l),m=!1,h()}}}function BF(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function WF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g=n[12]&&Hb(n);return i=new fe({props:{class:"form-field required",name:"otpId",$$slots:{default:[KF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[JF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=C(),t=b("form"),j(i.$$.fragment),l=C(),j(s.$$.fragment),o=C(),r=b("button"),r.innerHTML='Login ',a=C(),u=b("div"),f=b("button"),c=B("Request another OTP"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block btn-next"),ee(r,"btn-disabled",n[9]),ee(r,"btn-loading",n[9]),p(t,"class","block"),p(f,"type","button"),p(f,"class","link-hint"),f.disabled=n[9],p(u,"class","content txt-center m-t-sm")},m(_,k){g&&g.m(_,k),v(_,e,k),v(_,t,k),q(i,t,null),w(t,l),q(s,t,null),w(t,o),w(t,r),v(_,a,k),v(_,u,k),w(u,f),w(f,c),d=!0,m||(h=[W(t,"submit",nt(n[16])),W(f,"click",n[22])],m=!0)},p(_,k){_[12]?g?g.p(_,k):(g=Hb(_),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};k&201328656&&(S.$$scope={dirty:k,ctx:_}),i.$set(S);const $={};k&201334784&&($.$$scope={dirty:k,ctx:_}),s.$set($),(!d||k&512)&&ee(r,"btn-disabled",_[9]),(!d||k&512)&&ee(r,"btn-loading",_[9]),(!d||k&512)&&(f.disabled=_[9])},i(_){d||(O(i.$$.fragment,_),O(s.$$.fragment,_),d=!0)},o(_){D(i.$$.fragment,_),D(s.$$.fragment,_),d=!1},d(_){_&&(y(e),y(t),y(a),y(u)),g&&g.d(_),H(i),H(s),m=!1,Ie(h)}}}function YF(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[ZF,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),l=b("button"),l.innerHTML=' Send OTP',p(l,"type","submit"),p(l,"class","btn btn-lg btn-block btn-next"),ee(l,"btn-disabled",n[8]),ee(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=W(e,"submit",nt(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&ee(l,"btn-disabled",a[8]),(!s||u&256)&&ee(l,"btn-loading",a[8])},i(a){s||(O(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),o=!1,r()}}}function Hb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=B("Check your "),l=b("strong"),s=B(n[12]),o=B(` inbox and enter in the input below the received + `,T=B(", etc."),O=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){v(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,g),w(s,_),w(s,k),w(s,S),w(s,$),w(s,T),w(e,O),w(e,E),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),P&&L&&L.end()}}}function EF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Pb(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),v(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&M(t,1)):(t=Pb(l),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(re(),D(t,1,1,()=>{t=null}),ae())},d(l){l&&y(e),t&&t.d(l)}}}function Nb(n){let e;function t(s,o){return s[4]?LF:s[5]?IF:DF}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function DF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function IF(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function LF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Rb(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&y(e),i=!1,l()}}}function AF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[MF,OF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    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.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=W(u,"submit",nt(n[16])),g=!0)},p(T,O){(!h||O&128)&&oe(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function PF(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[AF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}const NF="s3_test_request";function RF(n,e,t){let i,l,s;Qe(n,un,E=>t(7,s=E)),Rn(un,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await _e.settings.getAll()||{};h(E)}catch(E){_e.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{_e.cancelRequest(NF);const E=await _e.settings.update(V.filterRedactedProps(r));Ut({}),await h(E),Ls(),c?yw("Successfully saved but failed to establish S3 connection."):nn("Successfully saved files storage settings.")}catch(E){_e.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,g,i,_,k,S,$,T,O]}class FF extends Se{constructor(e){super(),we(this,e,RF,PF,ke,{})}}function Fb(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function qF(n){let e,t,i,l=!n[0]&&Fb();const s=n[1].default,o=Lt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){v(r,e,a),l&&l.m(e,null),w(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Fb(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&Pt(o,s,r,r[2],i?At(s,r[2],a,null):Nt(r[2]),null)},i(r){i||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&y(e),l&&l.d(),o&&o.d(r)}}}function HF(n){let e,t;return e=new pi({props:{class:"full-page",center:!0,$$slots:{default:[qF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jF(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class zF extends Se{constructor(e){super(),we(this,e,jF,HF,ke,{nobranding:0})}}function qb(n){let e,t,i,l,s;return{c(){e=B("("),t=B(n[1]),i=B("/"),l=B(n[2]),s=B(")")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p(o,r){r&2&&oe(t,o[1]),r&4&&oe(l,o[2])},d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function UF(n){let e,t,i,l;const s=[YF,WF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function VF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[GF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[XF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),o=b("button"),r=b("span"),u=B(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),ee(o,"btn-disabled",n[7]),ee(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){v(g,e,_),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=W(e,"submit",nt(n[14])),m=!0)},p(g,_){const k={};_&201326625&&(k.$$scope={dirty:_,ctx:g}),t.$set(k);const S={};_&201326656&&(S.$$scope={dirty:_,ctx:g}),l.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&oe(u,a),(!d||_&128)&&ee(o,"btn-disabled",g[7]),(!d||_&128)&&ee(o,"btn-loading",g[7])},i(g){d||(M(t.$$.fragment,g),M(l.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(l.$$.fragment,g),d=!1},d(g){g&&y(e),H(t),H(l),m=!1,h()}}}function BF(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function WF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g=n[12]&&Hb(n);return i=new fe({props:{class:"form-field required",name:"otpId",$$slots:{default:[KF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[JF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=C(),t=b("form"),j(i.$$.fragment),l=C(),j(s.$$.fragment),o=C(),r=b("button"),r.innerHTML='Login ',a=C(),u=b("div"),f=b("button"),c=B("Request another OTP"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block btn-next"),ee(r,"btn-disabled",n[9]),ee(r,"btn-loading",n[9]),p(t,"class","block"),p(f,"type","button"),p(f,"class","link-hint"),f.disabled=n[9],p(u,"class","content txt-center m-t-sm")},m(_,k){g&&g.m(_,k),v(_,e,k),v(_,t,k),q(i,t,null),w(t,l),q(s,t,null),w(t,o),w(t,r),v(_,a,k),v(_,u,k),w(u,f),w(f,c),d=!0,m||(h=[W(t,"submit",nt(n[16])),W(f,"click",n[22])],m=!0)},p(_,k){_[12]?g?g.p(_,k):(g=Hb(_),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};k&201328656&&(S.$$scope={dirty:k,ctx:_}),i.$set(S);const $={};k&201334784&&($.$$scope={dirty:k,ctx:_}),s.$set($),(!d||k&512)&&ee(r,"btn-disabled",_[9]),(!d||k&512)&&ee(r,"btn-loading",_[9]),(!d||k&512)&&(f.disabled=_[9])},i(_){d||(M(i.$$.fragment,_),M(s.$$.fragment,_),d=!0)},o(_){D(i.$$.fragment,_),D(s.$$.fragment,_),d=!1},d(_){_&&(y(e),y(t),y(a),y(u)),g&&g.d(_),H(i),H(s),m=!1,Ie(h)}}}function YF(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[ZF,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),l=b("button"),l.innerHTML=' Send OTP',p(l,"type","submit"),p(l,"class","btn btn-lg btn-block btn-next"),ee(l,"btn-disabled",n[8]),ee(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=W(e,"submit",nt(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&ee(l,"btn-disabled",a[8]),(!s||u&256)&&ee(l,"btn-loading",a[8])},i(a){s||(M(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),o=!1,r()}}}function Hb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=B("Check your "),l=b("strong"),s=B(n[12]),o=B(` inbox and enter in the input below the received One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&4096&&oe(s,r[12])},d(r){r&&y(e)}}}function KF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Id"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","text"),p(s,"id",o=n[26]),s.value=n[4],p(s,"placeholder",n[11]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),r||(a=W(s,"change",n[20]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&16&&s.value!==u[4]&&(s.value=u[4]),f&2048&&p(s,"placeholder",u[11])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function JF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("One-time password"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,s.autofocus=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[13]),s.focus(),r||(a=W(s,"input",n[21]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&8192&&s.value!==u[13]&&he(s,u[13])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function ZF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Email"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","email"),p(s,"id",o=n[26]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[12]),r||(a=W(s,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&4096&&s.value!==u[12]&&he(s,u[12])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function GF(n){let e,t=V.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=B(t),s=C(),o=b("input"),p(e,"for",l=n[26]),p(o,"id",r=n[26]),p(o,"type",a=n[0].password.identityFields.length==1&&n[0].password.identityFields[0]=="email"?"email":"text"),o.value=n[5],o.required=!0,o.autofocus=!0},m(c,d){v(c,e,d),w(e,i),v(c,s,d),v(c,o,d),o.focus(),u||(f=W(o,"input",n[17]),u=!0)},p(c,d){d&1&&t!==(t=V.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&oe(i,t),d&67108864&&l!==(l=c[26])&&p(e,"for",l),d&67108864&&r!==(r=c[26])&&p(o,"id",r),d&1&&a!==(a=c[0].password.identityFields.length==1&&c[0].password.identityFields[0]=="email"?"email":"text")&&p(o,"type",a),d&32&&o.value!==c[5]&&(o.value=c[5])},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function XF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Password"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[6]),v(d,r,m),v(d,a,m),w(a,u),f||(c=[W(s,"input",n[18]),Oe(Bn.call(null,u))],f=!0)},p(d,m){m&67108864&&i!==(i=d[26])&&p(e,"for",i),m&67108864&&o!==(o=d[26])&&p(s,"id",o),m&64&&s.value!==d[6]&&he(s,d[6])},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),f=!1,Ie(c)}}}function QF(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&qb(n);const f=[BF,VF,UF],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=B(`Superuser login - `),u&&u.c(),l=C(),o&&o.c(),r=ye(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=qb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),O(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(O(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(y(e),y(l),y(r)),u&&u.d(),~s&&c[s].d(m)}}}function xF(n){let e,t;return e=new zF({props:{$$slots:{default:[QF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(O(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eq(n,e,t){let i;Qe(n,Au,z=>t(23,i=z));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(U){U.status==401?(t(3,h=U.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await M()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):U.status!=400?_e.error(U):Ci("Invalid login credentials.")}t(7,f=!1)}}async function M(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,M,E,L,I,A,P,N,R]}class tq extends Se{constructor(e){super(),we(this,e,eq,xF,ke,{})}}function Zt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;tTt(()=>import("./PageInstaller-Bqy1Pxsp.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:tq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-C6l2tAoS.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-DyqJmTiD.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:jN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:M6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:H7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:CF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:FF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:jR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:oF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:LR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-D3SGAiQ4.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-D3SGAiQ4.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-CO9r4-wZ.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-CO9r4-wZ.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-BEWFj7Qa.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-BEWFj7Qa.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-CoFUeL82.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-acTrdeCH.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:l3,userData:{showAppSidebar:!1}})};function iq(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function jb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,g,_,k,S,$,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lq]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=B(m),g=C(),j(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(M,E){v(M,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,$||(T=[Oe(Bn.call(null,t)),Oe(Bn.call(null,s)),Oe(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Oe(qe.call(null,s,{text:"Collections",position:"right"})),Oe(Bn.call(null,r)),Oe(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(qe.call(null,r,{text:"Logs",position:"right"})),Oe(Bn.call(null,u)),Oe(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(qe.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(M,E){(!S||E&1)&&m!==(m=V.getInitials(M[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:M}),_.$set(L),(!S||E&1&&k!==(k=M[0].email))&&p(c,"title",k)},i(M){S||(O(_.$$.fragment,M),S=!0)},o(M){D(_.$$.fragment,M),S=!1},d(M){M&&y(e),H(_),$=!1,Ie(T)}}}function lq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=B(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Oe(Bn.call(null,a)),W(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(y(e),y(s),y(o),y(r),y(a),y(u),y(f)),c=!1,Ie(d)}}}function zb(n){let e,t,i;return t=new Cu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(O(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function sq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&iq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&jb(n);r=new xw({props:{routes:nq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Ow({}),c=new dw({});let k=n[1]&&!n[2]&&zb(n);return{c(){g&&g.c(),t=ye(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ye(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){g&&g.m(document.head,null),w(document.head,t),v($,i,T),v($,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v($,f,T),q(c,$,T),v($,d,T),k&&k.m($,T),v($,m,T),h=!0},p($,[T]){var M;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(M=$[0])!=null&&M.id&&$[1]?_?(_.p($,T),T&3&&O(_,1)):(_=jb($),_.c(),O(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),$[1]&&!$[2]?k?(k.p($,T),T&6&&O(k,1)):(k=zb($),k.c(),O(k,1),k.m(m.parentNode,m)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i($){h||(O(_),O(r.$$.fragment,$),O(u.$$.fragment,$),O(c.$$.fragment,$),O(k),h=!0)},o($){D(_),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(y(i),y(l),y(f),y(d),y(m)),g&&g.d($),y(t),_&&_.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function oq(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,k,S,$;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,Rn(un,o="",o),Ut({}),lk())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const k=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",l),Rn(Dl,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){_e.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class rq extends Se{constructor(e){super(),we(this,e,oq,sq,ke,{})}}new rq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Oe as C,Bn as D,re as E,zF as F,ae as G,oe as H,te as I,V as J,nn as K,ye as L,co as M,Fr as N,Qe as O,Rn as P,Xt as Q,un as R,Se as S,Mn as T,kt as U,EP as V,xu as W,de as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,Hy as a1,Ci as b,j as c,H as d,dn as e,fe as f,xl as g,b as h,we as i,C as j,p as k,ee as l,q as m,v as n,w as o,_e as p,W as q,is as r,ke as s,O as t,nt as u,y as v,Ie as w,_n as x,ie as y,B as z}; + `),u&&u.c(),l=C(),o&&o.c(),r=ye(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=qb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(y(e),y(l),y(r)),u&&u.d(),~s&&c[s].d(m)}}}function xF(n){let e,t;return e=new zF({props:{$$slots:{default:[QF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eq(n,e,t){let i;Qe(n,Au,z=>t(23,i=z));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(U){U.status==401?(t(3,h=U.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):U.status!=400?_e.error(U):Ci("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,O,E,L,I,A,P,N,R]}class tq extends Se{constructor(e){super(),we(this,e,eq,xF,ke,{})}}function Zt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;tTt(()=>import("./PageInstaller-BoVX3p9e.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:tq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-hkDUY4aR.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-BcotKF-n.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:jN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:M6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:H7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:CF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:FF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:jR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:oF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:LR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-K2sQyrEp.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-K2sQyrEp.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-BncDRzrb.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-BncDRzrb.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DObT4JXT.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DObT4JXT.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-QlMkpX15.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-CiWjdUmU.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:l3,userData:{showAppSidebar:!1}})};function iq(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function jb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,g,_,k,S,$,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lq]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=B(m),g=C(),j(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){v(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,$||(T=[Oe(Bn.call(null,t)),Oe(Bn.call(null,s)),Oe(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Oe(qe.call(null,s,{text:"Collections",position:"right"})),Oe(Bn.call(null,r)),Oe(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(qe.call(null,r,{text:"Logs",position:"right"})),Oe(Bn.call(null,u)),Oe(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(qe.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=V.getInitials(O[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&y(e),H(_),$=!1,Ie(T)}}}function lq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=B(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Oe(Bn.call(null,a)),W(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(y(e),y(s),y(o),y(r),y(a),y(u),y(f)),c=!1,Ie(d)}}}function zb(n){let e,t,i;return t=new Cu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function sq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&iq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&jb(n);r=new xw({props:{routes:nq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Ow({}),c=new dw({});let k=n[1]&&!n[2]&&zb(n);return{c(){g&&g.c(),t=ye(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ye(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){g&&g.m(document.head,null),w(document.head,t),v($,i,T),v($,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v($,f,T),q(c,$,T),v($,d,T),k&&k.m($,T),v($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?_?(_.p($,T),T&3&&M(_,1)):(_=jb($),_.c(),M(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=zb($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i($){h||(M(_),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),h=!0)},o($){D(_),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(y(i),y(l),y(f),y(d),y(m)),g&&g.d($),y(t),_&&_.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function oq(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,k,S,$;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,Rn(un,o="",o),Ut({}),lk())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const k=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",l),Rn(Dl,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){_e.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class rq extends Se{constructor(e){super(),we(this,e,oq,sq,ke,{})}}new rq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Oe as C,Bn as D,re as E,zF as F,ae as G,oe as H,te as I,V as J,nn as K,ye as L,co as M,Fr as N,Qe as O,Rn as P,Xt as Q,un as R,Se as S,Mn as T,kt as U,EP as V,xu as W,de as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,Hy as a1,Ci as b,j as c,H as d,dn as e,fe as f,xl as g,b as h,we as i,C as j,p as k,ee as l,q as m,v as n,w as o,_e as p,W as q,is as r,ke as s,M as t,nt as u,y as v,Ie as w,_n as x,ie as y,B as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index f9c3edca..54c49b0b 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -37,7 +37,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/src/components/collections/schema/SchemaFieldText.svelte b/ui/src/components/collections/schema/SchemaFieldText.svelte index a48c5585..113fd357 100644 --- a/ui/src/components/collections/schema/SchemaFieldText.svelte +++ b/ui/src/components/collections/schema/SchemaFieldText.svelte @@ -63,7 +63,7 @@
    - +
    ',p(e,"class","list-item")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function rP(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[25]),ee(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Oe(qe.call(null,o,"Remove")),W(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&ee(e,"dragging",n[25]),(!a||m&67108864)&&ee(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(y(e),y(r)),H(i),u=!1,Ie(f)}}}function Lg(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[rP,({dragging:a,dragover:u})=>({25:a,26:u}),({dragging:a,dragover:u})=>(a?33554432:0)|(u?67108864:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function aP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ii({props:{uniqueId:n[21],field:n[2],$$slots:{default:[oP]},$$scope:{ctx:n}}});let m=de(n[4]);const h=_=>_[22].id;for(let _=0;_ Open picker',p(l,"class","relations-list svelte-1ynw0pc"),p(u,"type","button"),p(u,"class","btn btn-transparent btn-sm btn-block"),p(a,"class","list-item list-item-btn"),p(i,"class","list")},m(_,k){q(e,_,k),v(_,t,k),v(_,i,k),w(i,l);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new sP({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&1075839223&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&y(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Ag=100;function fP(n,e,t){let i,l;Qe(n,Mn,I=>t(18,l=I));let{field:s}=e,{value:o}=e,{picker:r}=e,a,u=[],f=!1,c,d=[];function m(){if(f)return!1;const I=V.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var z,F;const I=V.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(U=>U.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(U=>!U.hidden&&U.presentable&&U.type=="relation");for(const U of P){const J=V.getExpandPresentableRelField(U,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=I.slice(),R=[];for(;N.length>0;){const U=[];for(const J of N.splice(0,Ag))U.push(`id="${J}"`);R.push(_e.collection(s.collectionId).getFullList(Ag,{filter:U.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let U=[];await Promise.all(R).then(J=>{U=U.concat(...J)});for(const J of I){const Y=V.findByKey(U,"id",J);Y?u.push(Y):d.push(J)}t(4,u),_()}catch(U){_e.error(U)}t(5,f=!1)}function g(I){V.removeByKey(u,"id",I.id),t(4,u),_()}function _(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}oo(()=>{clearTimeout(c)});const k=I=>g(I);function S(I){u=I,t(4,u)}const $=()=>{_()},T=()=>r==null?void 0:r.show();function O(I){ie[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(I){ie[I?"unshift":"push"](()=>{r=I,t(1,r)})}const L=I=>{var A;t(4,u=I.detail||[]),t(0,o=i?u.map(P=>P.id):((A=u[0])==null?void 0:A.id)||"")};return n.$$set=I=>{"field"in I&&t(2,s=I.field),"value"in I&&t(0,o=I.value),"picker"in I&&t(1,r=I.picker)},n.$$.update=()=>{n.$$.dirty&4&&t(7,i=s.maxSelect>1),n.$$.dirty&9&&typeof o<"u"&&(a==null||a.changed()),n.$$.dirty&1041&&m()&&(t(5,f=!0),clearTimeout(c),t(10,c=setTimeout(h,0)))},[o,r,s,a,u,f,d,i,g,_,c,k,S,$,T,O,E,L]}class cP extends Se{constructor(e){super(),we(this,e,fP,uP,ke,{field:2,value:0,picker:1})}}function Pg(n){let e,t,i,l;return{c(){e=b("div"),t=B("Select up to "),i=B(n[2]),l=B(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&oe(i,s[2])},d(s){s&&y(e)}}}function dP(n){var c,d;let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[5],field:n[1]}});function a(m){n[4](m)}let u={id:n[5],toggle:!n[1].required||n[3],multiple:n[3],closable:!n[3]||((c=n[0])==null?void 0:c.length)>=n[1].maxSelect,items:n[1].values,searchable:((d=n[1].values)==null?void 0:d.length)>5};n[0]!==void 0&&(u.selected=n[0]),i=new ps({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Pg(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),s=C(),f&&f.c(),o=ye()},m(m,h){q(e,m,h),v(m,t,h),q(i,m,h),v(m,s,h),f&&f.m(m,h),v(m,o,h),r=!0},p(m,h){var k,S;const g={};h&32&&(g.uniqueId=m[5]),h&2&&(g.field=m[1]),e.$set(g);const _={};h&32&&(_.id=m[5]),h&10&&(_.toggle=!m[1].required||m[3]),h&8&&(_.multiple=m[3]),h&11&&(_.closable=!m[3]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),h&2&&(_.items=m[1].values),h&2&&(_.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,_.selected=m[0],$e(()=>l=!1)),i.$set(_),m[3]?f?f.p(m,h):(f=Pg(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(M(e.$$.fragment,m),M(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(y(t),y(s),y(o)),H(e,m),H(i,m),f&&f.d(m)}}}function pP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mP(n,e,t){let i,l,{field:s}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,s),t(2,l)}return n.$$set=a=>{"field"in a&&t(1,s=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=s.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,l=s.maxSelect||s.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>s.values.includes(a))),o.length>l&&t(0,o=o.slice(o.length-l)))},[o,s,l,i,r]}class hP extends Se{constructor(e){super(),we(this,e,mP,pP,ke,{field:1,value:0})}}function _P(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Xt(()=>(u(),()=>clearTimeout(a)));function c(m){ie[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(3,l=lt(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class bP extends Se{constructor(e){super(),we(this,e,gP,_P,ke,{value:0,maxHeight:4})}}function kP(n){let e,t,i,l,s;e=new ii({props:{uniqueId:n[6],field:n[1]}});function o(a){n[5](a)}let r={id:n[6],required:n[3],placeholder:n[2]?"Leave empty to autogenerate...":""};return n[0]!==void 0&&(r.value=n[0]),i=new bP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],$e(()=>l=!1)),i.$set(c)},i(a){s||(M(e.$$.fragment,a),M(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(e,a),H(i,a)}}}function yP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[kP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function vP(n,e,t){let i,l,{original:s}=e,{field:o}=e,{value:r=void 0}=e;function a(u){r=u,t(0,r)}return n.$$set=u=>{"original"in u&&t(4,s=u.original),"field"in u&&t(1,o=u.field),"value"in u&&t(0,r=u.value)},n.$$.update=()=>{n.$$.dirty&18&&t(2,i=!V.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class wP extends Se{constructor(e){super(),we(this,e,vP,yP,ke,{original:4,field:1,value:0})}}function SP(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function TP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $P(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class CP extends Se{constructor(e){super(),we(this,e,$P,TP,ke,{field:1,value:0})}}function Ng(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=B(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(f,c){v(f,t,c),w(t,i),w(i,s),w(t,o),r||(a=W(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&oe(s,l),c&6&&ee(t,"active",e[1]===e[6].language)},d(f){f&&y(t),r=!1,a()}}}function qg(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new xu({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=B(a),f=B(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(s,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,g){e=h;const _={};g&4&&(_.language=e[6].language),g&4&&(_.content=e[6].content),i.$set(_),(!m||g&4)&&a!==(a=e[6].title+"")&&oe(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&ee(t,"active",e[1]===e[6].language)},i(h){m||(M(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&y(t),H(i)}}}function OP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=de(n[2]);const d=g=>g[6].language;for(let g=0;gg[6].language;for(let g=0;gt(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,l=u.class),"js"in u&&t(3,s=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(Hg,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:s,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[l,r,i,s,o,a]}class EP extends Se{constructor(e){super(),we(this,e,MP,OP,ke,{class:0,js:3,dart:4})}}function DP(n){let e,t,i,l,s,o=V.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[LP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=B(`Generate a non-refreshable auth token for `),s=b("strong"),r=B(o),a=B(":"),u=C(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=W(e,"submit",nt(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=V.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&y(e),H(f),d=!1,m()}}}function IP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new $i({props:{value:n[3].authStore.token}}),u=new EP({props:{class:"m-b-0",js:` import PocketBase from 'pocketbase'; @@ -220,4 +220,4 @@ Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function `),$=b("a"),$.textContent=`s5cmd `,T=B(", etc."),O=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){v(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,g),w(s,_),w(s,k),w(s,S),w(s,$),w(s,T),w(e,O),w(e,E),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),P&&L&&L.end()}}}function EF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Pb(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),v(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&M(t,1)):(t=Pb(l),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(re(),D(t,1,1,()=>{t=null}),ae())},d(l){l&&y(e),t&&t.d(l)}}}function Nb(n){let e;function t(s,o){return s[4]?LF:s[5]?IF:DF}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(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&&y(e),l.d(s)}}}function DF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function IF(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function LF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Rb(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&y(e),i=!1,l()}}}function AF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[MF,OF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    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.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=W(u,"submit",nt(n[16])),g=!0)},p(T,O){(!h||O&128)&&oe(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function PF(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[AF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}const NF="s3_test_request";function RF(n,e,t){let i,l,s;Qe(n,un,E=>t(7,s=E)),Rn(un,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await _e.settings.getAll()||{};h(E)}catch(E){_e.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{_e.cancelRequest(NF);const E=await _e.settings.update(V.filterRedactedProps(r));Ut({}),await h(E),Ls(),c?yw("Successfully saved but failed to establish S3 connection."):nn("Successfully saved files storage settings.")}catch(E){_e.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,g,i,_,k,S,$,T,O]}class FF extends Se{constructor(e){super(),we(this,e,RF,PF,ke,{})}}function Fb(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function qF(n){let e,t,i,l=!n[0]&&Fb();const s=n[1].default,o=Lt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){v(r,e,a),l&&l.m(e,null),w(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Fb(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&Pt(o,s,r,r[2],i?At(s,r[2],a,null):Nt(r[2]),null)},i(r){i||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&y(e),l&&l.d(),o&&o.d(r)}}}function HF(n){let e,t;return e=new pi({props:{class:"full-page",center:!0,$$slots:{default:[qF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jF(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class zF extends Se{constructor(e){super(),we(this,e,jF,HF,ke,{nobranding:0})}}function qb(n){let e,t,i,l,s;return{c(){e=B("("),t=B(n[1]),i=B("/"),l=B(n[2]),s=B(")")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p(o,r){r&2&&oe(t,o[1]),r&4&&oe(l,o[2])},d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function UF(n){let e,t,i,l;const s=[YF,WF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function VF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[GF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[XF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),o=b("button"),r=b("span"),u=B(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),ee(o,"btn-disabled",n[7]),ee(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){v(g,e,_),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=W(e,"submit",nt(n[14])),m=!0)},p(g,_){const k={};_&201326625&&(k.$$scope={dirty:_,ctx:g}),t.$set(k);const S={};_&201326656&&(S.$$scope={dirty:_,ctx:g}),l.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&oe(u,a),(!d||_&128)&&ee(o,"btn-disabled",g[7]),(!d||_&128)&&ee(o,"btn-loading",g[7])},i(g){d||(M(t.$$.fragment,g),M(l.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(l.$$.fragment,g),d=!1},d(g){g&&y(e),H(t),H(l),m=!1,h()}}}function BF(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function WF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g=n[12]&&Hb(n);return i=new fe({props:{class:"form-field required",name:"otpId",$$slots:{default:[KF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[JF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=C(),t=b("form"),j(i.$$.fragment),l=C(),j(s.$$.fragment),o=C(),r=b("button"),r.innerHTML='Login ',a=C(),u=b("div"),f=b("button"),c=B("Request another OTP"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block btn-next"),ee(r,"btn-disabled",n[9]),ee(r,"btn-loading",n[9]),p(t,"class","block"),p(f,"type","button"),p(f,"class","link-hint"),f.disabled=n[9],p(u,"class","content txt-center m-t-sm")},m(_,k){g&&g.m(_,k),v(_,e,k),v(_,t,k),q(i,t,null),w(t,l),q(s,t,null),w(t,o),w(t,r),v(_,a,k),v(_,u,k),w(u,f),w(f,c),d=!0,m||(h=[W(t,"submit",nt(n[16])),W(f,"click",n[22])],m=!0)},p(_,k){_[12]?g?g.p(_,k):(g=Hb(_),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};k&201328656&&(S.$$scope={dirty:k,ctx:_}),i.$set(S);const $={};k&201334784&&($.$$scope={dirty:k,ctx:_}),s.$set($),(!d||k&512)&&ee(r,"btn-disabled",_[9]),(!d||k&512)&&ee(r,"btn-loading",_[9]),(!d||k&512)&&(f.disabled=_[9])},i(_){d||(M(i.$$.fragment,_),M(s.$$.fragment,_),d=!0)},o(_){D(i.$$.fragment,_),D(s.$$.fragment,_),d=!1},d(_){_&&(y(e),y(t),y(a),y(u)),g&&g.d(_),H(i),H(s),m=!1,Ie(h)}}}function YF(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[ZF,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),l=b("button"),l.innerHTML=' Send OTP',p(l,"type","submit"),p(l,"class","btn btn-lg btn-block btn-next"),ee(l,"btn-disabled",n[8]),ee(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=W(e,"submit",nt(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&ee(l,"btn-disabled",a[8]),(!s||u&256)&&ee(l,"btn-loading",a[8])},i(a){s||(M(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),o=!1,r()}}}function Hb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=B("Check your "),l=b("strong"),s=B(n[12]),o=B(` inbox and enter in the input below the received One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&4096&&oe(s,r[12])},d(r){r&&y(e)}}}function KF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Id"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","text"),p(s,"id",o=n[26]),s.value=n[4],p(s,"placeholder",n[11]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),r||(a=W(s,"change",n[20]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&16&&s.value!==u[4]&&(s.value=u[4]),f&2048&&p(s,"placeholder",u[11])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function JF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("One-time password"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,s.autofocus=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[13]),s.focus(),r||(a=W(s,"input",n[21]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&8192&&s.value!==u[13]&&he(s,u[13])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function ZF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Email"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","email"),p(s,"id",o=n[26]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[12]),r||(a=W(s,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&4096&&s.value!==u[12]&&he(s,u[12])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function GF(n){let e,t=V.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=B(t),s=C(),o=b("input"),p(e,"for",l=n[26]),p(o,"id",r=n[26]),p(o,"type",a=n[0].password.identityFields.length==1&&n[0].password.identityFields[0]=="email"?"email":"text"),o.value=n[5],o.required=!0,o.autofocus=!0},m(c,d){v(c,e,d),w(e,i),v(c,s,d),v(c,o,d),o.focus(),u||(f=W(o,"input",n[17]),u=!0)},p(c,d){d&1&&t!==(t=V.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&oe(i,t),d&67108864&&l!==(l=c[26])&&p(e,"for",l),d&67108864&&r!==(r=c[26])&&p(o,"id",r),d&1&&a!==(a=c[0].password.identityFields.length==1&&c[0].password.identityFields[0]=="email"?"email":"text")&&p(o,"type",a),d&32&&o.value!==c[5]&&(o.value=c[5])},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function XF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Password"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[6]),v(d,r,m),v(d,a,m),w(a,u),f||(c=[W(s,"input",n[18]),Oe(Bn.call(null,u))],f=!0)},p(d,m){m&67108864&&i!==(i=d[26])&&p(e,"for",i),m&67108864&&o!==(o=d[26])&&p(s,"id",o),m&64&&s.value!==d[6]&&he(s,d[6])},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),f=!1,Ie(c)}}}function QF(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&qb(n);const f=[BF,VF,UF],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=B(`Superuser login - `),u&&u.c(),l=C(),o&&o.c(),r=ye(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=qb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(y(e),y(l),y(r)),u&&u.d(),~s&&c[s].d(m)}}}function xF(n){let e,t;return e=new zF({props:{$$slots:{default:[QF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eq(n,e,t){let i;Qe(n,Au,z=>t(23,i=z));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(U){U.status==401?(t(3,h=U.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):U.status!=400?_e.error(U):Ci("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,O,E,L,I,A,P,N,R]}class tq extends Se{constructor(e){super(),we(this,e,eq,xF,ke,{})}}function Zt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;tTt(()=>import("./PageInstaller-BoVX3p9e.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:tq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-hkDUY4aR.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-BcotKF-n.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:jN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:M6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:H7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:CF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:FF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:jR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:oF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:LR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-K2sQyrEp.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-K2sQyrEp.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-BncDRzrb.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-BncDRzrb.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DObT4JXT.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DObT4JXT.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-QlMkpX15.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-CiWjdUmU.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:l3,userData:{showAppSidebar:!1}})};function iq(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function jb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,g,_,k,S,$,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lq]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=B(m),g=C(),j(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){v(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,$||(T=[Oe(Bn.call(null,t)),Oe(Bn.call(null,s)),Oe(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Oe(qe.call(null,s,{text:"Collections",position:"right"})),Oe(Bn.call(null,r)),Oe(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(qe.call(null,r,{text:"Logs",position:"right"})),Oe(Bn.call(null,u)),Oe(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(qe.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=V.getInitials(O[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&y(e),H(_),$=!1,Ie(T)}}}function lq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=B(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Oe(Bn.call(null,a)),W(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(y(e),y(s),y(o),y(r),y(a),y(u),y(f)),c=!1,Ie(d)}}}function zb(n){let e,t,i;return t=new Cu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function sq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&iq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&jb(n);r=new xw({props:{routes:nq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Ow({}),c=new dw({});let k=n[1]&&!n[2]&&zb(n);return{c(){g&&g.c(),t=ye(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ye(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){g&&g.m(document.head,null),w(document.head,t),v($,i,T),v($,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v($,f,T),q(c,$,T),v($,d,T),k&&k.m($,T),v($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?_?(_.p($,T),T&3&&M(_,1)):(_=jb($),_.c(),M(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=zb($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i($){h||(M(_),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),h=!0)},o($){D(_),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(y(i),y(l),y(f),y(d),y(m)),g&&g.d($),y(t),_&&_.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function oq(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,k,S,$;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,Rn(un,o="",o),Ut({}),lk())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const k=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",l),Rn(Dl,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){_e.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class rq extends Se{constructor(e){super(),we(this,e,oq,sq,ke,{})}}new rq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Oe as C,Bn as D,re as E,zF as F,ae as G,oe as H,te as I,V as J,nn as K,ye as L,co as M,Fr as N,Qe as O,Rn as P,Xt as Q,un as R,Se as S,Mn as T,kt as U,EP as V,xu as W,de as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,Hy as a1,Ci as b,j as c,H as d,dn as e,fe as f,xl as g,b as h,we as i,C as j,p as k,ee as l,q as m,v as n,w as o,_e as p,W as q,is as r,ke as s,M as t,nt as u,y as v,Ie as w,_n as x,ie as y,B as z}; + `),u&&u.c(),l=C(),o&&o.c(),r=ye(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=qb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(y(e),y(l),y(r)),u&&u.d(),~s&&c[s].d(m)}}}function xF(n){let e,t;return e=new zF({props:{$$slots:{default:[QF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eq(n,e,t){let i;Qe(n,Au,z=>t(23,i=z));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(U){U.status==401?(t(3,h=U.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):U.status!=400?_e.error(U):Ci("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,O,E,L,I,A,P,N,R]}class tq extends Se{constructor(e){super(),we(this,e,eq,xF,ke,{})}}function Zt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;tTt(()=>import("./PageInstaller-D5HMwEud.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:tq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-B5ZwBpgB.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-BPIzHt0w.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:jN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:M6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:H7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:CF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:FF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:jR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:oF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:LR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-CnSykTm3.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-CnSykTm3.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-n88V877X.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-n88V877X.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DihJcGvl.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DihJcGvl.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-D2lAk--2.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-SVWhXddW.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:l3,userData:{showAppSidebar:!1}})};function iq(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function jb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,g,_,k,S,$,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lq]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=B(m),g=C(),j(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){v(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,$||(T=[Oe(Bn.call(null,t)),Oe(Bn.call(null,s)),Oe(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Oe(qe.call(null,s,{text:"Collections",position:"right"})),Oe(Bn.call(null,r)),Oe(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(qe.call(null,r,{text:"Logs",position:"right"})),Oe(Bn.call(null,u)),Oe(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(qe.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=V.getInitials(O[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&y(e),H(_),$=!1,Ie(T)}}}function lq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=B(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Oe(Bn.call(null,a)),W(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(y(e),y(s),y(o),y(r),y(a),y(u),y(f)),c=!1,Ie(d)}}}function zb(n){let e,t,i;return t=new Cu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function sq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&iq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&jb(n);r=new xw({props:{routes:nq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Ow({}),c=new dw({});let k=n[1]&&!n[2]&&zb(n);return{c(){g&&g.c(),t=ye(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ye(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){g&&g.m(document.head,null),w(document.head,t),v($,i,T),v($,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v($,f,T),q(c,$,T),v($,d,T),k&&k.m($,T),v($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?_?(_.p($,T),T&3&&M(_,1)):(_=jb($),_.c(),M(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=zb($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i($){h||(M(_),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),h=!0)},o($){D(_),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(y(i),y(l),y(f),y(d),y(m)),g&&g.d($),y(t),_&&_.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function oq(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,k,S,$;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,Rn(un,o="",o),Ut({}),lk())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const k=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",l),Rn(Dl,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){_e.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class rq extends Se{constructor(e){super(),we(this,e,oq,sq,ke,{})}}new rq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Oe as C,Bn as D,re as E,zF as F,ae as G,oe as H,te as I,V as J,nn as K,ye as L,co as M,Fr as N,Qe as O,Rn as P,Xt as Q,un as R,Se as S,Mn as T,kt as U,EP as V,xu as W,de as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,Hy as a1,Ci as b,j as c,H as d,dn as e,fe as f,xl as g,b as h,we as i,C as j,p as k,ee as l,q as m,v as n,w as o,_e as p,W as q,is as r,ke as s,M as t,nt as u,y as v,Ie as w,_n as x,ie as y,B as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 54c49b0b..53d8d9fd 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -37,7 +37,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + From 4f35fb74c8d06d46e6c5189b5983b4039f317515 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Wed, 11 Dec 2024 19:00:45 +0200 Subject: [PATCH 3/3] updated jsvm types --- .../jsvm/internal/types/generated/types.d.ts | 10066 ++++++++-------- 1 file changed, 5040 insertions(+), 5026 deletions(-) diff --git a/plugins/jsvm/internal/types/generated/types.d.ts b/plugins/jsvm/internal/types/generated/types.d.ts index 2cd3aad4..7105abdd 100644 --- a/plugins/jsvm/internal/types/generated/types.d.ts +++ b/plugins/jsvm/internal/types/generated/types.d.ts @@ -1,4 +1,4 @@ -// 1733711392 +// 1733936347 // GENERATED CODE - DO NOT MODIFY BY HAND // ------------------------------------------------------------------- @@ -1722,8 +1722,8 @@ namespace os { * than ReadFrom. This is used to permit ReadFrom to call io.Copy * without leading to a recursive call to ReadFrom. */ - type _subsTHwE = noReadFrom&File - interface fileWithoutReadFrom extends _subsTHwE { + type _subUOJts = noReadFrom&File + interface fileWithoutReadFrom extends _subUOJts { } interface File { /** @@ -1767,8 +1767,8 @@ namespace os { * than WriteTo. This is used to permit WriteTo to call io.Copy * without leading to a recursive call to WriteTo. */ - type _subBqoCR = noWriteTo&File - interface fileWithoutWriteTo extends _subBqoCR { + type _subJsJgz = noWriteTo&File + interface fileWithoutWriteTo extends _subJsJgz { } interface File { /** @@ -2412,8 +2412,8 @@ namespace os { * * The methods of File are safe for concurrent use. */ - type _subYXZJo = file - interface File extends _subYXZJo { + type _subrHhsS = file + interface File extends _subrHhsS { } /** * A FileInfo describes a file and is returned by [Stat] and [Lstat]. @@ -2805,6 +2805,132 @@ namespace filepath { } } +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the [path/filepath] package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + * + * # Executables in the current directory + * + * The functions [Command] and [LookPath] look for a program + * in the directories listed in the current path, following the + * conventions of the host operating system. + * Operating systems have for decades included the current + * directory in this search, sometimes implicitly and sometimes + * configured explicitly that way by default. + * Modern practice is that including the current directory + * is usually unexpected and often leads to security problems. + * + * To avoid those security problems, as of Go 1.19, this package will not resolve a program + * using an implicit or explicit path entry relative to the current directory. + * That is, if you run [LookPath]("go"), it will not successfully return + * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. + * Instead, if the usual path algorithms would result in that answer, + * these functions return an error err satisfying [errors.Is](err, [ErrDot]). + * + * For example, consider these two program snippets: + * + * ``` + * path, err := exec.LookPath("prog") + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * These will not find and run ./prog or .\prog.exe, + * no matter how the current path is configured. + * + * Code that always wants to run a program from the current directory + * can be rewritten to say "./prog" instead of "prog". + * + * Code that insists on including results from relative path entries + * can instead override the error using an errors.Is check: + * + * ``` + * path, err := exec.LookPath("prog") + * if errors.Is(err, exec.ErrDot) { + * err = nil + * } + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if errors.Is(cmd.Err, exec.ErrDot) { + * cmd.Err = nil + * } + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * Setting the environment variable GODEBUG=execerrdot=0 + * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 + * behavior for programs that are unable to apply more targeted fixes. + * A future version of Go may remove support for this variable. + * + * Before adding such overrides, make sure you understand the + * security implications of doing so. + * See https://go.dev/blog/path-security for more information. + */ +namespace exec { + interface command { + /** + * Command returns the [Cmd] struct to execute the named program with + * the given arguments. + * + * It sets only the Path and Args in the returned structure. + * + * If name contains no path separators, Command uses [LookPath] to + * resolve name to a complete path if possible. Otherwise it uses name + * directly as Path. + * + * The returned Cmd's Args field is constructed from the command name + * followed by the elements of arg, so arg should not include the + * command name itself. For example, Command("echo", "hello"). + * Args[0] is always name, not the possibly resolved Path. + * + * On Windows, processes receive the whole command line as a single string + * and do their own parsing. Command combines and quotes Args into a command + * line string with an algorithm compatible with applications using + * CommandLineToArgvW (which is the most common way). Notable exceptions are + * msiexec.exe and cmd.exe (and thus, all batch files), which have a different + * unquoting algorithm. In these or other similar cases, you can do the + * quoting yourself and provide the full command line in SysProcAttr.CmdLine, + * leaving Args empty. + */ + (name: string, ...arg: string[]): (Cmd) + } +} + /** * Package validation provides configurable and extensible rules for validating data of various types. */ @@ -2823,111 +2949,6 @@ namespace ozzo_validation { } } -/** - * Package template is a thin wrapper around the standard html/template - * and text/template packages that implements a convenient registry to - * load and cache templates on the fly concurrently. - * - * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. - * - * Example: - * - * ``` - * registry := template.NewRegistry() - * - * html1, err := registry.LoadFiles( - * // the files set wil be parsed only once and then cached - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "John"}) - * - * html2, err := registry.LoadFiles( - * // reuse the already parsed and cached files set - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "Jane"}) - * ``` - */ -namespace template { - interface newRegistry { - /** - * NewRegistry creates and initializes a new templates registry with - * some defaults (eg. global "raw" template function for unescaped HTML). - * - * Use the Registry.Load* methods to load templates into the registry. - */ - (): (Registry) - } - /** - * Registry defines a templates registry that is safe to be used by multiple goroutines. - * - * Use the Registry.Load* methods to load templates into the registry. - */ - interface Registry { - } - interface Registry { - /** - * AddFuncs registers new global template functions. - * - * The key of each map entry is the function name that will be used in the templates. - * If a function with the map entry name already exists it will be replaced with the new one. - * - * The value of each map entry is a function that must have either a - * single return value, or two return values of which the second has type error. - * - * Example: - * - * ``` - * r.AddFuncs(map[string]any{ - * "toUpper": func(str string) string { - * return strings.ToUppser(str) - * }, - * ... - * }) - * ``` - */ - addFuncs(funcs: _TygojaDict): (Registry) - } - interface Registry { - /** - * LoadFiles caches (if not already) the specified filenames set as a - * single template and returns a ready to use Renderer instance. - * - * There must be at least 1 filename specified. - */ - loadFiles(...filenames: string[]): (Renderer) - } - interface Registry { - /** - * LoadString caches (if not already) the specified inline string as a - * single template and returns a ready to use Renderer instance. - */ - loadString(text: string): (Renderer) - } - interface Registry { - /** - * LoadFS caches (if not already) the specified fs and globPatterns - * pair as single template and returns a ready to use Renderer instance. - * - * There must be at least 1 file matching the provided globPattern(s) - * (note that most file names serves as glob patterns matching themselves). - */ - loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer) - } - /** - * Renderer defines a single parsed template. - */ - interface Renderer { - } - interface Renderer { - /** - * Render executes the template with the specified data as the dot object - * and returns the result as plain string. - */ - render(data: any): string - } -} - /** * Package dbx provides a set of DB-agnostic and easy-to-use query building methods for relational databases. */ @@ -3264,14 +3285,14 @@ namespace dbx { /** * MssqlBuilder is the builder for SQL Server databases. */ - type _subuzbFm = BaseBuilder - interface MssqlBuilder extends _subuzbFm { + type _subbjoCn = BaseBuilder + interface MssqlBuilder extends _subbjoCn { } /** * MssqlQueryBuilder is the query builder for SQL Server databases. */ - type _subXWlkZ = BaseQueryBuilder - interface MssqlQueryBuilder extends _subXWlkZ { + type _subkIkQq = BaseQueryBuilder + interface MssqlQueryBuilder extends _subkIkQq { } interface newMssqlBuilder { /** @@ -3342,8 +3363,8 @@ namespace dbx { /** * MysqlBuilder is the builder for MySQL databases. */ - type _subYXhgn = BaseBuilder - interface MysqlBuilder extends _subYXhgn { + type _subSslnA = BaseBuilder + interface MysqlBuilder extends _subSslnA { } interface newMysqlBuilder { /** @@ -3418,14 +3439,14 @@ namespace dbx { /** * OciBuilder is the builder for Oracle databases. */ - type _subtyYVC = BaseBuilder - interface OciBuilder extends _subtyYVC { + type _subOCBdv = BaseBuilder + interface OciBuilder extends _subOCBdv { } /** * OciQueryBuilder is the query builder for Oracle databases. */ - type _subEKOiq = BaseQueryBuilder - interface OciQueryBuilder extends _subEKOiq { + type _suboFWUz = BaseQueryBuilder + interface OciQueryBuilder extends _suboFWUz { } interface newOciBuilder { /** @@ -3488,8 +3509,8 @@ namespace dbx { /** * PgsqlBuilder is the builder for PostgreSQL databases. */ - type _subdCVsT = BaseBuilder - interface PgsqlBuilder extends _subdCVsT { + type _subFeriJ = BaseBuilder + interface PgsqlBuilder extends _subFeriJ { } interface newPgsqlBuilder { /** @@ -3556,8 +3577,8 @@ namespace dbx { /** * SqliteBuilder is the builder for SQLite databases. */ - type _subMRBsF = BaseBuilder - interface SqliteBuilder extends _subMRBsF { + type _subdeKFA = BaseBuilder + interface SqliteBuilder extends _subdeKFA { } interface newSqliteBuilder { /** @@ -3656,8 +3677,8 @@ namespace dbx { /** * StandardBuilder is the builder that is used by DB for an unknown driver. */ - type _subuXqPc = BaseBuilder - interface StandardBuilder extends _subuXqPc { + type _subYeHpO = BaseBuilder + interface StandardBuilder extends _subYeHpO { } interface newStandardBuilder { /** @@ -3723,8 +3744,8 @@ namespace dbx { * DB enhances sql.DB by providing a set of DB-agnostic query building methods. * DB allows easier query building and population of data into Go variables. */ - type _subhQnuN = Builder - interface DB extends _subhQnuN { + type _subxFNAr = Builder + interface DB extends _subxFNAr { /** * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. */ @@ -4528,8 +4549,8 @@ namespace dbx { * Rows enhances sql.Rows by providing additional data query methods. * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. */ - type _subEJfjG = sql.Rows - interface Rows extends _subEJfjG { + type _subHFvih = sql.Rows + interface Rows extends _subHFvih { } interface Rows { /** @@ -4615,6 +4636,18 @@ namespace dbx { */ withContext(ctx: context.Context): (SelectQuery) } + interface SelectQuery { + /** + * PreFragment sets SQL fragment that should be prepended before the select query (e.g. WITH clause). + */ + preFragment(fragment: string): (SelectQuery) + } + interface SelectQuery { + /** + * PostFragment sets SQL fragment that should be appended at the end of the select query. + */ + postFragment(fragment: string): (SelectQuery) + } interface SelectQuery { /** * Select specifies the columns to be selected. @@ -4852,6 +4885,8 @@ namespace dbx { * QueryInfo represents a debug/info struct with exported SelectQuery fields. */ interface QueryInfo { + preFragment: string + postFragment: string builder: Builder selects: Array distinct: boolean @@ -4887,8 +4922,8 @@ namespace dbx { }): string } interface structInfo { } - type _subUzjKk = structInfo - interface structValue extends _subUzjKk { + type _subsdRxj = structInfo + interface structValue extends _subsdRxj { } interface fieldInfo { } @@ -4927,8 +4962,8 @@ namespace dbx { /** * Tx enhances sql.Tx with additional querying methods. */ - type _subyeVmN = Builder - interface Tx extends _subyeVmN { + type _subVkoUL = Builder + interface Tx extends _subVkoUL { } interface Tx { /** @@ -4944,132 +4979,6 @@ namespace dbx { } } -/** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. - * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the [path/filepath] package's Glob function. - * To expand environment variables, use package os's ExpandEnv. - * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. - * - * # Executables in the current directory - * - * The functions [Command] and [LookPath] look for a program - * in the directories listed in the current path, following the - * conventions of the host operating system. - * Operating systems have for decades included the current - * directory in this search, sometimes implicitly and sometimes - * configured explicitly that way by default. - * Modern practice is that including the current directory - * is usually unexpected and often leads to security problems. - * - * To avoid those security problems, as of Go 1.19, this package will not resolve a program - * using an implicit or explicit path entry relative to the current directory. - * That is, if you run [LookPath]("go"), it will not successfully return - * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. - * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying [errors.Is](err, [ErrDot]). - * - * For example, consider these two program snippets: - * - * ``` - * path, err := exec.LookPath("prog") - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * These will not find and run ./prog or .\prog.exe, - * no matter how the current path is configured. - * - * Code that always wants to run a program from the current directory - * can be rewritten to say "./prog" instead of "prog". - * - * Code that insists on including results from relative path entries - * can instead override the error using an errors.Is check: - * - * ``` - * path, err := exec.LookPath("prog") - * if errors.Is(err, exec.ErrDot) { - * err = nil - * } - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if errors.Is(cmd.Err, exec.ErrDot) { - * cmd.Err = nil - * } - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * Setting the environment variable GODEBUG=execerrdot=0 - * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 - * behavior for programs that are unable to apply more targeted fixes. - * A future version of Go may remove support for this variable. - * - * Before adding such overrides, make sure you understand the - * security implications of doing so. - * See https://go.dev/blog/path-security for more information. - */ -namespace exec { - interface command { - /** - * Command returns the [Cmd] struct to execute the named program with - * the given arguments. - * - * It sets only the Path and Args in the returned structure. - * - * If name contains no path separators, Command uses [LookPath] to - * resolve name to a complete path if possible. Otherwise it uses name - * directly as Path. - * - * The returned Cmd's Args field is constructed from the command name - * followed by the elements of arg, so arg should not include the - * command name itself. For example, Command("echo", "hello"). - * Args[0] is always name, not the possibly resolved Path. - * - * On Windows, processes receive the whole command line as a single string - * and do their own parsing. Command combines and quotes Args into a command - * line string with an algorithm compatible with applications using - * CommandLineToArgvW (which is the most common way). Notable exceptions are - * msiexec.exe and cmd.exe (and thus, all batch files), which have a different - * unquoting algorithm. In these or other similar cases, you can do the - * quoting yourself and provide the full command line in SysProcAttr.CmdLine, - * leaving Args empty. - */ - (name: string, ...arg: string[]): (Cmd) - } -} - namespace security { interface s256Challenge { /** @@ -5309,8 +5218,8 @@ namespace filesystem { */ open(): io.ReadSeekCloser } - type _subfofgm = bytes.Reader - interface bytesReadSeekCloser extends _subfofgm { + type _subzoCfv = bytes.Reader + interface bytesReadSeekCloser extends _subzoCfv { } interface bytesReadSeekCloser { /** @@ -7060,8 +6969,8 @@ namespace core { /** * AuthOrigin defines a Record proxy for working with the authOrigins collection. */ - type _subINkJs = Record - interface AuthOrigin extends _subINkJs { + type _subSfXuN = Record + interface AuthOrigin extends _subSfXuN { } interface newAuthOrigin { /** @@ -7751,8 +7660,8 @@ namespace core { /** * @todo experiment eventually replacing the rules *string with a struct? */ - type _subbsKVh = BaseModel - interface baseCollection extends _subbsKVh { + type _subzNzhS = BaseModel + interface baseCollection extends _subzNzhS { listRule?: string viewRule?: string createRule?: string @@ -7779,8 +7688,8 @@ namespace core { /** * Collection defines the table, fields and various options related to a set of records. */ - type _subTjgRq = baseCollection&collectionAuthOptions&collectionViewOptions - interface Collection extends _subTjgRq { + type _subRsmwJ = baseCollection&collectionAuthOptions&collectionViewOptions + interface Collection extends _subRsmwJ { } interface newCollection { /** @@ -8585,8 +8494,8 @@ namespace core { /** * RequestEvent defines the PocketBase router handler event. */ - type _submXBmv = router.Event - interface RequestEvent extends _submXBmv { + type _subGmaFG = router.Event + interface RequestEvent extends _subGmaFG { app: App auth?: Record } @@ -8646,8 +8555,8 @@ namespace core { */ clone(): (RequestInfo) } - type _subYQmpX = hook.Event&RequestEvent - interface BatchRequestEvent extends _subYQmpX { + type _suboVdhi = hook.Event&RequestEvent + interface BatchRequestEvent extends _suboVdhi { batch: Array<(InternalRequest | undefined)> } interface InternalRequest { @@ -8684,54 +8593,54 @@ namespace core { interface baseCollectionEventData { tags(): Array } - type _subTZvUE = hook.Event - interface BootstrapEvent extends _subTZvUE { + type _subJsxFG = hook.Event + interface BootstrapEvent extends _subJsxFG { app: App } - type _subSBuoq = hook.Event - interface TerminateEvent extends _subSBuoq { + type _subuQOdp = hook.Event + interface TerminateEvent extends _subuQOdp { app: App isRestart: boolean } - type _subHFPAa = hook.Event - interface BackupEvent extends _subHFPAa { + type _subjypNe = hook.Event + interface BackupEvent extends _subjypNe { app: App context: context.Context name: string // the name of the backup to create/restore. exclude: Array // list of dir entries to exclude from the backup create/restore. } - type _subxIeRY = hook.Event - interface ServeEvent extends _subxIeRY { + type _subTidDX = hook.Event + interface ServeEvent extends _subTidDX { app: App router?: router.Router server?: http.Server certManager?: any } - type _subSzKNJ = hook.Event&RequestEvent - interface SettingsListRequestEvent extends _subSzKNJ { + type _subNuito = hook.Event&RequestEvent + interface SettingsListRequestEvent extends _subNuito { settings?: Settings } - type _subtumMr = hook.Event&RequestEvent - interface SettingsUpdateRequestEvent extends _subtumMr { + type _subbENrr = hook.Event&RequestEvent + interface SettingsUpdateRequestEvent extends _subbENrr { oldSettings?: Settings newSettings?: Settings } - type _subDdeIq = hook.Event - interface SettingsReloadEvent extends _subDdeIq { + type _subxACQR = hook.Event + interface SettingsReloadEvent extends _subxACQR { app: App } - type _subEAbBk = hook.Event - interface MailerEvent extends _subEAbBk { + type _subedGMy = hook.Event + interface MailerEvent extends _subedGMy { app: App mailer: mailer.Mailer message?: mailer.Message } - type _subkHYPo = MailerEvent&baseRecordEventData - interface MailerRecordEvent extends _subkHYPo { + type _subjNVqY = MailerEvent&baseRecordEventData + interface MailerRecordEvent extends _subjNVqY { meta: _TygojaDict } - type _subWDKRJ = hook.Event&baseModelEventData - interface ModelEvent extends _subWDKRJ { + type _subWyMmf = hook.Event&baseModelEventData + interface ModelEvent extends _subWyMmf { app: App context: context.Context /** @@ -8743,12 +8652,12 @@ namespace core { */ type: string } - type _subQCVUT = ModelEvent - interface ModelErrorEvent extends _subQCVUT { + type _subVygQv = ModelEvent + interface ModelErrorEvent extends _subVygQv { error: Error } - type _subWIBoT = hook.Event&baseRecordEventData - interface RecordEvent extends _subWIBoT { + type _subQEvjw = hook.Event&baseRecordEventData + interface RecordEvent extends _subQEvjw { app: App context: context.Context /** @@ -8760,12 +8669,12 @@ namespace core { */ type: string } - type _subSvUcP = RecordEvent - interface RecordErrorEvent extends _subSvUcP { + type _sublEAjp = RecordEvent + interface RecordErrorEvent extends _sublEAjp { error: Error } - type _subMxnIx = hook.Event&baseCollectionEventData - interface CollectionEvent extends _subMxnIx { + type _subqnKuU = hook.Event&baseCollectionEventData + interface CollectionEvent extends _subqnKuU { app: App context: context.Context /** @@ -8777,95 +8686,95 @@ namespace core { */ type: string } - type _subFeqpH = CollectionEvent - interface CollectionErrorEvent extends _subFeqpH { + type _subWxypH = CollectionEvent + interface CollectionErrorEvent extends _subWxypH { error: Error } - type _subjyEDF = hook.Event&RequestEvent&baseRecordEventData - interface FileTokenRequestEvent extends _subjyEDF { + type _subiJTqF = hook.Event&RequestEvent&baseRecordEventData + interface FileTokenRequestEvent extends _subiJTqF { token: string } - type _subNAupm = hook.Event&RequestEvent&baseCollectionEventData - interface FileDownloadRequestEvent extends _subNAupm { + type _subAGovE = hook.Event&RequestEvent&baseCollectionEventData + interface FileDownloadRequestEvent extends _subAGovE { record?: Record fileField?: FileField servedPath: string servedName: string } - type _subNKPqB = hook.Event&RequestEvent - interface CollectionsListRequestEvent extends _subNKPqB { + type _subMamXy = hook.Event&RequestEvent + interface CollectionsListRequestEvent extends _subMamXy { collections: Array<(Collection | undefined)> result?: search.Result } - type _subSxROt = hook.Event&RequestEvent - interface CollectionsImportRequestEvent extends _subSxROt { + type _subgdlXm = hook.Event&RequestEvent + interface CollectionsImportRequestEvent extends _subgdlXm { collectionsData: Array<_TygojaDict> deleteMissing: boolean } - type _subbiUPS = hook.Event&RequestEvent&baseCollectionEventData - interface CollectionRequestEvent extends _subbiUPS { + type _subQkNMg = hook.Event&RequestEvent&baseCollectionEventData + interface CollectionRequestEvent extends _subQkNMg { } - type _subZqOgJ = hook.Event&RequestEvent - interface RealtimeConnectRequestEvent extends _subZqOgJ { + type _subjQmJE = hook.Event&RequestEvent + interface RealtimeConnectRequestEvent extends _subjQmJE { client: subscriptions.Client /** * note: modifying it after the connect has no effect */ idleTimeout: time.Duration } - type _subhqoJT = hook.Event&RequestEvent - interface RealtimeMessageEvent extends _subhqoJT { + type _subIsNWI = hook.Event&RequestEvent + interface RealtimeMessageEvent extends _subIsNWI { client: subscriptions.Client message?: subscriptions.Message } - type _subesSQM = hook.Event&RequestEvent - interface RealtimeSubscribeRequestEvent extends _subesSQM { + type _sublETgG = hook.Event&RequestEvent + interface RealtimeSubscribeRequestEvent extends _sublETgG { client: subscriptions.Client subscriptions: Array } - type _subMslsj = hook.Event&RequestEvent&baseCollectionEventData - interface RecordsListRequestEvent extends _subMslsj { + type _subjmUmd = hook.Event&RequestEvent&baseCollectionEventData + interface RecordsListRequestEvent extends _subjmUmd { /** * @todo consider removing and maybe add as generic to the search.Result? */ records: Array<(Record | undefined)> result?: search.Result } - type _subgvrFx = hook.Event&RequestEvent&baseCollectionEventData - interface RecordRequestEvent extends _subgvrFx { + type _subVXUiq = hook.Event&RequestEvent&baseCollectionEventData + interface RecordRequestEvent extends _subVXUiq { record?: Record } - type _subOrzFB = hook.Event&baseRecordEventData - interface RecordEnrichEvent extends _subOrzFB { + type _subKMOhq = hook.Event&baseRecordEventData + interface RecordEnrichEvent extends _subKMOhq { app: App requestInfo?: RequestInfo } - type _subuFOAM = hook.Event&RequestEvent&baseCollectionEventData - interface RecordCreateOTPRequestEvent extends _subuFOAM { + type _subDbOTw = hook.Event&RequestEvent&baseCollectionEventData + interface RecordCreateOTPRequestEvent extends _subDbOTw { record?: Record password: string } - type _subnosHn = hook.Event&RequestEvent&baseCollectionEventData - interface RecordAuthWithOTPRequestEvent extends _subnosHn { + type _subeyTup = hook.Event&RequestEvent&baseCollectionEventData + interface RecordAuthWithOTPRequestEvent extends _subeyTup { record?: Record otp?: OTP } - type _subOdISs = hook.Event&RequestEvent&baseCollectionEventData - interface RecordAuthRequestEvent extends _subOdISs { + type _subuRSwc = hook.Event&RequestEvent&baseCollectionEventData + interface RecordAuthRequestEvent extends _subuRSwc { record?: Record token: string meta: any authMethod: string } - type _subBEEXW = hook.Event&RequestEvent&baseCollectionEventData - interface RecordAuthWithPasswordRequestEvent extends _subBEEXW { + type _subrFKIG = hook.Event&RequestEvent&baseCollectionEventData + interface RecordAuthWithPasswordRequestEvent extends _subrFKIG { record?: Record identity: string identityField: string password: string } - type _subNoDXY = hook.Event&RequestEvent&baseCollectionEventData - interface RecordAuthWithOAuth2RequestEvent extends _subNoDXY { + type _subLCXqT = hook.Event&RequestEvent&baseCollectionEventData + interface RecordAuthWithOAuth2RequestEvent extends _subLCXqT { providerName: string providerClient: auth.Provider record?: Record @@ -8873,41 +8782,41 @@ namespace core { createData: _TygojaDict isNewRecord: boolean } - type _subBXbuM = hook.Event&RequestEvent&baseCollectionEventData - interface RecordAuthRefreshRequestEvent extends _subBXbuM { + type _subbRBAV = hook.Event&RequestEvent&baseCollectionEventData + interface RecordAuthRefreshRequestEvent extends _subbRBAV { record?: Record } - type _subcsoJi = hook.Event&RequestEvent&baseCollectionEventData - interface RecordRequestPasswordResetRequestEvent extends _subcsoJi { + type _subjkGmP = hook.Event&RequestEvent&baseCollectionEventData + interface RecordRequestPasswordResetRequestEvent extends _subjkGmP { record?: Record } - type _subkTehu = hook.Event&RequestEvent&baseCollectionEventData - interface RecordConfirmPasswordResetRequestEvent extends _subkTehu { + type _subXKKHb = hook.Event&RequestEvent&baseCollectionEventData + interface RecordConfirmPasswordResetRequestEvent extends _subXKKHb { record?: Record } - type _subjdOMc = hook.Event&RequestEvent&baseCollectionEventData - interface RecordRequestVerificationRequestEvent extends _subjdOMc { + type _subakizo = hook.Event&RequestEvent&baseCollectionEventData + interface RecordRequestVerificationRequestEvent extends _subakizo { record?: Record } - type _subFxryI = hook.Event&RequestEvent&baseCollectionEventData - interface RecordConfirmVerificationRequestEvent extends _subFxryI { + type _subyVGzA = hook.Event&RequestEvent&baseCollectionEventData + interface RecordConfirmVerificationRequestEvent extends _subyVGzA { record?: Record } - type _subfVVkd = hook.Event&RequestEvent&baseCollectionEventData - interface RecordRequestEmailChangeRequestEvent extends _subfVVkd { + type _subylUCX = hook.Event&RequestEvent&baseCollectionEventData + interface RecordRequestEmailChangeRequestEvent extends _subylUCX { record?: Record newEmail: string } - type _subCtrcr = hook.Event&RequestEvent&baseCollectionEventData - interface RecordConfirmEmailChangeRequestEvent extends _subCtrcr { + type _subIkQfF = hook.Event&RequestEvent&baseCollectionEventData + interface RecordConfirmEmailChangeRequestEvent extends _subIkQfF { record?: Record newEmail: string } /** * ExternalAuth defines a Record proxy for working with the externalAuths collection. */ - type _subWSYgt = Record - interface ExternalAuth extends _subWSYgt { + type _subZtcLP = Record + interface ExternalAuth extends _subZtcLP { } interface newExternalAuth { /** @@ -11247,8 +11156,8 @@ namespace core { interface onlyFieldType { type: string } - type _subZnUVS = Field - interface fieldWithType extends _subZnUVS { + type _subnecEG = Field + interface fieldWithType extends _subnecEG { type: string } interface fieldWithType { @@ -11280,8 +11189,8 @@ namespace core { */ scan(value: any): void } - type _subiuUSq = BaseModel - interface Log extends _subiuUSq { + type _subfvVGy = BaseModel + interface Log extends _subfvVGy { created: types.DateTime data: types.JSONMap message: string @@ -11327,8 +11236,8 @@ namespace core { /** * MFA defines a Record proxy for working with the mfas collection. */ - type _subeeSGJ = Record - interface MFA extends _subeeSGJ { + type _subStpaz = Record + interface MFA extends _subStpaz { } interface newMFA { /** @@ -11550,8 +11459,8 @@ namespace core { /** * OTP defines a Record proxy for working with the otps collection. */ - type _subqDnOl = Record - interface OTP extends _subqDnOl { + type _subnoYhn = Record + interface OTP extends _subnoYhn { } interface newOTP { /** @@ -11763,8 +11672,8 @@ namespace core { } interface runner { } - type _subFYJWK = BaseModel - interface Record extends _subFYJWK { + type _subKkqfo = BaseModel + interface Record extends _subKkqfo { } interface newRecord { /** @@ -12213,8 +12122,8 @@ namespace core { * BaseRecordProxy implements the [RecordProxy] interface and it is intended * to be used as embed to custom user provided Record proxy structs. */ - type _subsjQuY = Record - interface BaseRecordProxy extends _subsjQuY { + type _subdLoyF = Record + interface BaseRecordProxy extends _subdLoyF { } interface BaseRecordProxy { /** @@ -12460,8 +12369,8 @@ namespace core { /** * Settings defines the PocketBase app settings. */ - type _subHZQMb = settings - interface Settings extends _subHZQMb { + type _subFSyZW = settings + interface Settings extends _subFSyZW { } interface Settings { /** @@ -12762,8 +12671,8 @@ namespace core { */ durationTime(): time.Duration } - type _subMoYiM = BaseModel - interface Param extends _subMoYiM { + type _subBPUDl = BaseModel + interface Param extends _subBPUDl { created: types.DateTime updated: types.DateTime value: types.JSONRaw @@ -13271,8 +13180,8 @@ namespace apis { */ (limitBytes: number): (hook.Handler) } - type _subMZIQg = io.ReadCloser - interface limitedReader extends _subMZIQg { + type _subAiJXO = io.ReadCloser + interface limitedReader extends _subAiJXO { } interface limitedReader { read(b: string|Array): number @@ -13423,8 +13332,8 @@ namespace apis { */ (config: GzipConfig): (hook.Handler) } - type _subaoRAb = http.ResponseWriter&io.Writer - interface gzipResponseWriter extends _subaoRAb { + type _subRLNAL = http.ResponseWriter&io.Writer + interface gzipResponseWriter extends _subRLNAL { } interface gzipResponseWriter { writeHeader(code: number): void @@ -13444,11 +13353,11 @@ namespace apis { interface gzipResponseWriter { unwrap(): http.ResponseWriter } - type _subMpfeK = sync.RWMutex - interface rateLimiter extends _subMpfeK { + type _subqnrrC = sync.RWMutex + interface rateLimiter extends _subqnrrC { } - type _subhFBjj = sync.Mutex - interface fixedWindow extends _subhFBjj { + type _subBUIcp = sync.Mutex + interface fixedWindow extends _subBUIcp { } interface realtimeSubscribeForm { clientId: string @@ -13682,6 +13591,111 @@ namespace apis { } } +/** + * Package template is a thin wrapper around the standard html/template + * and text/template packages that implements a convenient registry to + * load and cache templates on the fly concurrently. + * + * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. + * + * Example: + * + * ``` + * registry := template.NewRegistry() + * + * html1, err := registry.LoadFiles( + * // the files set wil be parsed only once and then cached + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "John"}) + * + * html2, err := registry.LoadFiles( + * // reuse the already parsed and cached files set + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "Jane"}) + * ``` + */ +namespace template { + interface newRegistry { + /** + * NewRegistry creates and initializes a new templates registry with + * some defaults (eg. global "raw" template function for unescaped HTML). + * + * Use the Registry.Load* methods to load templates into the registry. + */ + (): (Registry) + } + /** + * Registry defines a templates registry that is safe to be used by multiple goroutines. + * + * Use the Registry.Load* methods to load templates into the registry. + */ + interface Registry { + } + interface Registry { + /** + * AddFuncs registers new global template functions. + * + * The key of each map entry is the function name that will be used in the templates. + * If a function with the map entry name already exists it will be replaced with the new one. + * + * The value of each map entry is a function that must have either a + * single return value, or two return values of which the second has type error. + * + * Example: + * + * ``` + * r.AddFuncs(map[string]any{ + * "toUpper": func(str string) string { + * return strings.ToUppser(str) + * }, + * ... + * }) + * ``` + */ + addFuncs(funcs: _TygojaDict): (Registry) + } + interface Registry { + /** + * LoadFiles caches (if not already) the specified filenames set as a + * single template and returns a ready to use Renderer instance. + * + * There must be at least 1 filename specified. + */ + loadFiles(...filenames: string[]): (Renderer) + } + interface Registry { + /** + * LoadString caches (if not already) the specified inline string as a + * single template and returns a ready to use Renderer instance. + */ + loadString(text: string): (Renderer) + } + interface Registry { + /** + * LoadFS caches (if not already) the specified fs and globPatterns + * pair as single template and returns a ready to use Renderer instance. + * + * There must be at least 1 file matching the provided globPattern(s) + * (note that most file names serves as glob patterns matching themselves). + */ + loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer) + } + /** + * Renderer defines a single parsed template. + */ + interface Renderer { + } + interface Renderer { + /** + * Render executes the template with the specified data as the dot object + * and returns the result as plain string. + */ + render(data: any): string + } +} + namespace pocketbase { /** * PocketBase defines a PocketBase app launcher. @@ -13689,8 +13703,8 @@ namespace pocketbase { * It implements [CoreApp] via embedding and all of the app interface methods * could be accessed directly through the instance (eg. PocketBase.DataDir()). */ - type _subkghJm = CoreApp - interface PocketBase extends _subkghJm { + type _subCnYnX = CoreApp + interface PocketBase extends _subCnYnX { /** * RootCmd is the main console command */ @@ -15028,173 +15042,11 @@ namespace bufio { * ReadWriter stores pointers to a [Reader] and a [Writer]. * It implements [io.ReadWriter]. */ - type _subLyYcC = Reader&Writer - interface ReadWriter extends _subLyYcC { + type _subMGHmN = Reader&Writer + interface ReadWriter extends _subMGHmN { } } -/** - * Package syntax parses regular expressions into parse trees and compiles - * parse trees into programs. Most clients of regular expressions will use the - * facilities of package [regexp] (such as [regexp.Compile] and [regexp.Match]) instead of this package. - * - * # Syntax - * - * The regular expression syntax understood by this package when parsing with the [Perl] flag is as follows. - * Parts of the syntax can be disabled by passing alternate flags to [Parse]. - * - * Single characters: - * - * ``` - * . any character, possibly including newline (flag s=true) - * [xyz] character class - * [^xyz] negated character class - * \d Perl character class - * \D negated Perl character class - * [[:alpha:]] ASCII character class - * [[:^alpha:]] negated ASCII character class - * \pN Unicode character class (one-letter name) - * \p{Greek} Unicode character class - * \PN negated Unicode character class (one-letter name) - * \P{Greek} negated Unicode character class - * ``` - * - * Composites: - * - * ``` - * xy x followed by y - * x|y x or y (prefer x) - * ``` - * - * Repetitions: - * - * ``` - * x* zero or more x, prefer more - * x+ one or more x, prefer more - * x? zero or one x, prefer one - * x{n,m} n or n+1 or ... or m x, prefer more - * x{n,} n or more x, prefer more - * x{n} exactly n x - * x*? zero or more x, prefer fewer - * x+? one or more x, prefer fewer - * x?? zero or one x, prefer zero - * x{n,m}? n or n+1 or ... or m x, prefer fewer - * x{n,}? n or more x, prefer fewer - * x{n}? exactly n x - * ``` - * - * Implementation restriction: The counting forms x{n,m}, x{n,}, and x{n} - * reject forms that create a minimum or maximum repetition count above 1000. - * Unlimited repetitions are not subject to this restriction. - * - * Grouping: - * - * ``` - * (re) numbered capturing group (submatch) - * (?Pre) named & numbered capturing group (submatch) - * (?re) named & numbered capturing group (submatch) - * (?:re) non-capturing group - * (?flags) set flags within current group; non-capturing - * (?flags:re) set flags during re; non-capturing - * - * Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). The flags are: - * - * i case-insensitive (default false) - * m multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) - * s let . match \n (default false) - * U ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) - * ``` - * - * Empty strings: - * - * ``` - * ^ at beginning of text or line (flag m=true) - * $ at end of text (like \z not \Z) or line (flag m=true) - * \A at beginning of text - * \b at ASCII word boundary (\w on one side and \W, \A, or \z on the other) - * \B not at ASCII word boundary - * \z at end of text - * ``` - * - * Escape sequences: - * - * ``` - * \a bell (== \007) - * \f form feed (== \014) - * \t horizontal tab (== \011) - * \n newline (== \012) - * \r carriage return (== \015) - * \v vertical tab character (== \013) - * \* literal *, for any punctuation character * - * \123 octal character code (up to three digits) - * \x7F hex character code (exactly two digits) - * \x{10FFFF} hex character code - * \Q...\E literal text ... even if ... has punctuation - * ``` - * - * Character class elements: - * - * ``` - * x single character - * A-Z character range (inclusive) - * \d Perl character class - * [:foo:] ASCII character class foo - * \p{Foo} Unicode character class Foo - * \pF Unicode character class F (one-letter name) - * ``` - * - * Named character classes as character class elements: - * - * ``` - * [\d] digits (== \d) - * [^\d] not digits (== \D) - * [\D] not digits (== \D) - * [^\D] not not digits (== \d) - * [[:name:]] named ASCII class inside character class (== [:name:]) - * [^[:name:]] named ASCII class inside negated character class (== [:^name:]) - * [\p{Name}] named Unicode property inside character class (== \p{Name}) - * [^\p{Name}] named Unicode property inside negated character class (== \P{Name}) - * ``` - * - * Perl character classes (all ASCII-only): - * - * ``` - * \d digits (== [0-9]) - * \D not digits (== [^0-9]) - * \s whitespace (== [\t\n\f\r ]) - * \S not whitespace (== [^\t\n\f\r ]) - * \w word characters (== [0-9A-Za-z_]) - * \W not word characters (== [^0-9A-Za-z_]) - * ``` - * - * ASCII character classes: - * - * ``` - * [[:alnum:]] alphanumeric (== [0-9A-Za-z]) - * [[:alpha:]] alphabetic (== [A-Za-z]) - * [[:ascii:]] ASCII (== [\x00-\x7F]) - * [[:blank:]] blank (== [\t ]) - * [[:cntrl:]] control (== [\x00-\x1F\x7F]) - * [[:digit:]] digits (== [0-9]) - * [[:graph:]] graphical (== [!-~] == [A-Za-z0-9!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]) - * [[:lower:]] lower case (== [a-z]) - * [[:print:]] printable (== [ -~] == [ [:graph:]]) - * [[:punct:]] punctuation (== [!-/:-@[-`{-~]) - * [[:space:]] whitespace (== [\t\n\v\f\r ]) - * [[:upper:]] upper case (== [A-Z]) - * [[:word:]] word characters (== [0-9A-Za-z_]) - * [[:xdigit:]] hex digit (== [0-9A-Fa-f]) - * ``` - * - * Unicode character classes are those in [unicode.Categories] and [unicode.Scripts]. - */ -namespace syntax { - /** - * Flags control the behavior of the parser and record information about regexp context. - */ - interface Flags extends Number{} -} - /** * Package context defines the Context type, which carries deadlines, * cancellation signals, and other request-scoped values across API boundaries @@ -15358,787 +15210,6 @@ namespace context { } } -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { - /** - * TxOptions holds the transaction options to be used in [DB.BeginTx]. - */ - interface TxOptions { - /** - * Isolation is the transaction isolation level. - * If zero, the driver or database's default level is used. - */ - isolation: IsolationLevel - readOnly: boolean - } - /** - * NullString represents a string that may be null. - * NullString implements the [Scanner] interface so - * it can be used as a scan destination: - * - * ``` - * var s NullString - * err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&s) - * ... - * if s.Valid { - * // use s.String - * } else { - * // NULL value - * } - * ``` - */ - interface NullString { - string: string - valid: boolean // Valid is true if String is not NULL - } - interface NullString { - /** - * Scan implements the [Scanner] interface. - */ - scan(value: any): void - } - interface NullString { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - /** - * DB is a database handle representing a pool of zero or more - * underlying connections. It's safe for concurrent use by multiple - * goroutines. - * - * The sql package creates and frees connections automatically; it - * also maintains a free pool of idle connections. If the database has - * a concept of per-connection state, such state can be reliably observed - * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the - * returned [Tx] is bound to a single connection. Once [Tx.Commit] or - * [Tx.Rollback] is called on the transaction, that transaction's - * connection is returned to [DB]'s idle connection pool. The pool size - * can be controlled with [DB.SetMaxIdleConns]. - */ - interface DB { - } - interface DB { - /** - * PingContext verifies a connection to the database is still alive, - * establishing a connection if necessary. - */ - pingContext(ctx: context.Context): void - } - interface DB { - /** - * Ping verifies a connection to the database is still alive, - * establishing a connection if necessary. - * - * Ping uses [context.Background] internally; to specify the context, use - * [DB.PingContext]. - */ - ping(): void - } - interface DB { - /** - * Close closes the database and prevents new queries from starting. - * Close then waits for all queries that have started processing on the server - * to finish. - * - * It is rare to Close a [DB], as the [DB] handle is meant to be - * long-lived and shared between many goroutines. - */ - close(): void - } - interface DB { - /** - * SetMaxIdleConns sets the maximum number of connections in the idle - * connection pool. - * - * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, - * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. - * - * If n <= 0, no idle connections are retained. - * - * The default max idle connections is currently 2. This may change in - * a future release. - */ - setMaxIdleConns(n: number): void - } - interface DB { - /** - * SetMaxOpenConns sets the maximum number of open connections to the database. - * - * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than - * MaxIdleConns, then MaxIdleConns will be reduced to match the new - * MaxOpenConns limit. - * - * If n <= 0, then there is no limit on the number of open connections. - * The default is 0 (unlimited). - */ - setMaxOpenConns(n: number): void - } - interface DB { - /** - * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's age. - */ - setConnMaxLifetime(d: time.Duration): void - } - interface DB { - /** - * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's idle time. - */ - setConnMaxIdleTime(d: time.Duration): void - } - interface DB { - /** - * Stats returns database statistics. - */ - stats(): DBStats - } - interface DB { - /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - */ - prepareContext(ctx: context.Context, query: string): (Stmt) - } - interface DB { - /** - * Prepare creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * Prepare uses [context.Background] internally; to specify the context, use - * [DB.PrepareContext]. - */ - prepare(query: string): (Stmt) - } - interface DB { - /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface DB { - /** - * Exec executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - * - * Exec uses [context.Background] internally; to specify the context, use - * [DB.ExecContext]. - */ - exec(query: string, ...args: any[]): Result - } - interface DB { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface DB { - /** - * Query executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - * - * Query uses [context.Background] internally; to specify the context, use - * [DB.QueryContext]. - */ - query(query: string, ...args: any[]): (Rows) - } - interface DB { - /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) - } - interface DB { - /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, [*Row.Scan] scans the first selected row and discards - * the rest. - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [DB.QueryRowContext]. - */ - queryRow(query: string, ...args: any[]): (Row) - } - interface DB { - /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. - * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. - */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) - } - interface DB { - /** - * Begin starts a transaction. The default isolation level is dependent on - * the driver. - * - * Begin uses [context.Background] internally; to specify the context, use - * [DB.BeginTx]. - */ - begin(): (Tx) - } - interface DB { - /** - * Driver returns the database's underlying driver. - */ - driver(): any - } - interface DB { - /** - * Conn returns a single connection by either opening a new connection - * or returning an existing connection from the connection pool. Conn will - * block until either a connection is returned or ctx is canceled. - * Queries run on the same Conn will be run in the same database session. - * - * Every Conn must be returned to the database pool after use by - * calling [Conn.Close]. - */ - conn(ctx: context.Context): (Conn) - } - /** - * Tx is an in-progress database transaction. - * - * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. - * - * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the - * transaction fail with [ErrTxDone]. - * - * The statements prepared for a transaction by calling - * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed - * by the call to [Tx.Commit] or [Tx.Rollback]. - */ - interface Tx { - } - interface Tx { - /** - * Commit commits the transaction. - */ - commit(): void - } - interface Tx { - /** - * Rollback aborts the transaction. - */ - rollback(): void - } - interface Tx { - /** - * PrepareContext creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. - * - * The provided context will be used for the preparation of the context, not - * for the execution of the returned statement. The returned statement - * will run in the transaction context. - */ - prepareContext(ctx: context.Context, query: string): (Stmt) - } - interface Tx { - /** - * Prepare creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see [Tx.Stmt]. - * - * Prepare uses [context.Background] internally; to specify the context, use - * [Tx.PrepareContext]. - */ - prepare(query: string): (Stmt) - } - interface Tx { - /** - * StmtContext returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) - * ``` - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - */ - stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) - } - interface Tx { - /** - * Stmt returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * - * ``` - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) - * ``` - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * Stmt uses [context.Background] internally; to specify the context, use - * [Tx.StmtContext]. - */ - stmt(stmt: Stmt): (Stmt) - } - interface Tx { - /** - * ExecContext executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. - */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface Tx { - /** - * Exec executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. - * - * Exec uses [context.Background] internally; to specify the context, use - * [Tx.ExecContext]. - */ - exec(query: string, ...args: any[]): Result - } - interface Tx { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface Tx { - /** - * Query executes a query that returns rows, typically a SELECT. - * - * Query uses [context.Background] internally; to specify the context, use - * [Tx.QueryContext]. - */ - query(query: string, ...args: any[]): (Rows) - } - interface Tx { - /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) - } - interface Tx { - /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * [Row]'s Scan method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Tx.QueryRowContext]. - */ - queryRow(query: string, ...args: any[]): (Row) - } - /** - * Stmt is a prepared statement. - * A Stmt is safe for concurrent use by multiple goroutines. - * - * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single - * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will - * become unusable and all operations will return an error. - * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the - * [DB]. When the Stmt needs to execute on a new underlying connection, it will - * prepare itself on the new connection automatically. - */ - interface Stmt { - } - interface Stmt { - /** - * ExecContext executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. - */ - execContext(ctx: context.Context, ...args: any[]): Result - } - interface Stmt { - /** - * Exec executes a prepared statement with the given arguments and - * returns a [Result] summarizing the effect of the statement. - * - * Exec uses [context.Background] internally; to specify the context, use - * [Stmt.ExecContext]. - */ - exec(...args: any[]): Result - } - interface Stmt { - /** - * QueryContext executes a prepared query statement with the given arguments - * and returns the query results as a [*Rows]. - */ - queryContext(ctx: context.Context, ...args: any[]): (Rows) - } - interface Stmt { - /** - * Query executes a prepared query statement with the given arguments - * and returns the query results as a *Rows. - * - * Query uses [context.Background] internally; to specify the context, use - * [Stmt.QueryContext]. - */ - query(...args: any[]): (Rows) - } - interface Stmt { - /** - * QueryRowContext executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, ...args: any[]): (Row) - } - interface Stmt { - /** - * QueryRow executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned [*Row], which is always non-nil. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - * - * Example usage: - * - * ``` - * var name string - * err := nameByUseridStmt.QueryRow(id).Scan(&name) - * ``` - * - * QueryRow uses [context.Background] internally; to specify the context, use - * [Stmt.QueryRowContext]. - */ - queryRow(...args: any[]): (Row) - } - interface Stmt { - /** - * Close closes the statement. - */ - close(): void - } - /** - * Rows is the result of a query. Its cursor starts before the first row - * of the result set. Use [Rows.Next] to advance from row to row. - */ - interface Rows { - } - interface Rows { - /** - * Next prepares the next result row for reading with the [Rows.Scan] method. It - * returns true on success, or false if there is no next result row or an error - * happened while preparing it. [Rows.Err] should be consulted to distinguish between - * the two cases. - * - * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. - */ - next(): boolean - } - interface Rows { - /** - * NextResultSet prepares the next result set for reading. It reports whether - * there is further result sets, or false if there is no further result set - * or if there is an error advancing to it. The [Rows.Err] method should be consulted - * to distinguish between the two cases. - * - * After calling NextResultSet, the [Rows.Next] method should always be called before - * scanning. If there are further result sets they may not have rows in the result - * set. - */ - nextResultSet(): boolean - } - interface Rows { - /** - * Err returns the error, if any, that was encountered during iteration. - * Err may be called after an explicit or implicit [Rows.Close]. - */ - err(): void - } - interface Rows { - /** - * Columns returns the column names. - * Columns returns an error if the rows are closed. - */ - columns(): Array - } - interface Rows { - /** - * ColumnTypes returns column information such as column type, length, - * and nullable. Some information may not be available from some drivers. - */ - columnTypes(): Array<(ColumnType | undefined)> - } - interface Rows { - /** - * Scan copies the columns in the current row into the values pointed - * at by dest. The number of values in dest must be the same as the - * number of columns in [Rows]. - * - * Scan converts columns read from the database into the following - * common Go types and special types provided by the sql package: - * - * ``` - * *string - * *[]byte - * *int, *int8, *int16, *int32, *int64 - * *uint, *uint8, *uint16, *uint32, *uint64 - * *bool - * *float32, *float64 - * *interface{} - * *RawBytes - * *Rows (cursor value) - * any type implementing Scanner (see Scanner docs) - * ``` - * - * In the most simple case, if the type of the value from the source - * column is an integer, bool or string type T and dest is of type *T, - * Scan simply assigns the value through the pointer. - * - * Scan also converts between string and numeric types, as long as no - * information would be lost. While Scan stringifies all numbers - * scanned from numeric database columns into *string, scans into - * numeric types are checked for overflow. For example, a float64 with - * value 300 or a string with value "300" can scan into a uint16, but - * not into a uint8, though float64(255) or "255" can scan into a - * uint8. One exception is that scans of some float64 numbers to - * strings may lose information when stringifying. In general, scan - * floating point columns into *float64. - * - * If a dest argument has type *[]byte, Scan saves in that argument a - * copy of the corresponding data. The copy is owned by the caller and - * can be modified and held indefinitely. The copy can be avoided by - * using an argument of type [*RawBytes] instead; see the documentation - * for [RawBytes] for restrictions on its use. - * - * If an argument has type *interface{}, Scan copies the value - * provided by the underlying driver without conversion. When scanning - * from a source value of type []byte to *interface{}, a copy of the - * slice is made and the caller owns the result. - * - * Source values of type [time.Time] may be scanned into values of type - * *time.Time, *interface{}, *string, or *[]byte. When converting to - * the latter two, [time.RFC3339Nano] is used. - * - * Source values of type bool may be scanned into types *bool, - * *interface{}, *string, *[]byte, or [*RawBytes]. - * - * For scanning into *bool, the source may be true, false, 1, 0, or - * string inputs parseable by [strconv.ParseBool]. - * - * Scan can also convert a cursor returned from a query, such as - * "select cursor(select * from my_table) from dual", into a - * [*Rows] value that can itself be scanned from. The parent - * select query will close any cursor [*Rows] if the parent [*Rows] is closed. - * - * If any of the first arguments implementing [Scanner] returns an error, - * that error will be wrapped in the returned error. - */ - scan(...dest: any[]): void - } - interface Rows { - /** - * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called - * and returns false and there are no further result sets, - * the [Rows] are closed automatically and it will suffice to check the - * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. - */ - close(): void - } - /** - * A Result summarizes an executed SQL command. - */ - interface Result { - [key:string]: any; - /** - * LastInsertId returns the integer generated by the database - * in response to a command. Typically this will be from an - * "auto increment" column when inserting a new row. Not all - * databases support this feature, and the syntax of such - * statements varies. - */ - lastInsertId(): number - /** - * RowsAffected returns the number of rows affected by an - * update, insert, or delete. Not every database or database - * driver may support this. - */ - rowsAffected(): number - } -} - -namespace store { - /** - * Store defines a concurrent safe in memory key-value data store. - */ - interface Store { - } - interface Store { - /** - * Reset clears the store and replaces the store data with a - * shallow copy of the provided newData. - */ - reset(newData: _TygojaDict): void - } - interface Store { - /** - * Length returns the current number of elements in the store. - */ - length(): number - } - interface Store { - /** - * RemoveAll removes all the existing store entries. - */ - removeAll(): void - } - interface Store { - /** - * Remove removes a single entry from the store. - * - * Remove does nothing if key doesn't exist in the store. - */ - remove(key: string): void - } - interface Store { - /** - * Has checks if element with the specified key exist or not. - */ - has(key: string): boolean - } - interface Store { - /** - * Get returns a single element value from the store. - * - * If key is not set, the zero T value is returned. - */ - get(key: string): T - } - interface Store { - /** - * GetOk is similar to Get but returns also a boolean indicating whether the key exists or not. - */ - getOk(key: string): [T, boolean] - } - interface Store { - /** - * GetAll returns a shallow copy of the current store data. - */ - getAll(): _TygojaDict - } - interface Store { - /** - * Values returns a slice with all of the current store values. - */ - values(): Array - } - interface Store { - /** - * Set sets (or overwrite if already exist) a new value for key. - */ - set(key: string, value: T): void - } - interface Store { - /** - * GetOrSet retrieves a single existing value for the provided key - * or stores a new one if it doesn't exist. - */ - getOrSet(key: string, setFunc: () => T): T - } - interface Store { - /** - * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. - * - * This method is similar to Set() but **it will skip adding new elements** - * to the store if the store length has reached the specified limit. - * false is returned if maxAllowedElements limit is reached. - */ - setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean - } - interface Store { - /** - * UnmarshalJSON implements [json.Unmarshaler] and imports the - * provided JSON data into the store. - * - * The store entries that match with the ones from the data will be overwritten with the new value. - */ - unmarshalJSON(data: string|Array): void - } - interface Store { - /** - * MarshalJSON implements [json.Marshaler] and export the current - * store data into valid JSON. - */ - marshalJSON(): string|Array - } -} - /** * Package net provides a portable interface for network I/O, including * TCP/IP, UDP, domain name resolution, and Unix domain sockets. @@ -16306,6 +15377,1301 @@ namespace net { } } +/** + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. + */ +namespace multipart { + /** + * A FileHeader describes a file part of a multipart request. + */ + interface FileHeader { + filename: string + header: textproto.MIMEHeader + size: number + } + interface FileHeader { + /** + * Open opens and returns the [FileHeader]'s associated File. + */ + open(): File + } +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + // @ts-ignore + import mathrand = rand + /** + * PushOptions describes options for [Pusher.Push]. + */ + interface PushOptions { + /** + * Method specifies the HTTP method for the promised request. + * If set, it must be "GET" or "HEAD". Empty means "GET". + */ + method: string + /** + * Header specifies additional promised request headers. This cannot + * include HTTP/2 pseudo header fields like ":path" and ":scheme", + * which will be added automatically. + */ + header: Header + } + // @ts-ignore + import urlpkg = url + /** + * A Request represents an HTTP request received by a server + * or to be sent by a client. + * + * The field semantics differ slightly between client and server + * usage. In addition to the notes on the fields below, see the + * documentation for [Request.Write] and [RoundTripper]. + */ + interface Request { + /** + * Method specifies the HTTP method (GET, POST, PUT, etc.). + * For client requests, an empty string means GET. + */ + method: string + /** + * URL specifies either the URI being requested (for server + * requests) or the URL to access (for client requests). + * + * For server requests, the URL is parsed from the URI + * supplied on the Request-Line as stored in RequestURI. For + * most requests, fields other than Path and RawQuery will be + * empty. (See RFC 7230, Section 5.3) + * + * For client requests, the URL's Host specifies the server to + * connect to, while the Request's Host field optionally + * specifies the Host header value to send in the HTTP + * request. + */ + url?: url.URL + /** + * The protocol version for incoming server requests. + * + * For client requests, these fields are ignored. The HTTP + * client code always uses either HTTP/1.1 or HTTP/2. + * See the docs on Transport for details. + */ + proto: string // "HTTP/1.0" + protoMajor: number // 1 + protoMinor: number // 0 + /** + * Header contains the request header fields either received + * by the server or to be sent by the client. + * + * If a server received a request with header lines, + * + * ``` + * Host: example.com + * accept-encoding: gzip, deflate + * Accept-Language: en-us + * fOO: Bar + * foo: two + * ``` + * + * then + * + * ``` + * Header = map[string][]string{ + * "Accept-Encoding": {"gzip, deflate"}, + * "Accept-Language": {"en-us"}, + * "Foo": {"Bar", "two"}, + * } + * ``` + * + * For incoming requests, the Host header is promoted to the + * Request.Host field and removed from the Header map. + * + * HTTP defines that header names are case-insensitive. The + * request parser implements this by using CanonicalHeaderKey, + * making the first character and any characters following a + * hyphen uppercase and the rest lowercase. + * + * For client requests, certain headers such as Content-Length + * and Connection are automatically written when needed and + * values in Header may be ignored. See the documentation + * for the Request.Write method. + */ + header: Header + /** + * Body is the request's body. + * + * For client requests, a nil body means the request has no + * body, such as a GET request. The HTTP Client's Transport + * is responsible for calling the Close method. + * + * For server requests, the Request Body is always non-nil + * but will return EOF immediately when no body is present. + * The Server will close the request body. The ServeHTTP + * Handler does not need to. + * + * Body must allow Read to be called concurrently with Close. + * In particular, calling Close should unblock a Read waiting + * for input. + */ + body: io.ReadCloser + /** + * GetBody defines an optional func to return a new copy of + * Body. It is used for client requests when a redirect requires + * reading the body more than once. Use of GetBody still + * requires setting Body. + * + * For server requests, it is unused. + */ + getBody: () => io.ReadCloser + /** + * ContentLength records the length of the associated content. + * The value -1 indicates that the length is unknown. + * Values >= 0 indicate that the given number of bytes may + * be read from Body. + * + * For client requests, a value of 0 with a non-nil Body is + * also treated as unknown. + */ + contentLength: number + /** + * TransferEncoding lists the transfer encodings from outermost to + * innermost. An empty list denotes the "identity" encoding. + * TransferEncoding can usually be ignored; chunked encoding is + * automatically added and removed as necessary when sending and + * receiving requests. + */ + transferEncoding: Array + /** + * Close indicates whether to close the connection after + * replying to this request (for servers) or after sending this + * request and reading its response (for clients). + * + * For server requests, the HTTP server handles this automatically + * and this field is not needed by Handlers. + * + * For client requests, setting this field prevents re-use of + * TCP connections between requests to the same hosts, as if + * Transport.DisableKeepAlives were set. + */ + close: boolean + /** + * For server requests, Host specifies the host on which the + * URL is sought. For HTTP/1 (per RFC 7230, section 5.4), this + * is either the value of the "Host" header or the host name + * given in the URL itself. For HTTP/2, it is the value of the + * ":authority" pseudo-header field. + * It may be of the form "host:port". For international domain + * names, Host may be in Punycode or Unicode form. Use + * golang.org/x/net/idna to convert it to either format if + * needed. + * To prevent DNS rebinding attacks, server Handlers should + * validate that the Host header has a value for which the + * Handler considers itself authoritative. The included + * ServeMux supports patterns registered to particular host + * names and thus protects its registered Handlers. + * + * For client requests, Host optionally overrides the Host + * header to send. If empty, the Request.Write method uses + * the value of URL.Host. Host may contain an international + * domain name. + */ + host: string + /** + * Form contains the parsed form data, including both the URL + * field's query parameters and the PATCH, POST, or PUT form data. + * This field is only available after ParseForm is called. + * The HTTP client ignores Form and uses Body instead. + */ + form: url.Values + /** + * PostForm contains the parsed form data from PATCH, POST + * or PUT body parameters. + * + * This field is only available after ParseForm is called. + * The HTTP client ignores PostForm and uses Body instead. + */ + postForm: url.Values + /** + * MultipartForm is the parsed multipart form, including file uploads. + * This field is only available after ParseMultipartForm is called. + * The HTTP client ignores MultipartForm and uses Body instead. + */ + multipartForm?: multipart.Form + /** + * Trailer specifies additional headers that are sent after the request + * body. + * + * For server requests, the Trailer map initially contains only the + * trailer keys, with nil values. (The client declares which trailers it + * will later send.) While the handler is reading from Body, it must + * not reference Trailer. After reading from Body returns EOF, Trailer + * can be read again and will contain non-nil values, if they were sent + * by the client. + * + * For client requests, Trailer must be initialized to a map containing + * the trailer keys to later send. The values may be nil or their final + * values. The ContentLength must be 0 or -1, to send a chunked request. + * After the HTTP request is sent the map values can be updated while + * the request body is read. Once the body returns EOF, the caller must + * not mutate Trailer. + * + * Few HTTP clients, servers, or proxies support HTTP trailers. + */ + trailer: Header + /** + * RemoteAddr allows HTTP servers and other software to record + * the network address that sent the request, usually for + * logging. This field is not filled in by ReadRequest and + * has no defined format. The HTTP server in this package + * sets RemoteAddr to an "IP:port" address before invoking a + * handler. + * This field is ignored by the HTTP client. + */ + remoteAddr: string + /** + * RequestURI is the unmodified request-target of the + * Request-Line (RFC 7230, Section 3.1.1) as sent by the client + * to a server. Usually the URL field should be used instead. + * It is an error to set this field in an HTTP client request. + */ + requestURI: string + /** + * TLS allows HTTP servers and other software to record + * information about the TLS connection on which the request + * was received. This field is not filled in by ReadRequest. + * The HTTP server in this package sets the field for + * TLS-enabled connections before invoking a handler; + * otherwise it leaves the field nil. + * This field is ignored by the HTTP client. + */ + tls?: any + /** + * Cancel is an optional channel whose closure indicates that the client + * request should be regarded as canceled. Not all implementations of + * RoundTripper may support Cancel. + * + * For server requests, this field is not applicable. + * + * Deprecated: Set the Request's context with NewRequestWithContext + * instead. If a Request's Cancel field and context are both + * set, it is undefined whether Cancel is respected. + */ + cancel: undefined + /** + * Response is the redirect response which caused this request + * to be created. This field is only populated during client + * redirects. + */ + response?: Response + /** + * Pattern is the [ServeMux] pattern that matched the request. + * It is empty if the request was not matched against a pattern. + */ + pattern: string + } + interface Request { + /** + * Context returns the request's context. To change the context, use + * [Request.Clone] or [Request.WithContext]. + * + * The returned context is always non-nil; it defaults to the + * background context. + * + * For outgoing client requests, the context controls cancellation. + * + * For incoming server requests, the context is canceled when the + * client's connection closes, the request is canceled (with HTTP/2), + * or when the ServeHTTP method returns. + */ + context(): context.Context + } + interface Request { + /** + * WithContext returns a shallow copy of r with its context changed + * to ctx. The provided ctx must be non-nil. + * + * For outgoing client request, the context controls the entire + * lifetime of a request and its response: obtaining a connection, + * sending the request, and reading the response headers and body. + * + * To create a new request with a context, use [NewRequestWithContext]. + * To make a deep copy of a request with a new context, use [Request.Clone]. + */ + withContext(ctx: context.Context): (Request) + } + interface Request { + /** + * Clone returns a deep copy of r with its context changed to ctx. + * The provided ctx must be non-nil. + * + * Clone only makes a shallow copy of the Body field. + * + * For an outgoing client request, the context controls the entire + * lifetime of a request and its response: obtaining a connection, + * sending the request, and reading the response headers and body. + */ + clone(ctx: context.Context): (Request) + } + interface Request { + /** + * ProtoAtLeast reports whether the HTTP protocol used + * in the request is at least major.minor. + */ + protoAtLeast(major: number, minor: number): boolean + } + interface Request { + /** + * UserAgent returns the client's User-Agent, if sent in the request. + */ + userAgent(): string + } + interface Request { + /** + * Cookies parses and returns the HTTP cookies sent with the request. + */ + cookies(): Array<(Cookie | undefined)> + } + interface Request { + /** + * CookiesNamed parses and returns the named HTTP cookies sent with the request + * or an empty slice if none matched. + */ + cookiesNamed(name: string): Array<(Cookie | undefined)> + } + interface Request { + /** + * Cookie returns the named cookie provided in the request or + * [ErrNoCookie] if not found. + * If multiple cookies match the given name, only one cookie will + * be returned. + */ + cookie(name: string): (Cookie) + } + interface Request { + /** + * AddCookie adds a cookie to the request. Per RFC 6265 section 5.4, + * AddCookie does not attach more than one [Cookie] header field. That + * means all cookies, if any, are written into the same line, + * separated by semicolon. + * AddCookie only sanitizes c's name and value, and does not sanitize + * a Cookie header already present in the request. + */ + addCookie(c: Cookie): void + } + interface Request { + /** + * Referer returns the referring URL, if sent in the request. + * + * Referer is misspelled as in the request itself, a mistake from the + * earliest days of HTTP. This value can also be fetched from the + * [Header] map as Header["Referer"]; the benefit of making it available + * as a method is that the compiler can diagnose programs that use the + * alternate (correct English) spelling req.Referrer() but cannot + * diagnose programs that use Header["Referrer"]. + */ + referer(): string + } + interface Request { + /** + * MultipartReader returns a MIME multipart reader if this is a + * multipart/form-data or a multipart/mixed POST request, else returns nil and an error. + * Use this function instead of [Request.ParseMultipartForm] to + * process the request body as a stream. + */ + multipartReader(): (multipart.Reader) + } + interface Request { + /** + * Write writes an HTTP/1.1 request, which is the header and body, in wire format. + * This method consults the following fields of the request: + * + * ``` + * Host + * URL + * Method (defaults to "GET") + * Header + * ContentLength + * TransferEncoding + * Body + * ``` + * + * If Body is present, Content-Length is <= 0 and [Request.TransferEncoding] + * hasn't been set to "identity", Write adds "Transfer-Encoding: + * chunked" to the header. Body is closed after it is sent. + */ + write(w: io.Writer): void + } + interface Request { + /** + * WriteProxy is like [Request.Write] but writes the request in the form + * expected by an HTTP proxy. In particular, [Request.WriteProxy] writes the + * initial Request-URI line of the request with an absolute URI, per + * section 5.3 of RFC 7230, including the scheme and host. + * In either case, WriteProxy also writes a Host header, using + * either r.Host or r.URL.Host. + */ + writeProxy(w: io.Writer): void + } + interface Request { + /** + * BasicAuth returns the username and password provided in the request's + * Authorization header, if the request uses HTTP Basic Authentication. + * See RFC 2617, Section 2. + */ + basicAuth(): [string, string, boolean] + } + interface Request { + /** + * SetBasicAuth sets the request's Authorization header to use HTTP + * Basic Authentication with the provided username and password. + * + * With HTTP Basic Authentication the provided username and password + * are not encrypted. It should generally only be used in an HTTPS + * request. + * + * The username may not contain a colon. Some protocols may impose + * additional requirements on pre-escaping the username and + * password. For instance, when used with OAuth2, both arguments must + * be URL encoded first with [url.QueryEscape]. + */ + setBasicAuth(username: string, password: string): void + } + interface Request { + /** + * ParseForm populates r.Form and r.PostForm. + * + * For all requests, ParseForm parses the raw query from the URL and updates + * r.Form. + * + * For POST, PUT, and PATCH requests, it also reads the request body, parses it + * as a form and puts the results into both r.PostForm and r.Form. Request body + * parameters take precedence over URL query string values in r.Form. + * + * If the request Body's size has not already been limited by [MaxBytesReader], + * the size is capped at 10MB. + * + * For other HTTP methods, or when the Content-Type is not + * application/x-www-form-urlencoded, the request Body is not read, and + * r.PostForm is initialized to a non-nil, empty value. + * + * [Request.ParseMultipartForm] calls ParseForm automatically. + * ParseForm is idempotent. + */ + parseForm(): void + } + interface Request { + /** + * ParseMultipartForm parses a request body as multipart/form-data. + * The whole request body is parsed and up to a total of maxMemory bytes of + * its file parts are stored in memory, with the remainder stored on + * disk in temporary files. + * ParseMultipartForm calls [Request.ParseForm] if necessary. + * If ParseForm returns an error, ParseMultipartForm returns it but also + * continues parsing the request body. + * After one call to ParseMultipartForm, subsequent calls have no effect. + */ + parseMultipartForm(maxMemory: number): void + } + interface Request { + /** + * FormValue returns the first value for the named component of the query. + * The precedence order: + * 1. application/x-www-form-urlencoded form body (POST, PUT, PATCH only) + * 2. query parameters (always) + * 3. multipart/form-data form body (always) + * + * FormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] + * if necessary and ignores any errors returned by these functions. + * If key is not present, FormValue returns the empty string. + * To access multiple values of the same key, call ParseForm and + * then inspect [Request.Form] directly. + */ + formValue(key: string): string + } + interface Request { + /** + * PostFormValue returns the first value for the named component of the POST, + * PUT, or PATCH request body. URL query parameters are ignored. + * PostFormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary and ignores + * any errors returned by these functions. + * If key is not present, PostFormValue returns the empty string. + */ + postFormValue(key: string): string + } + interface Request { + /** + * FormFile returns the first file for the provided form key. + * FormFile calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary. + */ + formFile(key: string): [multipart.File, (multipart.FileHeader)] + } + interface Request { + /** + * PathValue returns the value for the named path wildcard in the [ServeMux] pattern + * that matched the request. + * It returns the empty string if the request was not matched against a pattern + * or there is no such wildcard in the pattern. + */ + pathValue(name: string): string + } + interface Request { + /** + * SetPathValue sets name to value, so that subsequent calls to r.PathValue(name) + * return value. + */ + setPathValue(name: string, value: string): void + } + /** + * A Handler responds to an HTTP request. + * + * [Handler.ServeHTTP] should write reply headers and data to the [ResponseWriter] + * and then return. Returning signals that the request is finished; it + * is not valid to use the [ResponseWriter] or read from the + * [Request.Body] after or concurrently with the completion of the + * ServeHTTP call. + * + * Depending on the HTTP client software, HTTP protocol version, and + * any intermediaries between the client and the Go server, it may not + * be possible to read from the [Request.Body] after writing to the + * [ResponseWriter]. Cautious handlers should read the [Request.Body] + * first, and then reply. + * + * Except for reading the body, handlers should not modify the + * provided Request. + * + * If ServeHTTP panics, the server (the caller of ServeHTTP) assumes + * that the effect of the panic was isolated to the active request. + * It recovers the panic, logs a stack trace to the server error log, + * and either closes the network connection or sends an HTTP/2 + * RST_STREAM, depending on the HTTP protocol. To abort a handler so + * the client sees an interrupted response but the server doesn't log + * an error, panic with the value [ErrAbortHandler]. + */ + interface Handler { + [key:string]: any; + serveHTTP(_arg0: ResponseWriter, _arg1: Request): void + } + /** + * A ResponseWriter interface is used by an HTTP handler to + * construct an HTTP response. + * + * A ResponseWriter may not be used after [Handler.ServeHTTP] has returned. + */ + interface ResponseWriter { + [key:string]: any; + /** + * Header returns the header map that will be sent by + * [ResponseWriter.WriteHeader]. The [Header] map also is the mechanism with which + * [Handler] implementations can set HTTP trailers. + * + * Changing the header map after a call to [ResponseWriter.WriteHeader] (or + * [ResponseWriter.Write]) has no effect unless the HTTP status code was of the + * 1xx class or the modified headers are trailers. + * + * There are two ways to set Trailers. The preferred way is to + * predeclare in the headers which trailers you will later + * send by setting the "Trailer" header to the names of the + * trailer keys which will come later. In this case, those + * keys of the Header map are treated as if they were + * trailers. See the example. The second way, for trailer + * keys not known to the [Handler] until after the first [ResponseWriter.Write], + * is to prefix the [Header] map keys with the [TrailerPrefix] + * constant value. + * + * To suppress automatic response headers (such as "Date"), set + * their value to nil. + */ + header(): Header + /** + * Write writes the data to the connection as part of an HTTP reply. + * + * If [ResponseWriter.WriteHeader] has not yet been called, Write calls + * WriteHeader(http.StatusOK) before writing the data. If the Header + * does not contain a Content-Type line, Write adds a Content-Type set + * to the result of passing the initial 512 bytes of written data to + * [DetectContentType]. Additionally, if the total size of all written + * data is under a few KB and there are no Flush calls, the + * Content-Length header is added automatically. + * + * Depending on the HTTP protocol version and the client, calling + * Write or WriteHeader may prevent future reads on the + * Request.Body. For HTTP/1.x requests, handlers should read any + * needed request body data before writing the response. Once the + * headers have been flushed (due to either an explicit Flusher.Flush + * call or writing enough data to trigger a flush), the request body + * may be unavailable. For HTTP/2 requests, the Go HTTP server permits + * handlers to continue to read the request body while concurrently + * writing the response. However, such behavior may not be supported + * by all HTTP/2 clients. Handlers should read before writing if + * possible to maximize compatibility. + */ + write(_arg0: string|Array): number + /** + * WriteHeader sends an HTTP response header with the provided + * status code. + * + * If WriteHeader is not called explicitly, the first call to Write + * will trigger an implicit WriteHeader(http.StatusOK). + * Thus explicit calls to WriteHeader are mainly used to + * send error codes or 1xx informational responses. + * + * The provided code must be a valid HTTP 1xx-5xx status code. + * Any number of 1xx headers may be written, followed by at most + * one 2xx-5xx header. 1xx headers are sent immediately, but 2xx-5xx + * headers may be buffered. Use the Flusher interface to send + * buffered data. The header map is cleared when 2xx-5xx headers are + * sent, but not with 1xx headers. + * + * The server will automatically send a 100 (Continue) header + * on the first read from the request body if the request has + * an "Expect: 100-continue" header. + */ + writeHeader(statusCode: number): void + } + /** + * A Server defines parameters for running an HTTP server. + * The zero value for Server is a valid configuration. + */ + interface Server { + /** + * Addr optionally specifies the TCP address for the server to listen on, + * in the form "host:port". If empty, ":http" (port 80) is used. + * The service names are defined in RFC 6335 and assigned by IANA. + * See net.Dial for details of the address format. + */ + addr: string + handler: Handler // handler to invoke, http.DefaultServeMux if nil + /** + * DisableGeneralOptionsHandler, if true, passes "OPTIONS *" requests to the Handler, + * otherwise responds with 200 OK and Content-Length: 0. + */ + disableGeneralOptionsHandler: boolean + /** + * TLSConfig optionally provides a TLS configuration for use + * by ServeTLS and ListenAndServeTLS. Note that this value is + * cloned by ServeTLS and ListenAndServeTLS, so it's not + * possible to modify the configuration with methods like + * tls.Config.SetSessionTicketKeys. To use + * SetSessionTicketKeys, use Server.Serve with a TLS Listener + * instead. + */ + tlsConfig?: any + /** + * ReadTimeout is the maximum duration for reading the entire + * request, including the body. A zero or negative value means + * there will be no timeout. + * + * Because ReadTimeout does not let Handlers make per-request + * decisions on each request body's acceptable deadline or + * upload rate, most users will prefer to use + * ReadHeaderTimeout. It is valid to use them both. + */ + readTimeout: time.Duration + /** + * ReadHeaderTimeout is the amount of time allowed to read + * request headers. The connection's read deadline is reset + * after reading the headers and the Handler can decide what + * is considered too slow for the body. If zero, the value of + * ReadTimeout is used. If negative, or if zero and ReadTimeout + * is zero or negative, there is no timeout. + */ + readHeaderTimeout: time.Duration + /** + * WriteTimeout is the maximum duration before timing out + * writes of the response. It is reset whenever a new + * request's header is read. Like ReadTimeout, it does not + * let Handlers make decisions on a per-request basis. + * A zero or negative value means there will be no timeout. + */ + writeTimeout: time.Duration + /** + * IdleTimeout is the maximum amount of time to wait for the + * next request when keep-alives are enabled. If zero, the value + * of ReadTimeout is used. If negative, or if zero and ReadTimeout + * is zero or negative, there is no timeout. + */ + idleTimeout: time.Duration + /** + * MaxHeaderBytes controls the maximum number of bytes the + * server will read parsing the request header's keys and + * values, including the request line. It does not limit the + * size of the request body. + * If zero, DefaultMaxHeaderBytes is used. + */ + maxHeaderBytes: number + /** + * TLSNextProto optionally specifies a function to take over + * ownership of the provided TLS connection when an ALPN + * protocol upgrade has occurred. The map key is the protocol + * name negotiated. The Handler argument should be used to + * handle HTTP requests and will initialize the Request's TLS + * and RemoteAddr if not already set. The connection is + * automatically closed when the function returns. + * If TLSNextProto is not nil, HTTP/2 support is not enabled + * automatically. + */ + tlsNextProto: _TygojaDict + /** + * ConnState specifies an optional callback function that is + * called when a client connection changes state. See the + * ConnState type and associated constants for details. + */ + connState: (_arg0: net.Conn, _arg1: ConnState) => void + /** + * ErrorLog specifies an optional logger for errors accepting + * connections, unexpected behavior from handlers, and + * underlying FileSystem errors. + * If nil, logging is done via the log package's standard logger. + */ + errorLog?: any + /** + * BaseContext optionally specifies a function that returns + * the base context for incoming requests on this server. + * The provided Listener is the specific Listener that's + * about to start accepting requests. + * If BaseContext is nil, the default is context.Background(). + * If non-nil, it must return a non-nil context. + */ + baseContext: (_arg0: net.Listener) => context.Context + /** + * ConnContext optionally specifies a function that modifies + * the context used for a new connection c. The provided ctx + * is derived from the base context and has a ServerContextKey + * value. + */ + connContext: (ctx: context.Context, c: net.Conn) => context.Context + } + interface Server { + /** + * Close immediately closes all active net.Listeners and any + * connections in state [StateNew], [StateActive], or [StateIdle]. For a + * graceful shutdown, use [Server.Shutdown]. + * + * Close does not attempt to close (and does not even know about) + * any hijacked connections, such as WebSockets. + * + * Close returns any error returned from closing the [Server]'s + * underlying Listener(s). + */ + close(): void + } + interface Server { + /** + * Shutdown gracefully shuts down the server without interrupting any + * active connections. Shutdown works by first closing all open + * listeners, then closing all idle connections, and then waiting + * indefinitely for connections to return to idle and then shut down. + * If the provided context expires before the shutdown is complete, + * Shutdown returns the context's error, otherwise it returns any + * error returned from closing the [Server]'s underlying Listener(s). + * + * When Shutdown is called, [Serve], [ListenAndServe], and + * [ListenAndServeTLS] immediately return [ErrServerClosed]. Make sure the + * program doesn't exit and waits instead for Shutdown to return. + * + * Shutdown does not attempt to close nor wait for hijacked + * connections such as WebSockets. The caller of Shutdown should + * separately notify such long-lived connections of shutdown and wait + * for them to close, if desired. See [Server.RegisterOnShutdown] for a way to + * register shutdown notification functions. + * + * Once Shutdown has been called on a server, it may not be reused; + * future calls to methods such as Serve will return ErrServerClosed. + */ + shutdown(ctx: context.Context): void + } + interface Server { + /** + * RegisterOnShutdown registers a function to call on [Server.Shutdown]. + * This can be used to gracefully shutdown connections that have + * undergone ALPN protocol upgrade or that have been hijacked. + * This function should start protocol-specific graceful shutdown, + * but should not wait for shutdown to complete. + */ + registerOnShutdown(f: () => void): void + } + interface Server { + /** + * ListenAndServe listens on the TCP network address srv.Addr and then + * calls [Serve] to handle requests on incoming connections. + * Accepted connections are configured to enable TCP keep-alives. + * + * If srv.Addr is blank, ":http" is used. + * + * ListenAndServe always returns a non-nil error. After [Server.Shutdown] or [Server.Close], + * the returned error is [ErrServerClosed]. + */ + listenAndServe(): void + } + interface Server { + /** + * Serve accepts incoming connections on the Listener l, creating a + * new service goroutine for each. The service goroutines read requests and + * then call srv.Handler to reply to them. + * + * HTTP/2 support is only enabled if the Listener returns [*tls.Conn] + * connections and they were configured with "h2" in the TLS + * Config.NextProtos. + * + * Serve always returns a non-nil error and closes l. + * After [Server.Shutdown] or [Server.Close], the returned error is [ErrServerClosed]. + */ + serve(l: net.Listener): void + } + interface Server { + /** + * ServeTLS accepts incoming connections on the Listener l, creating a + * new service goroutine for each. The service goroutines perform TLS + * setup and then read requests, calling srv.Handler to reply to them. + * + * Files containing a certificate and matching private key for the + * server must be provided if neither the [Server]'s + * TLSConfig.Certificates, TLSConfig.GetCertificate nor + * config.GetConfigForClient are populated. + * If the certificate is signed by a certificate authority, the + * certFile should be the concatenation of the server's certificate, + * any intermediates, and the CA's certificate. + * + * ServeTLS always returns a non-nil error. After [Server.Shutdown] or [Server.Close], the + * returned error is [ErrServerClosed]. + */ + serveTLS(l: net.Listener, certFile: string, keyFile: string): void + } + interface Server { + /** + * SetKeepAlivesEnabled controls whether HTTP keep-alives are enabled. + * By default, keep-alives are always enabled. Only very + * resource-constrained environments or servers in the process of + * shutting down should disable them. + */ + setKeepAlivesEnabled(v: boolean): void + } + interface Server { + /** + * ListenAndServeTLS listens on the TCP network address srv.Addr and + * then calls [ServeTLS] to handle requests on incoming TLS connections. + * Accepted connections are configured to enable TCP keep-alives. + * + * Filenames containing a certificate and matching private key for the + * server must be provided if neither the [Server]'s TLSConfig.Certificates + * nor TLSConfig.GetCertificate are populated. If the certificate is + * signed by a certificate authority, the certFile should be the + * concatenation of the server's certificate, any intermediates, and + * the CA's certificate. + * + * If srv.Addr is blank, ":https" is used. + * + * ListenAndServeTLS always returns a non-nil error. After [Server.Shutdown] or + * [Server.Close], the returned error is [ErrServerClosed]. + */ + listenAndServeTLS(certFile: string, keyFile: string): void + } +} + +/** + * Package syntax parses regular expressions into parse trees and compiles + * parse trees into programs. Most clients of regular expressions will use the + * facilities of package [regexp] (such as [regexp.Compile] and [regexp.Match]) instead of this package. + * + * # Syntax + * + * The regular expression syntax understood by this package when parsing with the [Perl] flag is as follows. + * Parts of the syntax can be disabled by passing alternate flags to [Parse]. + * + * Single characters: + * + * ``` + * . any character, possibly including newline (flag s=true) + * [xyz] character class + * [^xyz] negated character class + * \d Perl character class + * \D negated Perl character class + * [[:alpha:]] ASCII character class + * [[:^alpha:]] negated ASCII character class + * \pN Unicode character class (one-letter name) + * \p{Greek} Unicode character class + * \PN negated Unicode character class (one-letter name) + * \P{Greek} negated Unicode character class + * ``` + * + * Composites: + * + * ``` + * xy x followed by y + * x|y x or y (prefer x) + * ``` + * + * Repetitions: + * + * ``` + * x* zero or more x, prefer more + * x+ one or more x, prefer more + * x? zero or one x, prefer one + * x{n,m} n or n+1 or ... or m x, prefer more + * x{n,} n or more x, prefer more + * x{n} exactly n x + * x*? zero or more x, prefer fewer + * x+? one or more x, prefer fewer + * x?? zero or one x, prefer zero + * x{n,m}? n or n+1 or ... or m x, prefer fewer + * x{n,}? n or more x, prefer fewer + * x{n}? exactly n x + * ``` + * + * Implementation restriction: The counting forms x{n,m}, x{n,}, and x{n} + * reject forms that create a minimum or maximum repetition count above 1000. + * Unlimited repetitions are not subject to this restriction. + * + * Grouping: + * + * ``` + * (re) numbered capturing group (submatch) + * (?Pre) named & numbered capturing group (submatch) + * (?re) named & numbered capturing group (submatch) + * (?:re) non-capturing group + * (?flags) set flags within current group; non-capturing + * (?flags:re) set flags during re; non-capturing + * + * Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). The flags are: + * + * i case-insensitive (default false) + * m multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) + * s let . match \n (default false) + * U ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) + * ``` + * + * Empty strings: + * + * ``` + * ^ at beginning of text or line (flag m=true) + * $ at end of text (like \z not \Z) or line (flag m=true) + * \A at beginning of text + * \b at ASCII word boundary (\w on one side and \W, \A, or \z on the other) + * \B not at ASCII word boundary + * \z at end of text + * ``` + * + * Escape sequences: + * + * ``` + * \a bell (== \007) + * \f form feed (== \014) + * \t horizontal tab (== \011) + * \n newline (== \012) + * \r carriage return (== \015) + * \v vertical tab character (== \013) + * \* literal *, for any punctuation character * + * \123 octal character code (up to three digits) + * \x7F hex character code (exactly two digits) + * \x{10FFFF} hex character code + * \Q...\E literal text ... even if ... has punctuation + * ``` + * + * Character class elements: + * + * ``` + * x single character + * A-Z character range (inclusive) + * \d Perl character class + * [:foo:] ASCII character class foo + * \p{Foo} Unicode character class Foo + * \pF Unicode character class F (one-letter name) + * ``` + * + * Named character classes as character class elements: + * + * ``` + * [\d] digits (== \d) + * [^\d] not digits (== \D) + * [\D] not digits (== \D) + * [^\D] not not digits (== \d) + * [[:name:]] named ASCII class inside character class (== [:name:]) + * [^[:name:]] named ASCII class inside negated character class (== [:^name:]) + * [\p{Name}] named Unicode property inside character class (== \p{Name}) + * [^\p{Name}] named Unicode property inside negated character class (== \P{Name}) + * ``` + * + * Perl character classes (all ASCII-only): + * + * ``` + * \d digits (== [0-9]) + * \D not digits (== [^0-9]) + * \s whitespace (== [\t\n\f\r ]) + * \S not whitespace (== [^\t\n\f\r ]) + * \w word characters (== [0-9A-Za-z_]) + * \W not word characters (== [^0-9A-Za-z_]) + * ``` + * + * ASCII character classes: + * + * ``` + * [[:alnum:]] alphanumeric (== [0-9A-Za-z]) + * [[:alpha:]] alphabetic (== [A-Za-z]) + * [[:ascii:]] ASCII (== [\x00-\x7F]) + * [[:blank:]] blank (== [\t ]) + * [[:cntrl:]] control (== [\x00-\x1F\x7F]) + * [[:digit:]] digits (== [0-9]) + * [[:graph:]] graphical (== [!-~] == [A-Za-z0-9!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]) + * [[:lower:]] lower case (== [a-z]) + * [[:print:]] printable (== [ -~] == [ [:graph:]]) + * [[:punct:]] punctuation (== [!-/:-@[-`{-~]) + * [[:space:]] whitespace (== [\t\n\v\f\r ]) + * [[:upper:]] upper case (== [A-Z]) + * [[:word:]] word characters (== [0-9A-Za-z_]) + * [[:xdigit:]] hex digit (== [0-9A-Fa-f]) + * ``` + * + * Unicode character classes are those in [unicode.Categories] and [unicode.Scripts]. + */ +namespace syntax { + /** + * Flags control the behavior of the parser and record information about regexp context. + */ + interface Flags extends Number{} +} + +namespace store { + /** + * Store defines a concurrent safe in memory key-value data store. + */ + interface Store { + } + interface Store { + /** + * Reset clears the store and replaces the store data with a + * shallow copy of the provided newData. + */ + reset(newData: _TygojaDict): void + } + interface Store { + /** + * Length returns the current number of elements in the store. + */ + length(): number + } + interface Store { + /** + * RemoveAll removes all the existing store entries. + */ + removeAll(): void + } + interface Store { + /** + * Remove removes a single entry from the store. + * + * Remove does nothing if key doesn't exist in the store. + */ + remove(key: string): void + } + interface Store { + /** + * Has checks if element with the specified key exist or not. + */ + has(key: string): boolean + } + interface Store { + /** + * Get returns a single element value from the store. + * + * If key is not set, the zero T value is returned. + */ + get(key: string): T + } + interface Store { + /** + * GetOk is similar to Get but returns also a boolean indicating whether the key exists or not. + */ + getOk(key: string): [T, boolean] + } + interface Store { + /** + * GetAll returns a shallow copy of the current store data. + */ + getAll(): _TygojaDict + } + interface Store { + /** + * Values returns a slice with all of the current store values. + */ + values(): Array + } + interface Store { + /** + * Set sets (or overwrite if already exist) a new value for key. + */ + set(key: string, value: T): void + } + interface Store { + /** + * GetOrSet retrieves a single existing value for the provided key + * or stores a new one if it doesn't exist. + */ + getOrSet(key: string, setFunc: () => T): T + } + interface Store { + /** + * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. + * + * This method is similar to Set() but **it will skip adding new elements** + * to the store if the store length has reached the specified limit. + * false is returned if maxAllowedElements limit is reached. + */ + setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean + } + interface Store { + /** + * UnmarshalJSON implements [json.Unmarshaler] and imports the + * provided JSON data into the store. + * + * The store entries that match with the ones from the data will be overwritten with the new value. + */ + unmarshalJSON(data: string|Array): void + } + interface Store { + /** + * MarshalJSON implements [json.Marshaler] and export the current + * store data into valid JSON. + */ + marshalJSON(): string|Array + } +} + /** * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html * @@ -16363,275 +16729,1381 @@ namespace jwt { } } -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { +namespace hook { /** - * DateTime represents a [time.Time] instance in UTC that is wrapped - * and serialized using the app default date layout. + * Event implements [Resolver] and it is intended to be used as a base + * Hook event that you can embed in your custom typed event structs. + * + * Example: + * + * ``` + * type CustomEvent struct { + * hook.Event + * + * SomeField int + * } + * ``` */ - interface DateTime { + interface Event { } - interface DateTime { + interface Event { /** - * Time returns the internal [time.Time] instance. + * Next calls the next hook handler. */ - time(): time.Time - } - interface DateTime { - /** - * Add returns a new DateTime based on the current DateTime + the specified duration. - */ - add(duration: time.Duration): DateTime - } - interface DateTime { - /** - * Sub returns a [time.Duration] by subtracting the specified DateTime from the current one. - * - * If the result exceeds the maximum (or minimum) value that can be stored in a [time.Duration], - * the maximum (or minimum) duration will be returned. - */ - sub(u: DateTime): time.Duration - } - interface DateTime { - /** - * AddDate returns a new DateTime based on the current one + duration. - * - * It follows the same rules as [time.AddDate]. - */ - addDate(years: number, months: number, days: number): DateTime - } - interface DateTime { - /** - * After reports whether the current DateTime instance is after u. - */ - after(u: DateTime): boolean - } - interface DateTime { - /** - * Before reports whether the current DateTime instance is before u. - */ - before(u: DateTime): boolean - } - interface DateTime { - /** - * Compare compares the current DateTime instance with u. - * If the current instance is before u, it returns -1. - * If the current instance is after u, it returns +1. - * If they're the same, it returns 0. - */ - compare(u: DateTime): number - } - interface DateTime { - /** - * Equal reports whether the current DateTime and u represent the same time instant. - * Two DateTime can be equal even if they are in different locations. - * For example, 6:00 +0200 and 4:00 UTC are Equal. - */ - equal(u: DateTime): boolean - } - interface DateTime { - /** - * Unix returns the current DateTime as a Unix time, aka. - * the number of seconds elapsed since January 1, 1970 UTC. - */ - unix(): number - } - interface DateTime { - /** - * IsZero checks whether the current DateTime instance has zero time value. - */ - isZero(): boolean - } - interface DateTime { - /** - * String serializes the current DateTime instance into a formatted - * UTC date string. - * - * The zero value is serialized to an empty string. - */ - string(): string - } - interface DateTime { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface DateTime { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(b: string|Array): void - } - interface DateTime { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface DateTime { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current DateTime instance. - */ - scan(value: any): void + next(): void } /** - * JSONArray defines a slice that is safe for json and db read/write. + * Handler defines a single Hook handler. + * Multiple handlers can share the same id. + * If Id is not explicitly set it will be autogenerated by Hook.Add and Hook.AddHandler. */ - interface JSONArray extends Array{} - interface JSONArray { + interface Handler { /** - * MarshalJSON implements the [json.Marshaler] interface. + * Func defines the handler function to execute. + * + * Note that users need to call e.Next() in order to proceed with + * the execution of the hook chain. */ - marshalJSON(): string|Array - } - interface JSONArray { + func: (_arg0: T) => void /** - * String returns the string representation of the current json array. + * Id is the unique identifier of the handler. + * + * It could be used later to remove the handler from a hook via [Hook.Remove]. + * + * If missing, an autogenerated value will be assigned when adding + * the handler to a hook. */ - string(): string - } - interface JSONArray { + id: string /** - * Value implements the [driver.Valuer] interface. + * Priority allows changing the default exec priority of the handler within a hook. + * + * If 0, the handler will be executed in the same order it was registered. */ - value(): any - } - interface JSONArray { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JSONArray[T] instance. - */ - scan(value: any): void + priority: number } /** - * JSONMap defines a map that is safe for json and db read/write. + * Hook defines a generic concurrent safe structure for managing event hooks. + * + * When using custom event it must embed the base [hook.Event]. + * + * Example: + * + * ``` + * type CustomEvent struct { + * hook.Event + * SomeField int + * } + * + * h := Hook[*CustomEvent]{} + * + * h.BindFunc(func(e *CustomEvent) error { + * println(e.SomeField) + * + * return e.Next() + * }) + * + * h.Trigger(&CustomEvent{ SomeField: 123 }) + * ``` */ - interface JSONMap extends _TygojaDict{} - interface JSONMap { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array + interface Hook { } - interface JSONMap { + interface Hook { /** - * String returns the string representation of the current json map. - */ - string(): string - } - interface JSONMap { - /** - * Get retrieves a single value from the current JSONMap[T]. + * Bind registers the provided handler to the current hooks queue. * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). - */ - get(key: string): T - } - interface JSONMap { - /** - * Set sets a single value in the current JSONMap[T]. + * If handler.Id is empty it is updated with autogenerated value. * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + * If a handler from the current hook list has Id matching handler.Id + * then the old handler is replaced with the new one. */ - set(key: string, value: T): void + bind(handler: Handler): string } - interface JSONMap { + interface Hook { /** - * Value implements the [driver.Valuer] interface. + * BindFunc is similar to Bind but registers a new handler from just the provided function. + * + * The registered handler is added with a default 0 priority and the id will be autogenerated. + * + * If you want to register a handler with custom priority or id use the [Hook.Bind] method. */ - value(): any + bindFunc(fn: (e: T) => void): string } - interface JSONMap { + interface Hook { /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JSONMap[T] instance. + * Unbind removes one or many hook handler by their id. */ - scan(value: any): void + unbind(...idsToRemove: string[]): void + } + interface Hook { + /** + * UnbindAll removes all registered handlers. + */ + unbindAll(): void + } + interface Hook { + /** + * Length returns to total number of registered hook handlers. + */ + length(): number + } + interface Hook { + /** + * Trigger executes all registered hook handlers one by one + * with the specified event as an argument. + * + * Optionally, this method allows also to register additional one off + * handler funcs that will be temporary appended to the handlers queue. + * + * NB! Each hook handler must call event.Next() in order the hook chain to proceed. + */ + trigger(event: T, ...oneOffHandlerFuncs: ((_arg0: T) => void)[]): void } /** - * JSONRaw defines a json value type that is safe for db read/write. + * TaggedHook defines a proxy hook which register handlers that are triggered only + * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). */ - interface JSONRaw extends Array{} - interface JSONRaw { - /** - * String returns the current JSONRaw instance as a json encoded string. - */ - string(): string + type _subpbiJy = mainHook + interface TaggedHook extends _subpbiJy { } - interface JSONRaw { + interface TaggedHook { /** - * MarshalJSON implements the [json.Marshaler] interface. + * CanTriggerOn checks if the current TaggedHook can be triggered with + * the provided event data tags. + * + * It returns always true if the hook doens't have any tags. */ - marshalJSON(): string|Array + canTriggerOn(tagsToCheck: Array): boolean } - interface JSONRaw { + interface TaggedHook { /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. + * Bind registers the provided handler to the current hooks queue. + * + * It is similar to [Hook.Bind] with the difference that the handler + * function is invoked only if the event data tags satisfy h.CanTriggerOn. */ - unmarshalJSON(b: string|Array): void + bind(handler: Handler): string } - interface JSONRaw { + interface TaggedHook { /** - * Value implements the [driver.Valuer] interface. + * BindFunc registers a new handler with the specified function. + * + * It is similar to [Hook.Bind] with the difference that the handler + * function is invoked only if the event data tags satisfy h.CanTriggerOn. */ - value(): any - } - interface JSONRaw { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JSONRaw instance. - */ - scan(value: any): void + bindFunc(fn: (e: T) => void): string } } -namespace search { +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the [path/filepath] package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + * + * # Executables in the current directory + * + * The functions [Command] and [LookPath] look for a program + * in the directories listed in the current path, following the + * conventions of the host operating system. + * Operating systems have for decades included the current + * directory in this search, sometimes implicitly and sometimes + * configured explicitly that way by default. + * Modern practice is that including the current directory + * is usually unexpected and often leads to security problems. + * + * To avoid those security problems, as of Go 1.19, this package will not resolve a program + * using an implicit or explicit path entry relative to the current directory. + * That is, if you run [LookPath]("go"), it will not successfully return + * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. + * Instead, if the usual path algorithms would result in that answer, + * these functions return an error err satisfying [errors.Is](err, [ErrDot]). + * + * For example, consider these two program snippets: + * + * ``` + * path, err := exec.LookPath("prog") + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * These will not find and run ./prog or .\prog.exe, + * no matter how the current path is configured. + * + * Code that always wants to run a program from the current directory + * can be rewritten to say "./prog" instead of "prog". + * + * Code that insists on including results from relative path entries + * can instead override the error using an errors.Is check: + * + * ``` + * path, err := exec.LookPath("prog") + * if errors.Is(err, exec.ErrDot) { + * err = nil + * } + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if errors.Is(cmd.Err, exec.ErrDot) { + * cmd.Err = nil + * } + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * Setting the environment variable GODEBUG=execerrdot=0 + * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 + * behavior for programs that are unable to apply more targeted fixes. + * A future version of Go may remove support for this variable. + * + * Before adding such overrides, make sure you understand the + * security implications of doing so. + * See https://go.dev/blog/path-security for more information. + */ +namespace exec { /** - * Result defines the returned search result structure. + * Cmd represents an external command being prepared or run. + * + * A Cmd cannot be reused after calling its [Cmd.Run], [Cmd.Output] or [Cmd.CombinedOutput] + * methods. */ - interface Result { - items: any - page: number - perPage: number - totalItems: number - totalPages: number + interface Cmd { + /** + * Path is the path of the command to run. + * + * This is the only field that must be set to a non-zero + * value. If Path is relative, it is evaluated relative + * to Dir. + */ + path: string + /** + * Args holds command line arguments, including the command as Args[0]. + * If the Args field is empty or nil, Run uses {Path}. + * + * In typical use, both Path and Args are set by calling Command. + */ + args: Array + /** + * Env specifies the environment of the process. + * Each entry is of the form "key=value". + * If Env is nil, the new process uses the current process's + * environment. + * If Env contains duplicate environment keys, only the last + * value in the slice for each duplicate key is used. + * As a special case on Windows, SYSTEMROOT is always added if + * missing and not explicitly set to the empty string. + */ + env: Array + /** + * Dir specifies the working directory of the command. + * If Dir is the empty string, Run runs the command in the + * calling process's current directory. + */ + dir: string + /** + * Stdin specifies the process's standard input. + * + * If Stdin is nil, the process reads from the null device (os.DevNull). + * + * If Stdin is an *os.File, the process's standard input is connected + * directly to that file. + * + * Otherwise, during the execution of the command a separate + * goroutine reads from Stdin and delivers that data to the command + * over a pipe. In this case, Wait does not complete until the goroutine + * stops copying, either because it has reached the end of Stdin + * (EOF or a read error), or because writing to the pipe returned an error, + * or because a nonzero WaitDelay was set and expired. + */ + stdin: io.Reader + /** + * Stdout and Stderr specify the process's standard output and error. + * + * If either is nil, Run connects the corresponding file descriptor + * to the null device (os.DevNull). + * + * If either is an *os.File, the corresponding output from the process + * is connected directly to that file. + * + * Otherwise, during the execution of the command a separate goroutine + * reads from the process over a pipe and delivers that data to the + * corresponding Writer. In this case, Wait does not complete until the + * goroutine reaches EOF or encounters an error or a nonzero WaitDelay + * expires. + * + * If Stdout and Stderr are the same writer, and have a type that can + * be compared with ==, at most one goroutine at a time will call Write. + */ + stdout: io.Writer + stderr: io.Writer + /** + * ExtraFiles specifies additional open files to be inherited by the + * new process. It does not include standard input, standard output, or + * standard error. If non-nil, entry i becomes file descriptor 3+i. + * + * ExtraFiles is not supported on Windows. + */ + extraFiles: Array<(os.File | undefined)> + /** + * SysProcAttr holds optional, operating system-specific attributes. + * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. + */ + sysProcAttr?: syscall.SysProcAttr + /** + * Process is the underlying process, once started. + */ + process?: os.Process + /** + * ProcessState contains information about an exited process. + * If the process was started successfully, Wait or Run will + * populate its ProcessState when the command completes. + */ + processState?: os.ProcessState + err: Error // LookPath error, if any. + /** + * If Cancel is non-nil, the command must have been created with + * CommandContext and Cancel will be called when the command's + * Context is done. By default, CommandContext sets Cancel to + * call the Kill method on the command's Process. + * + * Typically a custom Cancel will send a signal to the command's + * Process, but it may instead take other actions to initiate cancellation, + * such as closing a stdin or stdout pipe or sending a shutdown request on a + * network socket. + * + * If the command exits with a success status after Cancel is + * called, and Cancel does not return an error equivalent to + * os.ErrProcessDone, then Wait and similar methods will return a non-nil + * error: either an error wrapping the one returned by Cancel, + * or the error from the Context. + * (If the command exits with a non-success status, or Cancel + * returns an error that wraps os.ErrProcessDone, Wait and similar methods + * continue to return the command's usual exit status.) + * + * If Cancel is set to nil, nothing will happen immediately when the command's + * Context is done, but a nonzero WaitDelay will still take effect. That may + * be useful, for example, to work around deadlocks in commands that do not + * support shutdown signals but are expected to always finish quickly. + * + * Cancel will not be called if Start returns a non-nil error. + */ + cancel: () => void + /** + * If WaitDelay is non-zero, it bounds the time spent waiting on two sources + * of unexpected delay in Wait: a child process that fails to exit after the + * associated Context is canceled, and a child process that exits but leaves + * its I/O pipes unclosed. + * + * The WaitDelay timer starts when either the associated Context is done or a + * call to Wait observes that the child process has exited, whichever occurs + * first. When the delay has elapsed, the command shuts down the child process + * and/or its I/O pipes. + * + * If the child process has failed to exit — perhaps because it ignored or + * failed to receive a shutdown signal from a Cancel function, or because no + * Cancel function was set — then it will be terminated using os.Process.Kill. + * + * Then, if the I/O pipes communicating with the child process are still open, + * those pipes are closed in order to unblock any goroutines currently blocked + * on Read or Write calls. + * + * If pipes are closed due to WaitDelay, no Cancel call has occurred, + * and the command has otherwise exited with a successful status, Wait and + * similar methods will return ErrWaitDelay instead of nil. + * + * If WaitDelay is zero (the default), I/O pipes will be read until EOF, + * which might not occur until orphaned subprocesses of the command have + * also closed their descriptors for the pipes. + */ + waitDelay: time.Duration + } + interface Cmd { + /** + * String returns a human-readable description of c. + * It is intended only for debugging. + * In particular, it is not suitable for use as input to a shell. + * The output of String may vary across Go releases. + */ + string(): string + } + interface Cmd { + /** + * Run starts the specified command and waits for it to complete. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command starts but does not complete successfully, the error is of + * type [*ExitError]. Other error types may be returned for other situations. + * + * If the calling goroutine has locked the operating system thread + * with [runtime.LockOSThread] and modified any inheritable OS-level + * thread state (for example, Linux or Plan 9 name spaces), the new + * process will inherit the caller's thread state. + */ + run(): void + } + interface Cmd { + /** + * Start starts the specified command but does not wait for it to complete. + * + * If Start returns successfully, the c.Process field will be set. + * + * After a successful call to Start the [Cmd.Wait] method must be called in + * order to release associated system resources. + */ + start(): void + } + interface Cmd { + /** + * Wait waits for the command to exit and waits for any copying to + * stdin or copying from stdout or stderr to complete. + * + * The command must have been started by [Cmd.Start]. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command fails to run or doesn't complete successfully, the + * error is of type [*ExitError]. Other error types may be + * returned for I/O problems. + * + * If any of c.Stdin, c.Stdout or c.Stderr are not an [*os.File], Wait also waits + * for the respective I/O loop copying to or from the process to complete. + * + * Wait releases any resources associated with the [Cmd]. + */ + wait(): void + } + interface Cmd { + /** + * Output runs the command and returns its standard output. + * Any returned error will usually be of type [*ExitError]. + * If c.Stderr was nil, Output populates [ExitError.Stderr]. + */ + output(): string|Array + } + interface Cmd { + /** + * CombinedOutput runs the command and returns its combined standard + * output and standard error. + */ + combinedOutput(): string|Array + } + interface Cmd { + /** + * StdinPipe returns a pipe that will be connected to the command's + * standard input when the command starts. + * The pipe will be closed automatically after [Cmd.Wait] sees the command exit. + * A caller need only call Close to force the pipe to close sooner. + * For example, if the command being run will not exit until standard input + * is closed, the caller must close the pipe. + */ + stdinPipe(): io.WriteCloser + } + interface Cmd { + /** + * StdoutPipe returns a pipe that will be connected to the command's + * standard output when the command starts. + * + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to call [Cmd.Run] when using StdoutPipe. + * See the example for idiomatic usage. + */ + stdoutPipe(): io.ReadCloser + } + interface Cmd { + /** + * StderrPipe returns a pipe that will be connected to the command's + * standard error when the command starts. + * + * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to use [Cmd.Run] when using StderrPipe. + * See the StdoutPipe example for idiomatic usage. + */ + stderrPipe(): io.ReadCloser + } + interface Cmd { + /** + * Environ returns a copy of the environment in which the command would be run + * as it is currently configured. + */ + environ(): Array + } +} + +namespace mailer { + /** + * Message defines a generic email message struct. + */ + interface Message { + from: { address: string; name?: string; } + to: Array<{ address: string; name?: string; }> + bcc: Array<{ address: string; name?: string; }> + cc: Array<{ address: string; name?: string; }> + subject: string + html: string + text: string + headers: _TygojaDict + attachments: _TygojaDict } /** - * ResolverResult defines a single FieldResolver.Resolve() successfully parsed result. + * Mailer defines a base mail client interface. */ - interface ResolverResult { + interface Mailer { + [key:string]: any; /** - * Identifier is the plain SQL identifier/column that will be used - * in the final db expression as left or right operand. + * Send sends an email with the provided Message. */ - identifier: string + send(message: Message): void + } +} + +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a [TextHandler] + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.InfoContext(ctx, "hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(logger *slog.Logger, format string, args ...any) { + * logger.Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that exactly one [Record] is written at a time in its entirety. + * Although each log record has a timestamp, + * the built-in handlers do not use that time to sort the written records. + * User-defined handlers are responsible for their own locking and sorting. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + // @ts-ignore + import loginternal = internal + /** + * A Logger records structured information about each call to its + * Log, Debug, Info, Warn, and Error methods. + * For each call, it creates a [Record] and passes it to a [Handler]. + * + * To create a new Logger, call [New] or a Logger method + * that begins "With". + */ + interface Logger { + } + interface Logger { /** - * NoCoalesce instructs to not use COALESCE or NULL fallbacks - * when building the identifier expression. + * Handler returns l's Handler. */ - noCoalesce: boolean + handler(): Handler + } + interface Logger { /** - * Params is a map with db placeholder->value pairs that will be added - * to the query when building both resolved operands/sides in a single expression. + * With returns a Logger that includes the given attributes + * in each output operation. Arguments are converted to + * attributes as if by [Logger.Log]. */ - params: dbx.Params + with(...args: any[]): (Logger) + } + interface Logger { /** - * MultiMatchSubQuery is an optional sub query expression that will be added - * in addition to the combined ResolverResult expression during build. + * WithGroup returns a Logger that starts a group, if name is non-empty. + * The keys of all attributes added to the Logger will be qualified by the given + * name. (How that qualification happens depends on the [Handler.WithGroup] + * method of the Logger's Handler.) + * + * If name is empty, WithGroup returns the receiver. */ - multiMatchSubQuery: dbx.Expression + withGroup(name: string): (Logger) + } + interface Logger { /** - * AfterBuild is an optional function that will be called after building - * and combining the result of both resolved operands/sides in a single expression. + * Enabled reports whether l emits log records at the given context and level. */ - afterBuild: (expr: dbx.Expression) => dbx.Expression + enabled(ctx: context.Context, level: Level): boolean + } + interface Logger { + /** + * Log emits a log record with the current time and the given level and message. + * The Record's Attrs consist of the Logger's attributes followed by + * the Attrs specified by args. + * + * The attribute arguments are processed as follows: + * ``` + * - If an argument is an Attr, it is used as is. + * - If an argument is a string and this is not the last argument, + * the following argument is treated as the value and the two are combined + * into an Attr. + * - Otherwise, the argument is treated as a value with key "!BADKEY". + * ``` + */ + log(ctx: context.Context, level: Level, msg: string, ...args: any[]): void + } + interface Logger { + /** + * LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs. + */ + logAttrs(ctx: context.Context, level: Level, msg: string, ...attrs: Attr[]): void + } + interface Logger { + /** + * Debug logs at [LevelDebug]. + */ + debug(msg: string, ...args: any[]): void + } + interface Logger { + /** + * DebugContext logs at [LevelDebug] with the given context. + */ + debugContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Info logs at [LevelInfo]. + */ + info(msg: string, ...args: any[]): void + } + interface Logger { + /** + * InfoContext logs at [LevelInfo] with the given context. + */ + infoContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Warn logs at [LevelWarn]. + */ + warn(msg: string, ...args: any[]): void + } + interface Logger { + /** + * WarnContext logs at [LevelWarn] with the given context. + */ + warnContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Error logs at [LevelError]. + */ + error(msg: string, ...args: any[]): void + } + interface Logger { + /** + * ErrorContext logs at [LevelError] with the given context. + */ + errorContext(ctx: context.Context, msg: string, ...args: any[]): void + } +} + +/** + * Package cron implements a crontab-like service to execute and schedule + * repeative tasks/jobs. + * + * Example: + * + * ``` + * c := cron.New() + * c.MustAdd("dailyReport", "0 0 * * *", func() { ... }) + * c.Start() + * ``` + */ +namespace cron { + /** + * Cron is a crontab-like struct for tasks/jobs scheduling. + */ + interface Cron { + } + interface Cron { + /** + * SetInterval changes the current cron tick interval + * (it usually should be >= 1 minute). + */ + setInterval(d: time.Duration): void + } + interface Cron { + /** + * SetTimezone changes the current cron tick timezone. + */ + setTimezone(l: time.Location): void + } + interface Cron { + /** + * MustAdd is similar to Add() but panic on failure. + */ + mustAdd(jobId: string, cronExpr: string, run: () => void): void + } + interface Cron { + /** + * Add registers a single cron job. + * + * If there is already a job with the provided id, then the old job + * will be replaced with the new one. + * + * cronExpr is a regular cron expression, eg. "0 *\/3 * * *" (aka. at minute 0 past every 3rd hour). + * Check cron.NewSchedule() for the supported tokens. + */ + add(jobId: string, cronExpr: string, run: () => void): void + } + interface Cron { + /** + * Remove removes a single cron job by its id. + */ + remove(jobId: string): void + } + interface Cron { + /** + * RemoveAll removes all registered cron jobs. + */ + removeAll(): void + } + interface Cron { + /** + * Total returns the current total number of registered cron jobs. + */ + total(): number + } + interface Cron { + /** + * Stop stops the current cron ticker (if not already). + * + * You can resume the ticker by calling Start(). + */ + stop(): void + } + interface Cron { + /** + * Start starts the cron ticker. + * + * Calling Start() on already started cron will restart the ticker. + */ + start(): void + } + interface Cron { + /** + * HasStarted checks whether the current Cron ticker has been started. + */ + hasStarted(): boolean + } +} + +/** + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. + */ +namespace blob { + /** + * Reader reads bytes from a blob. + * It implements io.ReadSeekCloser, and must be closed after + * reads are finished. + */ + interface Reader { + } + interface Reader { + /** + * Read implements io.Reader (https://golang.org/pkg/io/#Reader). + */ + read(p: string|Array): number + } + interface Reader { + /** + * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). + */ + seek(offset: number, whence: number): number + } + interface Reader { + /** + * Close implements io.Closer (https://golang.org/pkg/io/#Closer). + */ + close(): void + } + interface Reader { + /** + * ContentType returns the MIME type of the blob. + */ + contentType(): string + } + interface Reader { + /** + * ModTime returns the time the blob was last modified. + */ + modTime(): time.Time + } + interface Reader { + /** + * Size returns the size of the blob content in bytes. + */ + size(): number + } + interface Reader { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean + } + interface Reader { + /** + * WriteTo reads from r and writes to w until there's no more data or + * an error occurs. + * The return value is the number of bytes written to w. + * + * It implements the io.WriterTo interface. + */ + writeTo(w: io.Writer): number + } + /** + * Attributes contains attributes about a blob. + */ + interface Attributes { + /** + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + */ + cacheControl: string + /** + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition + */ + contentDisposition: string + /** + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + */ + contentEncoding: string + /** + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language + */ + contentLanguage: string + /** + * ContentType is the MIME type of the blob. It will not be empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type + */ + contentType: string + /** + * Metadata holds key/value pairs associated with the blob. + * Keys are guaranteed to be in lowercase, even if the backend service + * has case-sensitive keys (although note that Metadata written via + * this package will always be lowercased). If there are duplicate + * case-insensitive keys (e.g., "foo" and "FOO"), only one value + * will be kept, and it is undefined which one. + */ + metadata: _TygojaDict + /** + * CreateTime is the time the blob was created, if available. If not available, + * CreateTime will be the zero time. + */ + createTime: time.Time + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string|Array + /** + * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. + */ + eTag: string + } + interface Attributes { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean + } + /** + * ListObject represents a single blob returned from List. + */ + interface ListObject { + /** + * Key is the key for this blob. + */ + key: string + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string|Array + /** + * IsDir indicates that this result represents a "directory" in the + * hierarchical namespace, ending in ListOptions.Delimiter. Key can be + * passed as ListOptions.Prefix to list items in the "directory". + * Fields other than Key and IsDir will not be set if IsDir is true. + */ + isDir: boolean + } + interface ListObject { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean } } @@ -17704,2686 +19176,949 @@ namespace cobra { } /** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the [path/filepath] package's Glob function. - * To expand environment variables, use package os's ExpandEnv. + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. + * Drivers that do not support context cancellation will not return until + * after the query is completed. * - * # Executables in the current directory - * - * The functions [Command] and [LookPath] look for a program - * in the directories listed in the current path, following the - * conventions of the host operating system. - * Operating systems have for decades included the current - * directory in this search, sometimes implicitly and sometimes - * configured explicitly that way by default. - * Modern practice is that including the current directory - * is usually unexpected and often leads to security problems. - * - * To avoid those security problems, as of Go 1.19, this package will not resolve a program - * using an implicit or explicit path entry relative to the current directory. - * That is, if you run [LookPath]("go"), it will not successfully return - * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. - * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying [errors.Is](err, [ErrDot]). - * - * For example, consider these two program snippets: - * - * ``` - * path, err := exec.LookPath("prog") - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * These will not find and run ./prog or .\prog.exe, - * no matter how the current path is configured. - * - * Code that always wants to run a program from the current directory - * can be rewritten to say "./prog" instead of "prog". - * - * Code that insists on including results from relative path entries - * can instead override the error using an errors.Is check: - * - * ``` - * path, err := exec.LookPath("prog") - * if errors.Is(err, exec.ErrDot) { - * err = nil - * } - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if errors.Is(cmd.Err, exec.ErrDot) { - * cmd.Err = nil - * } - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * Setting the environment variable GODEBUG=execerrdot=0 - * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 - * behavior for programs that are unable to apply more targeted fixes. - * A future version of Go may remove support for this variable. - * - * Before adding such overrides, make sure you understand the - * security implications of doing so. - * See https://go.dev/blog/path-security for more information. + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. */ -namespace exec { +namespace sql { /** - * Cmd represents an external command being prepared or run. - * - * A Cmd cannot be reused after calling its [Cmd.Run], [Cmd.Output] or [Cmd.CombinedOutput] - * methods. + * TxOptions holds the transaction options to be used in [DB.BeginTx]. */ - interface Cmd { + interface TxOptions { /** - * Path is the path of the command to run. - * - * This is the only field that must be set to a non-zero - * value. If Path is relative, it is evaluated relative - * to Dir. + * Isolation is the transaction isolation level. + * If zero, the driver or database's default level is used. */ - path: string - /** - * Args holds command line arguments, including the command as Args[0]. - * If the Args field is empty or nil, Run uses {Path}. - * - * In typical use, both Path and Args are set by calling Command. - */ - args: Array - /** - * Env specifies the environment of the process. - * Each entry is of the form "key=value". - * If Env is nil, the new process uses the current process's - * environment. - * If Env contains duplicate environment keys, only the last - * value in the slice for each duplicate key is used. - * As a special case on Windows, SYSTEMROOT is always added if - * missing and not explicitly set to the empty string. - */ - env: Array - /** - * Dir specifies the working directory of the command. - * If Dir is the empty string, Run runs the command in the - * calling process's current directory. - */ - dir: string - /** - * Stdin specifies the process's standard input. - * - * If Stdin is nil, the process reads from the null device (os.DevNull). - * - * If Stdin is an *os.File, the process's standard input is connected - * directly to that file. - * - * Otherwise, during the execution of the command a separate - * goroutine reads from Stdin and delivers that data to the command - * over a pipe. In this case, Wait does not complete until the goroutine - * stops copying, either because it has reached the end of Stdin - * (EOF or a read error), or because writing to the pipe returned an error, - * or because a nonzero WaitDelay was set and expired. - */ - stdin: io.Reader - /** - * Stdout and Stderr specify the process's standard output and error. - * - * If either is nil, Run connects the corresponding file descriptor - * to the null device (os.DevNull). - * - * If either is an *os.File, the corresponding output from the process - * is connected directly to that file. - * - * Otherwise, during the execution of the command a separate goroutine - * reads from the process over a pipe and delivers that data to the - * corresponding Writer. In this case, Wait does not complete until the - * goroutine reaches EOF or encounters an error or a nonzero WaitDelay - * expires. - * - * If Stdout and Stderr are the same writer, and have a type that can - * be compared with ==, at most one goroutine at a time will call Write. - */ - stdout: io.Writer - stderr: io.Writer - /** - * ExtraFiles specifies additional open files to be inherited by the - * new process. It does not include standard input, standard output, or - * standard error. If non-nil, entry i becomes file descriptor 3+i. - * - * ExtraFiles is not supported on Windows. - */ - extraFiles: Array<(os.File | undefined)> - /** - * SysProcAttr holds optional, operating system-specific attributes. - * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. - */ - sysProcAttr?: syscall.SysProcAttr - /** - * Process is the underlying process, once started. - */ - process?: os.Process - /** - * ProcessState contains information about an exited process. - * If the process was started successfully, Wait or Run will - * populate its ProcessState when the command completes. - */ - processState?: os.ProcessState - err: Error // LookPath error, if any. - /** - * If Cancel is non-nil, the command must have been created with - * CommandContext and Cancel will be called when the command's - * Context is done. By default, CommandContext sets Cancel to - * call the Kill method on the command's Process. - * - * Typically a custom Cancel will send a signal to the command's - * Process, but it may instead take other actions to initiate cancellation, - * such as closing a stdin or stdout pipe or sending a shutdown request on a - * network socket. - * - * If the command exits with a success status after Cancel is - * called, and Cancel does not return an error equivalent to - * os.ErrProcessDone, then Wait and similar methods will return a non-nil - * error: either an error wrapping the one returned by Cancel, - * or the error from the Context. - * (If the command exits with a non-success status, or Cancel - * returns an error that wraps os.ErrProcessDone, Wait and similar methods - * continue to return the command's usual exit status.) - * - * If Cancel is set to nil, nothing will happen immediately when the command's - * Context is done, but a nonzero WaitDelay will still take effect. That may - * be useful, for example, to work around deadlocks in commands that do not - * support shutdown signals but are expected to always finish quickly. - * - * Cancel will not be called if Start returns a non-nil error. - */ - cancel: () => void - /** - * If WaitDelay is non-zero, it bounds the time spent waiting on two sources - * of unexpected delay in Wait: a child process that fails to exit after the - * associated Context is canceled, and a child process that exits but leaves - * its I/O pipes unclosed. - * - * The WaitDelay timer starts when either the associated Context is done or a - * call to Wait observes that the child process has exited, whichever occurs - * first. When the delay has elapsed, the command shuts down the child process - * and/or its I/O pipes. - * - * If the child process has failed to exit — perhaps because it ignored or - * failed to receive a shutdown signal from a Cancel function, or because no - * Cancel function was set — then it will be terminated using os.Process.Kill. - * - * Then, if the I/O pipes communicating with the child process are still open, - * those pipes are closed in order to unblock any goroutines currently blocked - * on Read or Write calls. - * - * If pipes are closed due to WaitDelay, no Cancel call has occurred, - * and the command has otherwise exited with a successful status, Wait and - * similar methods will return ErrWaitDelay instead of nil. - * - * If WaitDelay is zero (the default), I/O pipes will be read until EOF, - * which might not occur until orphaned subprocesses of the command have - * also closed their descriptors for the pipes. - */ - waitDelay: time.Duration - } - interface Cmd { - /** - * String returns a human-readable description of c. - * It is intended only for debugging. - * In particular, it is not suitable for use as input to a shell. - * The output of String may vary across Go releases. - */ - string(): string - } - interface Cmd { - /** - * Run starts the specified command and waits for it to complete. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command starts but does not complete successfully, the error is of - * type [*ExitError]. Other error types may be returned for other situations. - * - * If the calling goroutine has locked the operating system thread - * with [runtime.LockOSThread] and modified any inheritable OS-level - * thread state (for example, Linux or Plan 9 name spaces), the new - * process will inherit the caller's thread state. - */ - run(): void - } - interface Cmd { - /** - * Start starts the specified command but does not wait for it to complete. - * - * If Start returns successfully, the c.Process field will be set. - * - * After a successful call to Start the [Cmd.Wait] method must be called in - * order to release associated system resources. - */ - start(): void - } - interface Cmd { - /** - * Wait waits for the command to exit and waits for any copying to - * stdin or copying from stdout or stderr to complete. - * - * The command must have been started by [Cmd.Start]. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command fails to run or doesn't complete successfully, the - * error is of type [*ExitError]. Other error types may be - * returned for I/O problems. - * - * If any of c.Stdin, c.Stdout or c.Stderr are not an [*os.File], Wait also waits - * for the respective I/O loop copying to or from the process to complete. - * - * Wait releases any resources associated with the [Cmd]. - */ - wait(): void - } - interface Cmd { - /** - * Output runs the command and returns its standard output. - * Any returned error will usually be of type [*ExitError]. - * If c.Stderr was nil, Output populates [ExitError.Stderr]. - */ - output(): string|Array - } - interface Cmd { - /** - * CombinedOutput runs the command and returns its combined standard - * output and standard error. - */ - combinedOutput(): string|Array - } - interface Cmd { - /** - * StdinPipe returns a pipe that will be connected to the command's - * standard input when the command starts. - * The pipe will be closed automatically after [Cmd.Wait] sees the command exit. - * A caller need only call Close to force the pipe to close sooner. - * For example, if the command being run will not exit until standard input - * is closed, the caller must close the pipe. - */ - stdinPipe(): io.WriteCloser - } - interface Cmd { - /** - * StdoutPipe returns a pipe that will be connected to the command's - * standard output when the command starts. - * - * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to call [Cmd.Run] when using StdoutPipe. - * See the example for idiomatic usage. - */ - stdoutPipe(): io.ReadCloser - } - interface Cmd { - /** - * StderrPipe returns a pipe that will be connected to the command's - * standard error when the command starts. - * - * [Cmd.Wait] will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to use [Cmd.Run] when using StderrPipe. - * See the StdoutPipe example for idiomatic usage. - */ - stderrPipe(): io.ReadCloser - } - interface Cmd { - /** - * Environ returns a copy of the environment in which the command would be run - * as it is currently configured. - */ - environ(): Array - } -} - -/** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits - * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. - * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. - * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. - */ -namespace multipart { - /** - * A FileHeader describes a file part of a multipart request. - */ - interface FileHeader { - filename: string - header: textproto.MIMEHeader - size: number - } - interface FileHeader { - /** - * Open opens and returns the [FileHeader]'s associated File. - */ - open(): File - } -} - -/** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { - // @ts-ignore - import mathrand = rand - /** - * PushOptions describes options for [Pusher.Push]. - */ - interface PushOptions { - /** - * Method specifies the HTTP method for the promised request. - * If set, it must be "GET" or "HEAD". Empty means "GET". - */ - method: string - /** - * Header specifies additional promised request headers. This cannot - * include HTTP/2 pseudo header fields like ":path" and ":scheme", - * which will be added automatically. - */ - header: Header - } - // @ts-ignore - import urlpkg = url - /** - * A Request represents an HTTP request received by a server - * or to be sent by a client. - * - * The field semantics differ slightly between client and server - * usage. In addition to the notes on the fields below, see the - * documentation for [Request.Write] and [RoundTripper]. - */ - interface Request { - /** - * Method specifies the HTTP method (GET, POST, PUT, etc.). - * For client requests, an empty string means GET. - */ - method: string - /** - * URL specifies either the URI being requested (for server - * requests) or the URL to access (for client requests). - * - * For server requests, the URL is parsed from the URI - * supplied on the Request-Line as stored in RequestURI. For - * most requests, fields other than Path and RawQuery will be - * empty. (See RFC 7230, Section 5.3) - * - * For client requests, the URL's Host specifies the server to - * connect to, while the Request's Host field optionally - * specifies the Host header value to send in the HTTP - * request. - */ - url?: url.URL - /** - * The protocol version for incoming server requests. - * - * For client requests, these fields are ignored. The HTTP - * client code always uses either HTTP/1.1 or HTTP/2. - * See the docs on Transport for details. - */ - proto: string // "HTTP/1.0" - protoMajor: number // 1 - protoMinor: number // 0 - /** - * Header contains the request header fields either received - * by the server or to be sent by the client. - * - * If a server received a request with header lines, - * - * ``` - * Host: example.com - * accept-encoding: gzip, deflate - * Accept-Language: en-us - * fOO: Bar - * foo: two - * ``` - * - * then - * - * ``` - * Header = map[string][]string{ - * "Accept-Encoding": {"gzip, deflate"}, - * "Accept-Language": {"en-us"}, - * "Foo": {"Bar", "two"}, - * } - * ``` - * - * For incoming requests, the Host header is promoted to the - * Request.Host field and removed from the Header map. - * - * HTTP defines that header names are case-insensitive. The - * request parser implements this by using CanonicalHeaderKey, - * making the first character and any characters following a - * hyphen uppercase and the rest lowercase. - * - * For client requests, certain headers such as Content-Length - * and Connection are automatically written when needed and - * values in Header may be ignored. See the documentation - * for the Request.Write method. - */ - header: Header - /** - * Body is the request's body. - * - * For client requests, a nil body means the request has no - * body, such as a GET request. The HTTP Client's Transport - * is responsible for calling the Close method. - * - * For server requests, the Request Body is always non-nil - * but will return EOF immediately when no body is present. - * The Server will close the request body. The ServeHTTP - * Handler does not need to. - * - * Body must allow Read to be called concurrently with Close. - * In particular, calling Close should unblock a Read waiting - * for input. - */ - body: io.ReadCloser - /** - * GetBody defines an optional func to return a new copy of - * Body. It is used for client requests when a redirect requires - * reading the body more than once. Use of GetBody still - * requires setting Body. - * - * For server requests, it is unused. - */ - getBody: () => io.ReadCloser - /** - * ContentLength records the length of the associated content. - * The value -1 indicates that the length is unknown. - * Values >= 0 indicate that the given number of bytes may - * be read from Body. - * - * For client requests, a value of 0 with a non-nil Body is - * also treated as unknown. - */ - contentLength: number - /** - * TransferEncoding lists the transfer encodings from outermost to - * innermost. An empty list denotes the "identity" encoding. - * TransferEncoding can usually be ignored; chunked encoding is - * automatically added and removed as necessary when sending and - * receiving requests. - */ - transferEncoding: Array - /** - * Close indicates whether to close the connection after - * replying to this request (for servers) or after sending this - * request and reading its response (for clients). - * - * For server requests, the HTTP server handles this automatically - * and this field is not needed by Handlers. - * - * For client requests, setting this field prevents re-use of - * TCP connections between requests to the same hosts, as if - * Transport.DisableKeepAlives were set. - */ - close: boolean - /** - * For server requests, Host specifies the host on which the - * URL is sought. For HTTP/1 (per RFC 7230, section 5.4), this - * is either the value of the "Host" header or the host name - * given in the URL itself. For HTTP/2, it is the value of the - * ":authority" pseudo-header field. - * It may be of the form "host:port". For international domain - * names, Host may be in Punycode or Unicode form. Use - * golang.org/x/net/idna to convert it to either format if - * needed. - * To prevent DNS rebinding attacks, server Handlers should - * validate that the Host header has a value for which the - * Handler considers itself authoritative. The included - * ServeMux supports patterns registered to particular host - * names and thus protects its registered Handlers. - * - * For client requests, Host optionally overrides the Host - * header to send. If empty, the Request.Write method uses - * the value of URL.Host. Host may contain an international - * domain name. - */ - host: string - /** - * Form contains the parsed form data, including both the URL - * field's query parameters and the PATCH, POST, or PUT form data. - * This field is only available after ParseForm is called. - * The HTTP client ignores Form and uses Body instead. - */ - form: url.Values - /** - * PostForm contains the parsed form data from PATCH, POST - * or PUT body parameters. - * - * This field is only available after ParseForm is called. - * The HTTP client ignores PostForm and uses Body instead. - */ - postForm: url.Values - /** - * MultipartForm is the parsed multipart form, including file uploads. - * This field is only available after ParseMultipartForm is called. - * The HTTP client ignores MultipartForm and uses Body instead. - */ - multipartForm?: multipart.Form - /** - * Trailer specifies additional headers that are sent after the request - * body. - * - * For server requests, the Trailer map initially contains only the - * trailer keys, with nil values. (The client declares which trailers it - * will later send.) While the handler is reading from Body, it must - * not reference Trailer. After reading from Body returns EOF, Trailer - * can be read again and will contain non-nil values, if they were sent - * by the client. - * - * For client requests, Trailer must be initialized to a map containing - * the trailer keys to later send. The values may be nil or their final - * values. The ContentLength must be 0 or -1, to send a chunked request. - * After the HTTP request is sent the map values can be updated while - * the request body is read. Once the body returns EOF, the caller must - * not mutate Trailer. - * - * Few HTTP clients, servers, or proxies support HTTP trailers. - */ - trailer: Header - /** - * RemoteAddr allows HTTP servers and other software to record - * the network address that sent the request, usually for - * logging. This field is not filled in by ReadRequest and - * has no defined format. The HTTP server in this package - * sets RemoteAddr to an "IP:port" address before invoking a - * handler. - * This field is ignored by the HTTP client. - */ - remoteAddr: string - /** - * RequestURI is the unmodified request-target of the - * Request-Line (RFC 7230, Section 3.1.1) as sent by the client - * to a server. Usually the URL field should be used instead. - * It is an error to set this field in an HTTP client request. - */ - requestURI: string - /** - * TLS allows HTTP servers and other software to record - * information about the TLS connection on which the request - * was received. This field is not filled in by ReadRequest. - * The HTTP server in this package sets the field for - * TLS-enabled connections before invoking a handler; - * otherwise it leaves the field nil. - * This field is ignored by the HTTP client. - */ - tls?: any - /** - * Cancel is an optional channel whose closure indicates that the client - * request should be regarded as canceled. Not all implementations of - * RoundTripper may support Cancel. - * - * For server requests, this field is not applicable. - * - * Deprecated: Set the Request's context with NewRequestWithContext - * instead. If a Request's Cancel field and context are both - * set, it is undefined whether Cancel is respected. - */ - cancel: undefined - /** - * Response is the redirect response which caused this request - * to be created. This field is only populated during client - * redirects. - */ - response?: Response - /** - * Pattern is the [ServeMux] pattern that matched the request. - * It is empty if the request was not matched against a pattern. - */ - pattern: string - } - interface Request { - /** - * Context returns the request's context. To change the context, use - * [Request.Clone] or [Request.WithContext]. - * - * The returned context is always non-nil; it defaults to the - * background context. - * - * For outgoing client requests, the context controls cancellation. - * - * For incoming server requests, the context is canceled when the - * client's connection closes, the request is canceled (with HTTP/2), - * or when the ServeHTTP method returns. - */ - context(): context.Context - } - interface Request { - /** - * WithContext returns a shallow copy of r with its context changed - * to ctx. The provided ctx must be non-nil. - * - * For outgoing client request, the context controls the entire - * lifetime of a request and its response: obtaining a connection, - * sending the request, and reading the response headers and body. - * - * To create a new request with a context, use [NewRequestWithContext]. - * To make a deep copy of a request with a new context, use [Request.Clone]. - */ - withContext(ctx: context.Context): (Request) - } - interface Request { - /** - * Clone returns a deep copy of r with its context changed to ctx. - * The provided ctx must be non-nil. - * - * Clone only makes a shallow copy of the Body field. - * - * For an outgoing client request, the context controls the entire - * lifetime of a request and its response: obtaining a connection, - * sending the request, and reading the response headers and body. - */ - clone(ctx: context.Context): (Request) - } - interface Request { - /** - * ProtoAtLeast reports whether the HTTP protocol used - * in the request is at least major.minor. - */ - protoAtLeast(major: number, minor: number): boolean - } - interface Request { - /** - * UserAgent returns the client's User-Agent, if sent in the request. - */ - userAgent(): string - } - interface Request { - /** - * Cookies parses and returns the HTTP cookies sent with the request. - */ - cookies(): Array<(Cookie | undefined)> - } - interface Request { - /** - * CookiesNamed parses and returns the named HTTP cookies sent with the request - * or an empty slice if none matched. - */ - cookiesNamed(name: string): Array<(Cookie | undefined)> - } - interface Request { - /** - * Cookie returns the named cookie provided in the request or - * [ErrNoCookie] if not found. - * If multiple cookies match the given name, only one cookie will - * be returned. - */ - cookie(name: string): (Cookie) - } - interface Request { - /** - * AddCookie adds a cookie to the request. Per RFC 6265 section 5.4, - * AddCookie does not attach more than one [Cookie] header field. That - * means all cookies, if any, are written into the same line, - * separated by semicolon. - * AddCookie only sanitizes c's name and value, and does not sanitize - * a Cookie header already present in the request. - */ - addCookie(c: Cookie): void - } - interface Request { - /** - * Referer returns the referring URL, if sent in the request. - * - * Referer is misspelled as in the request itself, a mistake from the - * earliest days of HTTP. This value can also be fetched from the - * [Header] map as Header["Referer"]; the benefit of making it available - * as a method is that the compiler can diagnose programs that use the - * alternate (correct English) spelling req.Referrer() but cannot - * diagnose programs that use Header["Referrer"]. - */ - referer(): string - } - interface Request { - /** - * MultipartReader returns a MIME multipart reader if this is a - * multipart/form-data or a multipart/mixed POST request, else returns nil and an error. - * Use this function instead of [Request.ParseMultipartForm] to - * process the request body as a stream. - */ - multipartReader(): (multipart.Reader) - } - interface Request { - /** - * Write writes an HTTP/1.1 request, which is the header and body, in wire format. - * This method consults the following fields of the request: - * - * ``` - * Host - * URL - * Method (defaults to "GET") - * Header - * ContentLength - * TransferEncoding - * Body - * ``` - * - * If Body is present, Content-Length is <= 0 and [Request.TransferEncoding] - * hasn't been set to "identity", Write adds "Transfer-Encoding: - * chunked" to the header. Body is closed after it is sent. - */ - write(w: io.Writer): void - } - interface Request { - /** - * WriteProxy is like [Request.Write] but writes the request in the form - * expected by an HTTP proxy. In particular, [Request.WriteProxy] writes the - * initial Request-URI line of the request with an absolute URI, per - * section 5.3 of RFC 7230, including the scheme and host. - * In either case, WriteProxy also writes a Host header, using - * either r.Host or r.URL.Host. - */ - writeProxy(w: io.Writer): void - } - interface Request { - /** - * BasicAuth returns the username and password provided in the request's - * Authorization header, if the request uses HTTP Basic Authentication. - * See RFC 2617, Section 2. - */ - basicAuth(): [string, string, boolean] - } - interface Request { - /** - * SetBasicAuth sets the request's Authorization header to use HTTP - * Basic Authentication with the provided username and password. - * - * With HTTP Basic Authentication the provided username and password - * are not encrypted. It should generally only be used in an HTTPS - * request. - * - * The username may not contain a colon. Some protocols may impose - * additional requirements on pre-escaping the username and - * password. For instance, when used with OAuth2, both arguments must - * be URL encoded first with [url.QueryEscape]. - */ - setBasicAuth(username: string, password: string): void - } - interface Request { - /** - * ParseForm populates r.Form and r.PostForm. - * - * For all requests, ParseForm parses the raw query from the URL and updates - * r.Form. - * - * For POST, PUT, and PATCH requests, it also reads the request body, parses it - * as a form and puts the results into both r.PostForm and r.Form. Request body - * parameters take precedence over URL query string values in r.Form. - * - * If the request Body's size has not already been limited by [MaxBytesReader], - * the size is capped at 10MB. - * - * For other HTTP methods, or when the Content-Type is not - * application/x-www-form-urlencoded, the request Body is not read, and - * r.PostForm is initialized to a non-nil, empty value. - * - * [Request.ParseMultipartForm] calls ParseForm automatically. - * ParseForm is idempotent. - */ - parseForm(): void - } - interface Request { - /** - * ParseMultipartForm parses a request body as multipart/form-data. - * The whole request body is parsed and up to a total of maxMemory bytes of - * its file parts are stored in memory, with the remainder stored on - * disk in temporary files. - * ParseMultipartForm calls [Request.ParseForm] if necessary. - * If ParseForm returns an error, ParseMultipartForm returns it but also - * continues parsing the request body. - * After one call to ParseMultipartForm, subsequent calls have no effect. - */ - parseMultipartForm(maxMemory: number): void - } - interface Request { - /** - * FormValue returns the first value for the named component of the query. - * The precedence order: - * 1. application/x-www-form-urlencoded form body (POST, PUT, PATCH only) - * 2. query parameters (always) - * 3. multipart/form-data form body (always) - * - * FormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] - * if necessary and ignores any errors returned by these functions. - * If key is not present, FormValue returns the empty string. - * To access multiple values of the same key, call ParseForm and - * then inspect [Request.Form] directly. - */ - formValue(key: string): string - } - interface Request { - /** - * PostFormValue returns the first value for the named component of the POST, - * PUT, or PATCH request body. URL query parameters are ignored. - * PostFormValue calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary and ignores - * any errors returned by these functions. - * If key is not present, PostFormValue returns the empty string. - */ - postFormValue(key: string): string - } - interface Request { - /** - * FormFile returns the first file for the provided form key. - * FormFile calls [Request.ParseMultipartForm] and [Request.ParseForm] if necessary. - */ - formFile(key: string): [multipart.File, (multipart.FileHeader)] - } - interface Request { - /** - * PathValue returns the value for the named path wildcard in the [ServeMux] pattern - * that matched the request. - * It returns the empty string if the request was not matched against a pattern - * or there is no such wildcard in the pattern. - */ - pathValue(name: string): string - } - interface Request { - /** - * SetPathValue sets name to value, so that subsequent calls to r.PathValue(name) - * return value. - */ - setPathValue(name: string, value: string): void + isolation: IsolationLevel + readOnly: boolean } /** - * A Handler responds to an HTTP request. + * NullString represents a string that may be null. + * NullString implements the [Scanner] interface so + * it can be used as a scan destination: * - * [Handler.ServeHTTP] should write reply headers and data to the [ResponseWriter] - * and then return. Returning signals that the request is finished; it - * is not valid to use the [ResponseWriter] or read from the - * [Request.Body] after or concurrently with the completion of the - * ServeHTTP call. - * - * Depending on the HTTP client software, HTTP protocol version, and - * any intermediaries between the client and the Go server, it may not - * be possible to read from the [Request.Body] after writing to the - * [ResponseWriter]. Cautious handlers should read the [Request.Body] - * first, and then reply. - * - * Except for reading the body, handlers should not modify the - * provided Request. - * - * If ServeHTTP panics, the server (the caller of ServeHTTP) assumes - * that the effect of the panic was isolated to the active request. - * It recovers the panic, logs a stack trace to the server error log, - * and either closes the network connection or sends an HTTP/2 - * RST_STREAM, depending on the HTTP protocol. To abort a handler so - * the client sees an interrupted response but the server doesn't log - * an error, panic with the value [ErrAbortHandler]. + * ``` + * var s NullString + * err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&s) + * ... + * if s.Valid { + * // use s.String + * } else { + * // NULL value + * } + * ``` */ - interface Handler { - [key:string]: any; - serveHTTP(_arg0: ResponseWriter, _arg1: Request): void + interface NullString { + string: string + valid: boolean // Valid is true if String is not NULL + } + interface NullString { + /** + * Scan implements the [Scanner] interface. + */ + scan(value: any): void + } + interface NullString { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any } /** - * A ResponseWriter interface is used by an HTTP handler to - * construct an HTTP response. + * DB is a database handle representing a pool of zero or more + * underlying connections. It's safe for concurrent use by multiple + * goroutines. * - * A ResponseWriter may not be used after [Handler.ServeHTTP] has returned. + * The sql package creates and frees connections automatically; it + * also maintains a free pool of idle connections. If the database has + * a concept of per-connection state, such state can be reliably observed + * within a transaction ([Tx]) or connection ([Conn]). Once [DB.Begin] is called, the + * returned [Tx] is bound to a single connection. Once [Tx.Commit] or + * [Tx.Rollback] is called on the transaction, that transaction's + * connection is returned to [DB]'s idle connection pool. The pool size + * can be controlled with [DB.SetMaxIdleConns]. */ - interface ResponseWriter { - [key:string]: any; - /** - * Header returns the header map that will be sent by - * [ResponseWriter.WriteHeader]. The [Header] map also is the mechanism with which - * [Handler] implementations can set HTTP trailers. - * - * Changing the header map after a call to [ResponseWriter.WriteHeader] (or - * [ResponseWriter.Write]) has no effect unless the HTTP status code was of the - * 1xx class or the modified headers are trailers. - * - * There are two ways to set Trailers. The preferred way is to - * predeclare in the headers which trailers you will later - * send by setting the "Trailer" header to the names of the - * trailer keys which will come later. In this case, those - * keys of the Header map are treated as if they were - * trailers. See the example. The second way, for trailer - * keys not known to the [Handler] until after the first [ResponseWriter.Write], - * is to prefix the [Header] map keys with the [TrailerPrefix] - * constant value. - * - * To suppress automatic response headers (such as "Date"), set - * their value to nil. - */ - header(): Header - /** - * Write writes the data to the connection as part of an HTTP reply. - * - * If [ResponseWriter.WriteHeader] has not yet been called, Write calls - * WriteHeader(http.StatusOK) before writing the data. If the Header - * does not contain a Content-Type line, Write adds a Content-Type set - * to the result of passing the initial 512 bytes of written data to - * [DetectContentType]. Additionally, if the total size of all written - * data is under a few KB and there are no Flush calls, the - * Content-Length header is added automatically. - * - * Depending on the HTTP protocol version and the client, calling - * Write or WriteHeader may prevent future reads on the - * Request.Body. For HTTP/1.x requests, handlers should read any - * needed request body data before writing the response. Once the - * headers have been flushed (due to either an explicit Flusher.Flush - * call or writing enough data to trigger a flush), the request body - * may be unavailable. For HTTP/2 requests, the Go HTTP server permits - * handlers to continue to read the request body while concurrently - * writing the response. However, such behavior may not be supported - * by all HTTP/2 clients. Handlers should read before writing if - * possible to maximize compatibility. - */ - write(_arg0: string|Array): number - /** - * WriteHeader sends an HTTP response header with the provided - * status code. - * - * If WriteHeader is not called explicitly, the first call to Write - * will trigger an implicit WriteHeader(http.StatusOK). - * Thus explicit calls to WriteHeader are mainly used to - * send error codes or 1xx informational responses. - * - * The provided code must be a valid HTTP 1xx-5xx status code. - * Any number of 1xx headers may be written, followed by at most - * one 2xx-5xx header. 1xx headers are sent immediately, but 2xx-5xx - * headers may be buffered. Use the Flusher interface to send - * buffered data. The header map is cleared when 2xx-5xx headers are - * sent, but not with 1xx headers. - * - * The server will automatically send a 100 (Continue) header - * on the first read from the request body if the request has - * an "Expect: 100-continue" header. - */ - writeHeader(statusCode: number): void + interface DB { } - /** - * A Server defines parameters for running an HTTP server. - * The zero value for Server is a valid configuration. - */ - interface Server { + interface DB { /** - * Addr optionally specifies the TCP address for the server to listen on, - * in the form "host:port". If empty, ":http" (port 80) is used. - * The service names are defined in RFC 6335 and assigned by IANA. - * See net.Dial for details of the address format. + * PingContext verifies a connection to the database is still alive, + * establishing a connection if necessary. */ - addr: string - handler: Handler // handler to invoke, http.DefaultServeMux if nil - /** - * DisableGeneralOptionsHandler, if true, passes "OPTIONS *" requests to the Handler, - * otherwise responds with 200 OK and Content-Length: 0. - */ - disableGeneralOptionsHandler: boolean - /** - * TLSConfig optionally provides a TLS configuration for use - * by ServeTLS and ListenAndServeTLS. Note that this value is - * cloned by ServeTLS and ListenAndServeTLS, so it's not - * possible to modify the configuration with methods like - * tls.Config.SetSessionTicketKeys. To use - * SetSessionTicketKeys, use Server.Serve with a TLS Listener - * instead. - */ - tlsConfig?: any - /** - * ReadTimeout is the maximum duration for reading the entire - * request, including the body. A zero or negative value means - * there will be no timeout. - * - * Because ReadTimeout does not let Handlers make per-request - * decisions on each request body's acceptable deadline or - * upload rate, most users will prefer to use - * ReadHeaderTimeout. It is valid to use them both. - */ - readTimeout: time.Duration - /** - * ReadHeaderTimeout is the amount of time allowed to read - * request headers. The connection's read deadline is reset - * after reading the headers and the Handler can decide what - * is considered too slow for the body. If zero, the value of - * ReadTimeout is used. If negative, or if zero and ReadTimeout - * is zero or negative, there is no timeout. - */ - readHeaderTimeout: time.Duration - /** - * WriteTimeout is the maximum duration before timing out - * writes of the response. It is reset whenever a new - * request's header is read. Like ReadTimeout, it does not - * let Handlers make decisions on a per-request basis. - * A zero or negative value means there will be no timeout. - */ - writeTimeout: time.Duration - /** - * IdleTimeout is the maximum amount of time to wait for the - * next request when keep-alives are enabled. If zero, the value - * of ReadTimeout is used. If negative, or if zero and ReadTimeout - * is zero or negative, there is no timeout. - */ - idleTimeout: time.Duration - /** - * MaxHeaderBytes controls the maximum number of bytes the - * server will read parsing the request header's keys and - * values, including the request line. It does not limit the - * size of the request body. - * If zero, DefaultMaxHeaderBytes is used. - */ - maxHeaderBytes: number - /** - * TLSNextProto optionally specifies a function to take over - * ownership of the provided TLS connection when an ALPN - * protocol upgrade has occurred. The map key is the protocol - * name negotiated. The Handler argument should be used to - * handle HTTP requests and will initialize the Request's TLS - * and RemoteAddr if not already set. The connection is - * automatically closed when the function returns. - * If TLSNextProto is not nil, HTTP/2 support is not enabled - * automatically. - */ - tlsNextProto: _TygojaDict - /** - * ConnState specifies an optional callback function that is - * called when a client connection changes state. See the - * ConnState type and associated constants for details. - */ - connState: (_arg0: net.Conn, _arg1: ConnState) => void - /** - * ErrorLog specifies an optional logger for errors accepting - * connections, unexpected behavior from handlers, and - * underlying FileSystem errors. - * If nil, logging is done via the log package's standard logger. - */ - errorLog?: any - /** - * BaseContext optionally specifies a function that returns - * the base context for incoming requests on this server. - * The provided Listener is the specific Listener that's - * about to start accepting requests. - * If BaseContext is nil, the default is context.Background(). - * If non-nil, it must return a non-nil context. - */ - baseContext: (_arg0: net.Listener) => context.Context - /** - * ConnContext optionally specifies a function that modifies - * the context used for a new connection c. The provided ctx - * is derived from the base context and has a ServerContextKey - * value. - */ - connContext: (ctx: context.Context, c: net.Conn) => context.Context + pingContext(ctx: context.Context): void } - interface Server { + interface DB { /** - * Close immediately closes all active net.Listeners and any - * connections in state [StateNew], [StateActive], or [StateIdle]. For a - * graceful shutdown, use [Server.Shutdown]. + * Ping verifies a connection to the database is still alive, + * establishing a connection if necessary. * - * Close does not attempt to close (and does not even know about) - * any hijacked connections, such as WebSockets. + * Ping uses [context.Background] internally; to specify the context, use + * [DB.PingContext]. + */ + ping(): void + } + interface DB { + /** + * Close closes the database and prevents new queries from starting. + * Close then waits for all queries that have started processing on the server + * to finish. * - * Close returns any error returned from closing the [Server]'s - * underlying Listener(s). + * It is rare to Close a [DB], as the [DB] handle is meant to be + * long-lived and shared between many goroutines. */ close(): void } - interface Server { + interface DB { /** - * Shutdown gracefully shuts down the server without interrupting any - * active connections. Shutdown works by first closing all open - * listeners, then closing all idle connections, and then waiting - * indefinitely for connections to return to idle and then shut down. - * If the provided context expires before the shutdown is complete, - * Shutdown returns the context's error, otherwise it returns any - * error returned from closing the [Server]'s underlying Listener(s). + * SetMaxIdleConns sets the maximum number of connections in the idle + * connection pool. * - * When Shutdown is called, [Serve], [ListenAndServe], and - * [ListenAndServeTLS] immediately return [ErrServerClosed]. Make sure the - * program doesn't exit and waits instead for Shutdown to return. + * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, + * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. * - * Shutdown does not attempt to close nor wait for hijacked - * connections such as WebSockets. The caller of Shutdown should - * separately notify such long-lived connections of shutdown and wait - * for them to close, if desired. See [Server.RegisterOnShutdown] for a way to - * register shutdown notification functions. + * If n <= 0, no idle connections are retained. * - * Once Shutdown has been called on a server, it may not be reused; - * future calls to methods such as Serve will return ErrServerClosed. + * The default max idle connections is currently 2. This may change in + * a future release. */ - shutdown(ctx: context.Context): void + setMaxIdleConns(n: number): void } - interface Server { + interface DB { /** - * RegisterOnShutdown registers a function to call on [Server.Shutdown]. - * This can be used to gracefully shutdown connections that have - * undergone ALPN protocol upgrade or that have been hijacked. - * This function should start protocol-specific graceful shutdown, - * but should not wait for shutdown to complete. + * SetMaxOpenConns sets the maximum number of open connections to the database. + * + * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than + * MaxIdleConns, then MaxIdleConns will be reduced to match the new + * MaxOpenConns limit. + * + * If n <= 0, then there is no limit on the number of open connections. + * The default is 0 (unlimited). */ - registerOnShutdown(f: () => void): void + setMaxOpenConns(n: number): void } - interface Server { + interface DB { /** - * ListenAndServe listens on the TCP network address srv.Addr and then - * calls [Serve] to handle requests on incoming connections. - * Accepted connections are configured to enable TCP keep-alives. + * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. * - * If srv.Addr is blank, ":http" is used. + * Expired connections may be closed lazily before reuse. * - * ListenAndServe always returns a non-nil error. After [Server.Shutdown] or [Server.Close], - * the returned error is [ErrServerClosed]. + * If d <= 0, connections are not closed due to a connection's age. */ - listenAndServe(): void + setConnMaxLifetime(d: time.Duration): void } - interface Server { + interface DB { /** - * Serve accepts incoming connections on the Listener l, creating a - * new service goroutine for each. The service goroutines read requests and - * then call srv.Handler to reply to them. + * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. * - * HTTP/2 support is only enabled if the Listener returns [*tls.Conn] - * connections and they were configured with "h2" in the TLS - * Config.NextProtos. + * Expired connections may be closed lazily before reuse. * - * Serve always returns a non-nil error and closes l. - * After [Server.Shutdown] or [Server.Close], the returned error is [ErrServerClosed]. + * If d <= 0, connections are not closed due to a connection's idle time. */ - serve(l: net.Listener): void + setConnMaxIdleTime(d: time.Duration): void } - interface Server { + interface DB { /** - * ServeTLS accepts incoming connections on the Listener l, creating a - * new service goroutine for each. The service goroutines perform TLS - * setup and then read requests, calling srv.Handler to reply to them. - * - * Files containing a certificate and matching private key for the - * server must be provided if neither the [Server]'s - * TLSConfig.Certificates, TLSConfig.GetCertificate nor - * config.GetConfigForClient are populated. - * If the certificate is signed by a certificate authority, the - * certFile should be the concatenation of the server's certificate, - * any intermediates, and the CA's certificate. - * - * ServeTLS always returns a non-nil error. After [Server.Shutdown] or [Server.Close], the - * returned error is [ErrServerClosed]. + * Stats returns database statistics. */ - serveTLS(l: net.Listener, certFile: string, keyFile: string): void + stats(): DBStats } - interface Server { + interface DB { /** - * SetKeepAlivesEnabled controls whether HTTP keep-alives are enabled. - * By default, keep-alives are always enabled. Only very - * resource-constrained environments or servers in the process of - * shutting down should disable them. + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. */ - setKeepAlivesEnabled(v: boolean): void + prepareContext(ctx: context.Context, query: string): (Stmt) } - interface Server { + interface DB { /** - * ListenAndServeTLS listens on the TCP network address srv.Addr and - * then calls [ServeTLS] to handle requests on incoming TLS connections. - * Accepted connections are configured to enable TCP keep-alives. + * Prepare creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. * - * Filenames containing a certificate and matching private key for the - * server must be provided if neither the [Server]'s TLSConfig.Certificates - * nor TLSConfig.GetCertificate are populated. If the certificate is - * signed by a certificate authority, the certFile should be the - * concatenation of the server's certificate, any intermediates, and - * the CA's certificate. - * - * If srv.Addr is blank, ":https" is used. - * - * ListenAndServeTLS always returns a non-nil error. After [Server.Shutdown] or - * [Server.Close], the returned error is [ErrServerClosed]. + * Prepare uses [context.Background] internally; to specify the context, use + * [DB.PrepareContext]. */ - listenAndServeTLS(certFile: string, keyFile: string): void + prepare(query: string): (Stmt) } -} - -namespace auth { - /** - * Provider defines a common interface for an OAuth2 client. - */ - interface Provider { - [key:string]: any; + interface DB { /** - * Context returns the context associated with the provider (if any). + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. */ - context(): context.Context + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface DB { /** - * SetContext assigns the specified context to the current provider. + * Exec executes a query without returning any rows. + * The args are for any placeholder parameters in the query. + * + * Exec uses [context.Background] internally; to specify the context, use + * [DB.ExecContext]. */ - setContext(ctx: context.Context): void + exec(query: string, ...args: any[]): Result + } + interface DB { /** - * PKCE indicates whether the provider can use the PKCE flow. + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. */ - pkce(): boolean + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface DB { /** - * SetPKCE toggles the state whether the provider can use the PKCE flow or not. + * Query executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + * + * Query uses [context.Background] internally; to specify the context, use + * [DB.QueryContext]. */ - setPKCE(enable: boolean): void + query(query: string, ...args: any[]): (Rows) + } + interface DB { /** - * DisplayName usually returns provider name as it is officially written - * and it could be used directly in the UI. + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. */ - displayName(): string + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + } + interface DB { /** - * SetDisplayName sets the provider's display name. + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, [*Row.Scan] scans the first selected row and discards + * the rest. + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [DB.QueryRowContext]. */ - setDisplayName(displayName: string): void + queryRow(query: string, ...args: any[]): (Row) + } + interface DB { /** - * Scopes returns the provider access permissions that will be requested. + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. + * + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. */ - scopes(): Array + beginTx(ctx: context.Context, opts: TxOptions): (Tx) + } + interface DB { /** - * SetScopes sets the provider access permissions that will be requested later. + * Begin starts a transaction. The default isolation level is dependent on + * the driver. + * + * Begin uses [context.Background] internally; to specify the context, use + * [DB.BeginTx]. */ - setScopes(scopes: Array): void + begin(): (Tx) + } + interface DB { /** - * ClientId returns the provider client's app ID. + * Driver returns the database's underlying driver. */ - clientId(): string + driver(): any + } + interface DB { /** - * SetClientId sets the provider client's ID. + * Conn returns a single connection by either opening a new connection + * or returning an existing connection from the connection pool. Conn will + * block until either a connection is returned or ctx is canceled. + * Queries run on the same Conn will be run in the same database session. + * + * Every Conn must be returned to the database pool after use by + * calling [Conn.Close]. */ - setClientId(clientId: string): void - /** - * ClientSecret returns the provider client's app secret. - */ - clientSecret(): string - /** - * SetClientSecret sets the provider client's app secret. - */ - setClientSecret(secret: string): void - /** - * RedirectURL returns the end address to redirect the user - * going through the OAuth flow. - */ - redirectURL(): string - /** - * SetRedirectURL sets the provider's RedirectURL. - */ - setRedirectURL(url: string): void - /** - * AuthURL returns the provider's authorization service url. - */ - authURL(): string - /** - * SetAuthURL sets the provider's AuthURL. - */ - setAuthURL(url: string): void - /** - * TokenURL returns the provider's token exchange service url. - */ - tokenURL(): string - /** - * SetTokenURL sets the provider's TokenURL. - */ - setTokenURL(url: string): void - /** - * UserInfoURL returns the provider's user info api url. - */ - userInfoURL(): string - /** - * SetUserInfoURL sets the provider's UserInfoURL. - */ - setUserInfoURL(url: string): void - /** - * Extra returns a shallow copy of any custom config data - * that the provider may be need. - */ - extra(): _TygojaDict - /** - * SetExtra updates the provider's custom config data. - */ - setExtra(data: _TygojaDict): void - /** - * Client returns an http client using the provided token. - */ - client(token: oauth2.Token): (any) - /** - * BuildAuthURL returns a URL to the provider's consent page - * that asks for permissions for the required scopes explicitly. - */ - buildAuthURL(state: string, ...opts: oauth2.AuthCodeOption[]): string - /** - * FetchToken converts an authorization code to token. - */ - fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) - /** - * FetchRawUserInfo requests and marshalizes into `result` the - * the OAuth user api response. - */ - fetchRawUserInfo(token: oauth2.Token): string|Array - /** - * FetchAuthUser is similar to FetchRawUserInfo, but normalizes and - * marshalizes the user api response into a standardized AuthUser struct. - */ - fetchAuthUser(token: oauth2.Token): (AuthUser) + conn(ctx: context.Context): (Conn) } /** - * AuthUser defines a standardized OAuth2 user data structure. - */ - interface AuthUser { - expiry: types.DateTime - rawUser: _TygojaDict - id: string - name: string - username: string - email: string - avatarURL: string - accessToken: string - refreshToken: string - /** - * @todo - * deprecated: use AvatarURL instead - * AvatarUrl will be removed after dropping v0.22 support - */ - avatarUrl: string - } - interface AuthUser { - /** - * MarshalJSON implements the [json.Marshaler] interface. - * - * @todo remove after dropping v0.22 support - */ - marshalJSON(): string|Array - } -} - -/** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. - */ -namespace blob { - /** - * Reader reads bytes from a blob. - * It implements io.ReadSeekCloser, and must be closed after - * reads are finished. - */ - interface Reader { - } - interface Reader { - /** - * Read implements io.Reader (https://golang.org/pkg/io/#Reader). - */ - read(p: string|Array): number - } - interface Reader { - /** - * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). - */ - seek(offset: number, whence: number): number - } - interface Reader { - /** - * Close implements io.Closer (https://golang.org/pkg/io/#Closer). - */ - close(): void - } - interface Reader { - /** - * ContentType returns the MIME type of the blob. - */ - contentType(): string - } - interface Reader { - /** - * ModTime returns the time the blob was last modified. - */ - modTime(): time.Time - } - interface Reader { - /** - * Size returns the size of the blob content in bytes. - */ - size(): number - } - interface Reader { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } - interface Reader { - /** - * WriteTo reads from r and writes to w until there's no more data or - * an error occurs. - * The return value is the number of bytes written to w. - * - * It implements the io.WriterTo interface. - */ - writeTo(w: io.Writer): number - } - /** - * Attributes contains attributes about a blob. - */ - interface Attributes { - /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - */ - cacheControl: string - /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition - */ - contentDisposition: string - /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding - */ - contentEncoding: string - /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language - */ - contentLanguage: string - /** - * ContentType is the MIME type of the blob. It will not be empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type - */ - contentType: string - /** - * Metadata holds key/value pairs associated with the blob. - * Keys are guaranteed to be in lowercase, even if the backend service - * has case-sensitive keys (although note that Metadata written via - * this package will always be lowercased). If there are duplicate - * case-insensitive keys (e.g., "foo" and "FOO"), only one value - * will be kept, and it is undefined which one. - */ - metadata: _TygojaDict - /** - * CreateTime is the time the blob was created, if available. If not available, - * CreateTime will be the zero time. - */ - createTime: time.Time - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number - /** - * MD5 is an MD5 hash of the blob contents or nil if not available. - */ - md5: string|Array - /** - * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. - */ - eTag: string - } - interface Attributes { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } - /** - * ListObject represents a single blob returned from List. - */ - interface ListObject { - /** - * Key is the key for this blob. - */ - key: string - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number - /** - * MD5 is an MD5 hash of the blob contents or nil if not available. - */ - md5: string|Array - /** - * IsDir indicates that this result represents a "directory" in the - * hierarchical namespace, ending in ListOptions.Delimiter. Key can be - * passed as ListOptions.Prefix to list items in the "directory". - * Fields other than Key and IsDir will not be set if IsDir is true. - */ - isDir: boolean - } - interface ListObject { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } -} - -/** - * Package cron implements a crontab-like service to execute and schedule - * repeative tasks/jobs. - * - * Example: - * - * ``` - * c := cron.New() - * c.MustAdd("dailyReport", "0 0 * * *", func() { ... }) - * c.Start() - * ``` - */ -namespace cron { - /** - * Cron is a crontab-like struct for tasks/jobs scheduling. - */ - interface Cron { - } - interface Cron { - /** - * SetInterval changes the current cron tick interval - * (it usually should be >= 1 minute). - */ - setInterval(d: time.Duration): void - } - interface Cron { - /** - * SetTimezone changes the current cron tick timezone. - */ - setTimezone(l: time.Location): void - } - interface Cron { - /** - * MustAdd is similar to Add() but panic on failure. - */ - mustAdd(jobId: string, cronExpr: string, run: () => void): void - } - interface Cron { - /** - * Add registers a single cron job. - * - * If there is already a job with the provided id, then the old job - * will be replaced with the new one. - * - * cronExpr is a regular cron expression, eg. "0 *\/3 * * *" (aka. at minute 0 past every 3rd hour). - * Check cron.NewSchedule() for the supported tokens. - */ - add(jobId: string, cronExpr: string, run: () => void): void - } - interface Cron { - /** - * Remove removes a single cron job by its id. - */ - remove(jobId: string): void - } - interface Cron { - /** - * RemoveAll removes all registered cron jobs. - */ - removeAll(): void - } - interface Cron { - /** - * Total returns the current total number of registered cron jobs. - */ - total(): number - } - interface Cron { - /** - * Stop stops the current cron ticker (if not already). - * - * You can resume the ticker by calling Start(). - */ - stop(): void - } - interface Cron { - /** - * Start starts the cron ticker. - * - * Calling Start() on already started cron will restart the ticker. - */ - start(): void - } - interface Cron { - /** - * HasStarted checks whether the current Cron ticker has been started. - */ - hasStarted(): boolean - } -} - -/** - * Package slog provides structured logging, - * in which log records include a message, - * a severity level, and various other attributes - * expressed as key-value pairs. - * - * It defines a type, [Logger], - * which provides several methods (such as [Logger.Info] and [Logger.Error]) - * for reporting events of interest. - * - * Each Logger is associated with a [Handler]. - * A Logger output method creates a [Record] from the method arguments - * and passes it to the Handler, which decides how to handle it. - * There is a default Logger accessible through top-level functions - * (such as [Info] and [Error]) that call the corresponding Logger methods. - * - * A log record consists of a time, a level, a message, and a set of key-value - * pairs, where the keys are strings and the values may be of any type. - * As an example, - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * creates a record containing the time of the call, - * a level of Info, the message "hello", and a single - * pair with key "count" and value 3. - * - * The [Info] top-level function calls the [Logger.Info] method on the default Logger. - * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. - * Besides these convenience methods for common levels, - * there is also a [Logger.Log] method which takes the level as an argument. - * Each of these methods has a corresponding top-level function that uses the - * default logger. - * - * The default handler formats the log record's message, time, level, and attributes - * as a string and passes it to the [log] package. - * - * ``` - * 2022/11/08 15:28:26 INFO hello count=3 - * ``` - * - * For more control over the output format, create a logger with a different handler. - * This statement uses [New] to create a new logger with a [TextHandler] - * that writes structured records in text form to standard error: - * - * ``` - * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) - * ``` - * - * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously - * parsed by machine. This statement: - * - * ``` - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 - * ``` - * - * The package also provides [JSONHandler], whose output is line-delimited JSON: - * - * ``` - * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) - * logger.Info("hello", "count", 3) - * ``` - * - * produces this output: - * - * ``` - * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} - * ``` - * - * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. - * There are options for setting the minimum level (see Levels, below), - * displaying the source file and line of the log call, and - * modifying attributes before they are logged. - * - * Setting a logger as the default with - * - * ``` - * slog.SetDefault(logger) - * ``` - * - * will cause the top-level functions like [Info] to use it. - * [SetDefault] also updates the default logger used by the [log] package, - * so that existing applications that use [log.Printf] and related functions - * will send log records to the logger's handler without needing to be rewritten. - * - * Some attributes are common to many log calls. - * For example, you may wish to include the URL or trace identifier of a server request - * with all log events arising from the request. - * Rather than repeat the attribute with every log call, you can use [Logger.With] - * to construct a new Logger containing the attributes: - * - * ``` - * logger2 := logger.With("url", r.URL) - * ``` - * - * The arguments to With are the same key-value pairs used in [Logger.Info]. - * The result is a new Logger with the same handler as the original, but additional - * attributes that will appear in the output of every call. - * - * # Levels - * - * A [Level] is an integer representing the importance or severity of a log event. - * The higher the level, the more severe the event. - * This package defines constants for the most common levels, - * but any int can be used as a level. - * - * In an application, you may wish to log messages only at a certain level or greater. - * One common configuration is to log messages at Info or higher levels, - * suppressing debug logging until it is needed. - * The built-in handlers can be configured with the minimum level to output by - * setting [HandlerOptions.Level]. - * The program's `main` function typically does this. - * The default value is LevelInfo. - * - * Setting the [HandlerOptions.Level] field to a [Level] value - * fixes the handler's minimum level throughout its lifetime. - * Setting it to a [LevelVar] allows the level to be varied dynamically. - * A LevelVar holds a Level and is safe to read or write from multiple - * goroutines. - * To vary the level dynamically for an entire program, first initialize - * a global LevelVar: - * - * ``` - * var programLevel = new(slog.LevelVar) // Info by default - * ``` - * - * Then use the LevelVar to construct a handler, and make it the default: - * - * ``` - * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) - * slog.SetDefault(slog.New(h)) - * ``` - * - * Now the program can change its logging level with a single statement: - * - * ``` - * programLevel.Set(slog.LevelDebug) - * ``` - * - * # Groups - * - * Attributes can be collected into groups. - * A group has a name that is used to qualify the names of its attributes. - * How this qualification is displayed depends on the handler. - * [TextHandler] separates the group and attribute names with a dot. - * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. - * - * Use [Group] to create a Group attribute from a name and a list of key-value pairs: - * - * ``` - * slog.Group("request", - * "method", r.Method, - * "url", r.URL) - * ``` - * - * TextHandler would display this group as - * - * ``` - * request.method=GET request.url=http://example.com - * ``` - * - * JSONHandler would display it as - * - * ``` - * "request":{"method":"GET","url":"http://example.com"} - * ``` - * - * Use [Logger.WithGroup] to qualify all of a Logger's output - * with a group name. Calling WithGroup on a Logger results in a - * new Logger with the same Handler as the original, but with all - * its attributes qualified by the group name. - * - * This can help prevent duplicate attribute keys in large systems, - * where subsystems might use the same keys. - * Pass each subsystem a different Logger with its own group name so that - * potential duplicates are qualified: - * - * ``` - * logger := slog.Default().With("id", systemID) - * parserLogger := logger.WithGroup("parser") - * parseInput(input, parserLogger) - * ``` - * - * When parseInput logs with parserLogger, its keys will be qualified with "parser", - * so even if it uses the common key "id", the log line will have distinct keys. - * - * # Contexts - * - * Some handlers may wish to include information from the [context.Context] that is - * available at the call site. One example of such information - * is the identifier for the current span when tracing is enabled. - * - * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first - * argument, as do their corresponding top-level functions. - * - * Although the convenience methods on Logger (Info and so on) and the - * corresponding top-level functions do not take a context, the alternatives ending - * in "Context" do. For example, - * - * ``` - * slog.InfoContext(ctx, "message") - * ``` - * - * It is recommended to pass a context to an output method if one is available. - * - * # Attrs and Values - * - * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as - * alternating keys and values. The statement - * - * ``` - * slog.Info("hello", slog.Int("count", 3)) - * ``` - * - * behaves the same as - * - * ``` - * slog.Info("hello", "count", 3) - * ``` - * - * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] - * for common types, as well as the function [Any] for constructing Attrs of any - * type. - * - * The value part of an Attr is a type called [Value]. - * Like an [any], a Value can hold any Go value, - * but it can represent typical values, including all numbers and strings, - * without an allocation. - * - * For the most efficient log output, use [Logger.LogAttrs]. - * It is similar to [Logger.Log] but accepts only Attrs, not alternating - * keys and values; this allows it, too, to avoid allocation. - * - * The call - * - * ``` - * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) - * ``` - * - * is the most efficient way to achieve the same output as - * - * ``` - * slog.InfoContext(ctx, "hello", "count", 3) - * ``` - * - * # Customizing a type's logging behavior - * - * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue - * method is used for logging. You can use this to control how values of the type - * appear in logs. For example, you can redact secret information like passwords, - * or gather a struct's fields in a Group. See the examples under [LogValuer] for - * details. - * - * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] - * method handles these cases carefully, avoiding infinite loops and unbounded recursion. - * Handler authors and others may wish to use [Value.Resolve] instead of calling LogValue directly. - * - * # Wrapping output methods - * - * The logger functions use reflection over the call stack to find the file name - * and line number of the logging call within the application. This can produce - * incorrect source information for functions that wrap slog. For instance, if you - * define this function in file mylog.go: - * - * ``` - * func Infof(logger *slog.Logger, format string, args ...any) { - * logger.Info(fmt.Sprintf(format, args...)) - * } - * ``` - * - * and you call it like this in main.go: - * - * ``` - * Infof(slog.Default(), "hello, %s", "world") - * ``` - * - * then slog will report the source file as mylog.go, not main.go. - * - * A correct implementation of Infof will obtain the source location - * (pc) and pass it to NewRecord. - * The Infof function in the package-level example called "wrapping" - * demonstrates how to do this. - * - * # Working with Records - * - * Sometimes a Handler will need to modify a Record - * before passing it on to another Handler or backend. - * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) - * and hidden fields that refer to state (such as attributes) indirectly. This - * means that modifying a simple copy of a Record (e.g. by calling - * [Record.Add] or [Record.AddAttrs] to add attributes) - * may have unexpected effects on the original. - * Before modifying a Record, use [Record.Clone] to - * create a copy that shares no state with the original, - * or create a new Record with [NewRecord] - * and build up its Attrs by traversing the old ones with [Record.Attrs]. - * - * # Performance considerations - * - * If profiling your application demonstrates that logging is taking significant time, - * the following suggestions may help. - * - * If many log lines have a common attribute, use [Logger.With] to create a Logger with - * that attribute. The built-in handlers will format that attribute only once, at the - * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, - * and a well-written Handler should take advantage of it. - * - * The arguments to a log call are always evaluated, even if the log event is discarded. - * If possible, defer computation so that it happens only if the value is actually logged. - * For example, consider the call - * - * ``` - * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily - * ``` - * - * The URL.String method will be called even if the logger discards Info-level events. - * Instead, pass the URL directly: - * - * ``` - * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed - * ``` - * - * The built-in [TextHandler] will call its String method, but only - * if the log event is enabled. - * Avoiding the call to String also preserves the structure of the underlying value. - * For example [JSONHandler] emits the components of the parsed URL as a JSON object. - * If you want to avoid eagerly paying the cost of the String call - * without causing the handler to potentially inspect the structure of the value, - * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. - * - * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log - * calls. Say you need to log some expensive value: - * - * ``` - * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) - * ``` - * - * Even if this line is disabled, computeExpensiveValue will be called. - * To avoid that, define a type implementing LogValuer: - * - * ``` - * type expensive struct { arg int } - * - * func (e expensive) LogValue() slog.Value { - * return slog.AnyValue(computeExpensiveValue(e.arg)) - * } - * ``` - * - * Then use a value of that type in log calls: - * - * ``` - * slog.Debug("frobbing", "value", expensive{arg}) - * ``` - * - * Now computeExpensiveValue will only be called when the line is enabled. - * - * The built-in handlers acquire a lock before calling [io.Writer.Write] - * to ensure that exactly one [Record] is written at a time in its entirety. - * Although each log record has a timestamp, - * the built-in handlers do not use that time to sort the written records. - * User-defined handlers are responsible for their own locking and sorting. - * - * # Writing a handler - * - * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. - */ -namespace slog { - // @ts-ignore - import loginternal = internal - /** - * A Logger records structured information about each call to its - * Log, Debug, Info, Warn, and Error methods. - * For each call, it creates a [Record] and passes it to a [Handler]. + * Tx is an in-progress database transaction. * - * To create a new Logger, call [New] or a Logger method - * that begins "With". + * A transaction must end with a call to [Tx.Commit] or [Tx.Rollback]. + * + * After a call to [Tx.Commit] or [Tx.Rollback], all operations on the + * transaction fail with [ErrTxDone]. + * + * The statements prepared for a transaction by calling + * the transaction's [Tx.Prepare] or [Tx.Stmt] methods are closed + * by the call to [Tx.Commit] or [Tx.Rollback]. */ - interface Logger { + interface Tx { } - interface Logger { + interface Tx { /** - * Handler returns l's Handler. + * Commit commits the transaction. */ - handler(): Handler + commit(): void } - interface Logger { + interface Tx { /** - * With returns a Logger that includes the given attributes - * in each output operation. Arguments are converted to - * attributes as if by [Logger.Log]. + * Rollback aborts the transaction. */ - with(...args: any[]): (Logger) + rollback(): void } - interface Logger { + interface Tx { /** - * WithGroup returns a Logger that starts a group, if name is non-empty. - * The keys of all attributes added to the Logger will be qualified by the given - * name. (How that qualification happens depends on the [Handler.WithGroup] - * method of the Logger's Handler.) + * PrepareContext creates a prepared statement for use within a transaction. * - * If name is empty, WithGroup returns the receiver. - */ - withGroup(name: string): (Logger) - } - interface Logger { - /** - * Enabled reports whether l emits log records at the given context and level. - */ - enabled(ctx: context.Context, level: Level): boolean - } - interface Logger { - /** - * Log emits a log record with the current time and the given level and message. - * The Record's Attrs consist of the Logger's attributes followed by - * the Attrs specified by args. + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. * - * The attribute arguments are processed as follows: - * ``` - * - If an argument is an Attr, it is used as is. - * - If an argument is a string and this is not the last argument, - * the following argument is treated as the value and the two are combined - * into an Attr. - * - Otherwise, the argument is treated as a value with key "!BADKEY". - * ``` - */ - log(ctx: context.Context, level: Level, msg: string, ...args: any[]): void - } - interface Logger { - /** - * LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs. - */ - logAttrs(ctx: context.Context, level: Level, msg: string, ...attrs: Attr[]): void - } - interface Logger { - /** - * Debug logs at [LevelDebug]. - */ - debug(msg: string, ...args: any[]): void - } - interface Logger { - /** - * DebugContext logs at [LevelDebug] with the given context. - */ - debugContext(ctx: context.Context, msg: string, ...args: any[]): void - } - interface Logger { - /** - * Info logs at [LevelInfo]. - */ - info(msg: string, ...args: any[]): void - } - interface Logger { - /** - * InfoContext logs at [LevelInfo] with the given context. - */ - infoContext(ctx: context.Context, msg: string, ...args: any[]): void - } - interface Logger { - /** - * Warn logs at [LevelWarn]. - */ - warn(msg: string, ...args: any[]): void - } - interface Logger { - /** - * WarnContext logs at [LevelWarn] with the given context. - */ - warnContext(ctx: context.Context, msg: string, ...args: any[]): void - } - interface Logger { - /** - * Error logs at [LevelError]. - */ - error(msg: string, ...args: any[]): void - } - interface Logger { - /** - * ErrorContext logs at [LevelError] with the given context. - */ - errorContext(ctx: context.Context, msg: string, ...args: any[]): void - } -} - -namespace subscriptions { - /** - * Broker defines a struct for managing subscriptions clients. - */ - interface Broker { - } - interface Broker { - /** - * Clients returns a shallow copy of all registered clients indexed - * with their connection id. - */ - clients(): _TygojaDict - } - interface Broker { - /** - * ChunkedClients splits the current clients into a chunked slice. - */ - chunkedClients(chunkSize: number): Array> - } - interface Broker { - /** - * TotalClients returns the total number of registered clients. - */ - totalClients(): number - } - interface Broker { - /** - * ClientById finds a registered client by its id. + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. * - * Returns non-nil error when client with clientId is not registered. + * The provided context will be used for the preparation of the context, not + * for the execution of the returned statement. The returned statement + * will run in the transaction context. */ - clientById(clientId: string): Client + prepareContext(ctx: context.Context, query: string): (Stmt) } - interface Broker { + interface Tx { /** - * Register adds a new client to the broker instance. - */ - register(client: Client): void - } - interface Broker { - /** - * Unregister removes a single client by its id and marks it as discarded. + * Prepare creates a prepared statement for use within a transaction. * - * If client with clientId doesn't exist, this method does nothing. - */ - unregister(clientId: string): void - } - /** - * Message defines a client's channel data. - */ - interface Message { - name: string - data: string|Array - } - /** - * Client is an interface for a generic subscription client. - */ - interface Client { - [key:string]: any; - /** - * Id Returns the unique id of the client. - */ - id(): string - /** - * Channel returns the client's communication channel. + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. * - * NB! The channel shouldn't be used after calling Discard(). - */ - channel(): undefined - /** - * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. - * If no prefix is specified, returns all subscriptions. - */ - subscriptions(...prefixes: string[]): _TygojaDict - /** - * Subscribe subscribes the client to the provided subscriptions list. + * To use an existing prepared statement on this transaction, see [Tx.Stmt]. * - * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. + * Prepare uses [context.Background] internally; to specify the context, use + * [Tx.PrepareContext]. + */ + prepare(query: string): (Stmt) + } + interface Tx { + /** + * StmtContext returns a transaction-specific prepared statement from + * an existing statement. * * Example: * * ``` - * Subscribe( - * "subscriptionA", - * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, - * ) + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) * ``` - */ - subscribe(...subs: string[]): void - /** - * Unsubscribe unsubscribes the client from the provided subscriptions list. - */ - unsubscribe(...subs: string[]): void - /** - * HasSubscription checks if the client is subscribed to `sub`. - */ - hasSubscription(sub: string): boolean - /** - * Set stores any value to the client's context. - */ - set(key: string, value: any): void - /** - * Unset removes a single value from the client's context. - */ - unset(key: string): void - /** - * Get retrieves the key value from the client's context. - */ - get(key: string): any - /** - * Discard marks the client as "discarded" (and closes its channel), - * meaning that it shouldn't be used anymore for sending new messages. * - * It is safe to call Discard() multiple times. + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. */ - discard(): void - /** - * IsDiscarded indicates whether the client has been "discarded" - * and should no longer be used. - */ - isDiscarded(): boolean - /** - * Send sends the specified message to the client's channel (if not discarded). - */ - send(m: Message): void + stmtContext(ctx: context.Context, stmt: Stmt): (Stmt) } -} - -namespace hook { - /** - * Event implements [Resolver] and it is intended to be used as a base - * Hook event that you can embed in your custom typed event structs. - * - * Example: - * - * ``` - * type CustomEvent struct { - * hook.Event - * - * SomeField int - * } - * ``` - */ - interface Event { - } - interface Event { + interface Tx { /** - * Next calls the next hook handler. + * Stmt returns a transaction-specific prepared statement from + * an existing statement. + * + * Example: + * + * ``` + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) + * ``` + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * Stmt uses [context.Background] internally; to specify the context, use + * [Tx.StmtContext]. */ - next(): void + stmt(stmt: Stmt): (Stmt) + } + interface Tx { + /** + * ExecContext executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. + */ + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface Tx { + /** + * Exec executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. + * + * Exec uses [context.Background] internally; to specify the context, use + * [Tx.ExecContext]. + */ + exec(query: string, ...args: any[]): Result + } + interface Tx { + /** + * QueryContext executes a query that returns rows, typically a SELECT. + */ + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface Tx { + /** + * Query executes a query that returns rows, typically a SELECT. + * + * Query uses [context.Background] internally; to specify the context, use + * [Tx.QueryContext]. + */ + query(query: string, ...args: any[]): (Rows) + } + interface Tx { + /** + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + } + interface Tx { + /** + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * [Row]'s Scan method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [Tx.QueryRowContext]. + */ + queryRow(query: string, ...args: any[]): (Row) } /** - * Handler defines a single Hook handler. - * Multiple handlers can share the same id. - * If Id is not explicitly set it will be autogenerated by Hook.Add and Hook.AddHandler. + * Stmt is a prepared statement. + * A Stmt is safe for concurrent use by multiple goroutines. + * + * If a Stmt is prepared on a [Tx] or [Conn], it will be bound to a single + * underlying connection forever. If the [Tx] or [Conn] closes, the Stmt will + * become unusable and all operations will return an error. + * If a Stmt is prepared on a [DB], it will remain usable for the lifetime of the + * [DB]. When the Stmt needs to execute on a new underlying connection, it will + * prepare itself on the new connection automatically. */ - interface Handler { + interface Stmt { + } + interface Stmt { /** - * Func defines the handler function to execute. - * - * Note that users need to call e.Next() in order to proceed with - * the execution of the hook chain. + * ExecContext executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. */ - func: (_arg0: T) => void + execContext(ctx: context.Context, ...args: any[]): Result + } + interface Stmt { /** - * Id is the unique identifier of the handler. + * Exec executes a prepared statement with the given arguments and + * returns a [Result] summarizing the effect of the statement. * - * It could be used later to remove the handler from a hook via [Hook.Remove]. - * - * If missing, an autogenerated value will be assigned when adding - * the handler to a hook. + * Exec uses [context.Background] internally; to specify the context, use + * [Stmt.ExecContext]. */ - id: string + exec(...args: any[]): Result + } + interface Stmt { /** - * Priority allows changing the default exec priority of the handler within a hook. - * - * If 0, the handler will be executed in the same order it was registered. + * QueryContext executes a prepared query statement with the given arguments + * and returns the query results as a [*Rows]. */ - priority: number + queryContext(ctx: context.Context, ...args: any[]): (Rows) + } + interface Stmt { + /** + * Query executes a prepared query statement with the given arguments + * and returns the query results as a *Rows. + * + * Query uses [context.Background] internally; to specify the context, use + * [Stmt.QueryContext]. + */ + query(...args: any[]): (Rows) + } + interface Stmt { + /** + * QueryRowContext executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, ...args: any[]): (Row) + } + interface Stmt { + /** + * QueryRow executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned [*Row], which is always non-nil. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + * + * Example usage: + * + * ``` + * var name string + * err := nameByUseridStmt.QueryRow(id).Scan(&name) + * ``` + * + * QueryRow uses [context.Background] internally; to specify the context, use + * [Stmt.QueryRowContext]. + */ + queryRow(...args: any[]): (Row) + } + interface Stmt { + /** + * Close closes the statement. + */ + close(): void } /** - * Hook defines a generic concurrent safe structure for managing event hooks. - * - * When using custom event it must embed the base [hook.Event]. - * - * Example: - * - * ``` - * type CustomEvent struct { - * hook.Event - * SomeField int - * } - * - * h := Hook[*CustomEvent]{} - * - * h.BindFunc(func(e *CustomEvent) error { - * println(e.SomeField) - * - * return e.Next() - * }) - * - * h.Trigger(&CustomEvent{ SomeField: 123 }) - * ``` + * Rows is the result of a query. Its cursor starts before the first row + * of the result set. Use [Rows.Next] to advance from row to row. */ - interface Hook { + interface Rows { } - interface Hook { + interface Rows { /** - * Bind registers the provided handler to the current hooks queue. + * Next prepares the next result row for reading with the [Rows.Scan] method. It + * returns true on success, or false if there is no next result row or an error + * happened while preparing it. [Rows.Err] should be consulted to distinguish between + * the two cases. * - * If handler.Id is empty it is updated with autogenerated value. - * - * If a handler from the current hook list has Id matching handler.Id - * then the old handler is replaced with the new one. + * Every call to [Rows.Scan], even the first one, must be preceded by a call to [Rows.Next]. */ - bind(handler: Handler): string + next(): boolean } - interface Hook { + interface Rows { /** - * BindFunc is similar to Bind but registers a new handler from just the provided function. + * NextResultSet prepares the next result set for reading. It reports whether + * there is further result sets, or false if there is no further result set + * or if there is an error advancing to it. The [Rows.Err] method should be consulted + * to distinguish between the two cases. * - * The registered handler is added with a default 0 priority and the id will be autogenerated. + * After calling NextResultSet, the [Rows.Next] method should always be called before + * scanning. If there are further result sets they may not have rows in the result + * set. + */ + nextResultSet(): boolean + } + interface Rows { + /** + * Err returns the error, if any, that was encountered during iteration. + * Err may be called after an explicit or implicit [Rows.Close]. + */ + err(): void + } + interface Rows { + /** + * Columns returns the column names. + * Columns returns an error if the rows are closed. + */ + columns(): Array + } + interface Rows { + /** + * ColumnTypes returns column information such as column type, length, + * and nullable. Some information may not be available from some drivers. + */ + columnTypes(): Array<(ColumnType | undefined)> + } + interface Rows { + /** + * Scan copies the columns in the current row into the values pointed + * at by dest. The number of values in dest must be the same as the + * number of columns in [Rows]. * - * If you want to register a handler with custom priority or id use the [Hook.Bind] method. - */ - bindFunc(fn: (e: T) => void): string - } - interface Hook { - /** - * Unbind removes one or many hook handler by their id. - */ - unbind(...idsToRemove: string[]): void - } - interface Hook { - /** - * UnbindAll removes all registered handlers. - */ - unbindAll(): void - } - interface Hook { - /** - * Length returns to total number of registered hook handlers. - */ - length(): number - } - interface Hook { - /** - * Trigger executes all registered hook handlers one by one - * with the specified event as an argument. + * Scan converts columns read from the database into the following + * common Go types and special types provided by the sql package: * - * Optionally, this method allows also to register additional one off - * handler funcs that will be temporary appended to the handlers queue. + * ``` + * *string + * *[]byte + * *int, *int8, *int16, *int32, *int64 + * *uint, *uint8, *uint16, *uint32, *uint64 + * *bool + * *float32, *float64 + * *interface{} + * *RawBytes + * *Rows (cursor value) + * any type implementing Scanner (see Scanner docs) + * ``` * - * NB! Each hook handler must call event.Next() in order the hook chain to proceed. + * In the most simple case, if the type of the value from the source + * column is an integer, bool or string type T and dest is of type *T, + * Scan simply assigns the value through the pointer. + * + * Scan also converts between string and numeric types, as long as no + * information would be lost. While Scan stringifies all numbers + * scanned from numeric database columns into *string, scans into + * numeric types are checked for overflow. For example, a float64 with + * value 300 or a string with value "300" can scan into a uint16, but + * not into a uint8, though float64(255) or "255" can scan into a + * uint8. One exception is that scans of some float64 numbers to + * strings may lose information when stringifying. In general, scan + * floating point columns into *float64. + * + * If a dest argument has type *[]byte, Scan saves in that argument a + * copy of the corresponding data. The copy is owned by the caller and + * can be modified and held indefinitely. The copy can be avoided by + * using an argument of type [*RawBytes] instead; see the documentation + * for [RawBytes] for restrictions on its use. + * + * If an argument has type *interface{}, Scan copies the value + * provided by the underlying driver without conversion. When scanning + * from a source value of type []byte to *interface{}, a copy of the + * slice is made and the caller owns the result. + * + * Source values of type [time.Time] may be scanned into values of type + * *time.Time, *interface{}, *string, or *[]byte. When converting to + * the latter two, [time.RFC3339Nano] is used. + * + * Source values of type bool may be scanned into types *bool, + * *interface{}, *string, *[]byte, or [*RawBytes]. + * + * For scanning into *bool, the source may be true, false, 1, 0, or + * string inputs parseable by [strconv.ParseBool]. + * + * Scan can also convert a cursor returned from a query, such as + * "select cursor(select * from my_table) from dual", into a + * [*Rows] value that can itself be scanned from. The parent + * select query will close any cursor [*Rows] if the parent [*Rows] is closed. + * + * If any of the first arguments implementing [Scanner] returns an error, + * that error will be wrapped in the returned error. */ - trigger(event: T, ...oneOffHandlerFuncs: ((_arg0: T) => void)[]): void + scan(...dest: any[]): void + } + interface Rows { + /** + * Close closes the [Rows], preventing further enumeration. If [Rows.Next] is called + * and returns false and there are no further result sets, + * the [Rows] are closed automatically and it will suffice to check the + * result of [Rows.Err]. Close is idempotent and does not affect the result of [Rows.Err]. + */ + close(): void } /** - * TaggedHook defines a proxy hook which register handlers that are triggered only - * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). + * A Result summarizes an executed SQL command. */ - type _subCHHJv = mainHook - interface TaggedHook extends _subCHHJv { - } - interface TaggedHook { - /** - * CanTriggerOn checks if the current TaggedHook can be triggered with - * the provided event data tags. - * - * It returns always true if the hook doens't have any tags. - */ - canTriggerOn(tagsToCheck: Array): boolean - } - interface TaggedHook { - /** - * Bind registers the provided handler to the current hooks queue. - * - * It is similar to [Hook.Bind] with the difference that the handler - * function is invoked only if the event data tags satisfy h.CanTriggerOn. - */ - bind(handler: Handler): string - } - interface TaggedHook { - /** - * BindFunc registers a new handler with the specified function. - * - * It is similar to [Hook.Bind] with the difference that the handler - * function is invoked only if the event data tags satisfy h.CanTriggerOn. - */ - bindFunc(fn: (e: T) => void): string - } -} - -namespace mailer { - /** - * Message defines a generic email message struct. - */ - interface Message { - from: { address: string; name?: string; } - to: Array<{ address: string; name?: string; }> - bcc: Array<{ address: string; name?: string; }> - cc: Array<{ address: string; name?: string; }> - subject: string - html: string - text: string - headers: _TygojaDict - attachments: _TygojaDict - } - /** - * Mailer defines a base mail client interface. - */ - interface Mailer { + interface Result { [key:string]: any; /** - * Send sends an email with the provided Message. + * LastInsertId returns the integer generated by the database + * in response to a command. Typically this will be from an + * "auto increment" column when inserting a new row. Not all + * databases support this feature, and the syntax of such + * statements varies. */ - send(message: Message): void + lastInsertId(): number + /** + * RowsAffected returns the number of rows affected by an + * update, insert, or delete. Not every database or database + * driver may support this. + */ + rowsAffected(): number + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * DateTime represents a [time.Time] instance in UTC that is wrapped + * and serialized using the app default date layout. + */ + interface DateTime { + } + interface DateTime { + /** + * Time returns the internal [time.Time] instance. + */ + time(): time.Time + } + interface DateTime { + /** + * Add returns a new DateTime based on the current DateTime + the specified duration. + */ + add(duration: time.Duration): DateTime + } + interface DateTime { + /** + * Sub returns a [time.Duration] by subtracting the specified DateTime from the current one. + * + * If the result exceeds the maximum (or minimum) value that can be stored in a [time.Duration], + * the maximum (or minimum) duration will be returned. + */ + sub(u: DateTime): time.Duration + } + interface DateTime { + /** + * AddDate returns a new DateTime based on the current one + duration. + * + * It follows the same rules as [time.AddDate]. + */ + addDate(years: number, months: number, days: number): DateTime + } + interface DateTime { + /** + * After reports whether the current DateTime instance is after u. + */ + after(u: DateTime): boolean + } + interface DateTime { + /** + * Before reports whether the current DateTime instance is before u. + */ + before(u: DateTime): boolean + } + interface DateTime { + /** + * Compare compares the current DateTime instance with u. + * If the current instance is before u, it returns -1. + * If the current instance is after u, it returns +1. + * If they're the same, it returns 0. + */ + compare(u: DateTime): number + } + interface DateTime { + /** + * Equal reports whether the current DateTime and u represent the same time instant. + * Two DateTime can be equal even if they are in different locations. + * For example, 6:00 +0200 and 4:00 UTC are Equal. + */ + equal(u: DateTime): boolean + } + interface DateTime { + /** + * Unix returns the current DateTime as a Unix time, aka. + * the number of seconds elapsed since January 1, 1970 UTC. + */ + unix(): number + } + interface DateTime { + /** + * IsZero checks whether the current DateTime instance has zero time value. + */ + isZero(): boolean + } + interface DateTime { + /** + * String serializes the current DateTime instance into a formatted + * UTC date string. + * + * The zero value is serialized to an empty string. + */ + string(): string + } + interface DateTime { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface DateTime { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(b: string|Array): void + } + interface DateTime { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface DateTime { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current DateTime instance. + */ + scan(value: any): void + } + /** + * JSONArray defines a slice that is safe for json and db read/write. + */ + interface JSONArray extends Array{} + interface JSONArray { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JSONArray { + /** + * String returns the string representation of the current json array. + */ + string(): string + } + interface JSONArray { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JSONArray { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JSONArray[T] instance. + */ + scan(value: any): void + } + /** + * JSONMap defines a map that is safe for json and db read/write. + */ + interface JSONMap extends _TygojaDict{} + interface JSONMap { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JSONMap { + /** + * String returns the string representation of the current json map. + */ + string(): string + } + interface JSONMap { + /** + * Get retrieves a single value from the current JSONMap[T]. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + */ + get(key: string): T + } + interface JSONMap { + /** + * Set sets a single value in the current JSONMap[T]. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + */ + set(key: string, value: T): void + } + interface JSONMap { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JSONMap { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JSONMap[T] instance. + */ + scan(value: any): void + } + /** + * JSONRaw defines a json value type that is safe for db read/write. + */ + interface JSONRaw extends Array{} + interface JSONRaw { + /** + * String returns the current JSONRaw instance as a json encoded string. + */ + string(): string + } + interface JSONRaw { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JSONRaw { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(b: string|Array): void + } + interface JSONRaw { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JSONRaw { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JSONRaw instance. + */ + scan(value: any): void + } +} + +namespace search { + /** + * Result defines the returned search result structure. + */ + interface Result { + items: any + page: number + perPage: number + totalItems: number + totalPages: number + } + /** + * ResolverResult defines a single FieldResolver.Resolve() successfully parsed result. + */ + interface ResolverResult { + /** + * Identifier is the plain SQL identifier/column that will be used + * in the final db expression as left or right operand. + */ + identifier: string + /** + * NoCoalesce instructs to not use COALESCE or NULL fallbacks + * when building the identifier expression. + */ + noCoalesce: boolean + /** + * Params is a map with db placeholder->value pairs that will be added + * to the query when building both resolved operands/sides in a single expression. + */ + params: dbx.Params + /** + * MultiMatchSubQuery is an optional sub query expression that will be added + * in addition to the combined ResolverResult expression during build. + */ + multiMatchSubQuery: dbx.Expression + /** + * AfterBuild is an optional function that will be called after building + * and combining the result of both resolved operands/sides in a single expression. + */ + afterBuild: (expr: dbx.Expression) => dbx.Expression } } @@ -20422,8 +20157,8 @@ namespace router { * * NB! It is expected that the Response and Request fields are always set. */ - type _sublaxmZ = hook.Event - interface Event extends _sublaxmZ { + type _subLVpfn = hook.Event + interface Event extends _subLVpfn { response: http.ResponseWriter request?: http.Request } @@ -20657,8 +20392,8 @@ namespace router { * http.ListenAndServe("localhost:8090", mux) * ``` */ - type _subroAzk = RouterGroup - interface Router extends _subroAzk { + type _subzRpSJ = RouterGroup + interface Router extends _subzRpSJ { } interface Router { /** @@ -20668,6 +20403,285 @@ namespace router { } } +namespace auth { + /** + * Provider defines a common interface for an OAuth2 client. + */ + interface Provider { + [key:string]: any; + /** + * Context returns the context associated with the provider (if any). + */ + context(): context.Context + /** + * SetContext assigns the specified context to the current provider. + */ + setContext(ctx: context.Context): void + /** + * PKCE indicates whether the provider can use the PKCE flow. + */ + pkce(): boolean + /** + * SetPKCE toggles the state whether the provider can use the PKCE flow or not. + */ + setPKCE(enable: boolean): void + /** + * DisplayName usually returns provider name as it is officially written + * and it could be used directly in the UI. + */ + displayName(): string + /** + * SetDisplayName sets the provider's display name. + */ + setDisplayName(displayName: string): void + /** + * Scopes returns the provider access permissions that will be requested. + */ + scopes(): Array + /** + * SetScopes sets the provider access permissions that will be requested later. + */ + setScopes(scopes: Array): void + /** + * ClientId returns the provider client's app ID. + */ + clientId(): string + /** + * SetClientId sets the provider client's ID. + */ + setClientId(clientId: string): void + /** + * ClientSecret returns the provider client's app secret. + */ + clientSecret(): string + /** + * SetClientSecret sets the provider client's app secret. + */ + setClientSecret(secret: string): void + /** + * RedirectURL returns the end address to redirect the user + * going through the OAuth flow. + */ + redirectURL(): string + /** + * SetRedirectURL sets the provider's RedirectURL. + */ + setRedirectURL(url: string): void + /** + * AuthURL returns the provider's authorization service url. + */ + authURL(): string + /** + * SetAuthURL sets the provider's AuthURL. + */ + setAuthURL(url: string): void + /** + * TokenURL returns the provider's token exchange service url. + */ + tokenURL(): string + /** + * SetTokenURL sets the provider's TokenURL. + */ + setTokenURL(url: string): void + /** + * UserInfoURL returns the provider's user info api url. + */ + userInfoURL(): string + /** + * SetUserInfoURL sets the provider's UserInfoURL. + */ + setUserInfoURL(url: string): void + /** + * Extra returns a shallow copy of any custom config data + * that the provider may be need. + */ + extra(): _TygojaDict + /** + * SetExtra updates the provider's custom config data. + */ + setExtra(data: _TygojaDict): void + /** + * Client returns an http client using the provided token. + */ + client(token: oauth2.Token): (any) + /** + * BuildAuthURL returns a URL to the provider's consent page + * that asks for permissions for the required scopes explicitly. + */ + buildAuthURL(state: string, ...opts: oauth2.AuthCodeOption[]): string + /** + * FetchToken converts an authorization code to token. + */ + fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) + /** + * FetchRawUserInfo requests and marshalizes into `result` the + * the OAuth user api response. + */ + fetchRawUserInfo(token: oauth2.Token): string|Array + /** + * FetchAuthUser is similar to FetchRawUserInfo, but normalizes and + * marshalizes the user api response into a standardized AuthUser struct. + */ + fetchAuthUser(token: oauth2.Token): (AuthUser) + } + /** + * AuthUser defines a standardized OAuth2 user data structure. + */ + interface AuthUser { + expiry: types.DateTime + rawUser: _TygojaDict + id: string + name: string + username: string + email: string + avatarURL: string + accessToken: string + refreshToken: string + /** + * @todo + * deprecated: use AvatarURL instead + * AvatarUrl will be removed after dropping v0.22 support + */ + avatarUrl: string + } + interface AuthUser { + /** + * MarshalJSON implements the [json.Marshaler] interface. + * + * @todo remove after dropping v0.22 support + */ + marshalJSON(): string|Array + } +} + +namespace subscriptions { + /** + * Broker defines a struct for managing subscriptions clients. + */ + interface Broker { + } + interface Broker { + /** + * Clients returns a shallow copy of all registered clients indexed + * with their connection id. + */ + clients(): _TygojaDict + } + interface Broker { + /** + * ChunkedClients splits the current clients into a chunked slice. + */ + chunkedClients(chunkSize: number): Array> + } + interface Broker { + /** + * TotalClients returns the total number of registered clients. + */ + totalClients(): number + } + interface Broker { + /** + * ClientById finds a registered client by its id. + * + * Returns non-nil error when client with clientId is not registered. + */ + clientById(clientId: string): Client + } + interface Broker { + /** + * Register adds a new client to the broker instance. + */ + register(client: Client): void + } + interface Broker { + /** + * Unregister removes a single client by its id and marks it as discarded. + * + * If client with clientId doesn't exist, this method does nothing. + */ + unregister(clientId: string): void + } + /** + * Message defines a client's channel data. + */ + interface Message { + name: string + data: string|Array + } + /** + * Client is an interface for a generic subscription client. + */ + interface Client { + [key:string]: any; + /** + * Id Returns the unique id of the client. + */ + id(): string + /** + * Channel returns the client's communication channel. + * + * NB! The channel shouldn't be used after calling Discard(). + */ + channel(): undefined + /** + * Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. + * If no prefix is specified, returns all subscriptions. + */ + subscriptions(...prefixes: string[]): _TygojaDict + /** + * Subscribe subscribes the client to the provided subscriptions list. + * + * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. + * + * Example: + * + * ``` + * Subscribe( + * "subscriptionA", + * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, + * ) + * ``` + */ + subscribe(...subs: string[]): void + /** + * Unsubscribe unsubscribes the client from the provided subscriptions list. + */ + unsubscribe(...subs: string[]): void + /** + * HasSubscription checks if the client is subscribed to `sub`. + */ + hasSubscription(sub: string): boolean + /** + * Set stores any value to the client's context. + */ + set(key: string, value: any): void + /** + * Unset removes a single value from the client's context. + */ + unset(key: string): void + /** + * Get retrieves the key value from the client's context. + */ + get(key: string): any + /** + * Discard marks the client as "discarded" (and closes its channel), + * meaning that it shouldn't be used anymore for sending new messages. + * + * It is safe to call Discard() multiple times. + */ + discard(): void + /** + * IsDiscarded indicates whether the client has been "discarded" + * and should no longer be used. + */ + isDiscarded(): boolean + /** + * Send sends the specified message to the client's channel (if not discarded). + */ + send(m: Message): void + } +} + /** * Package sync provides basic synchronization primitives such as mutual * exclusion locks. Other than the [Once] and [WaitGroup] types, most are intended @@ -20902,62 +20916,6 @@ namespace time { } } -/** - * Package context defines the Context type, which carries deadlines, - * cancellation signals, and other request-scoped values across API boundaries - * and between processes. - * - * Incoming requests to a server should create a [Context], and outgoing - * calls to servers should accept a Context. The chain of function - * calls between them must propagate the Context, optionally replacing - * it with a derived Context created using [WithCancel], [WithDeadline], - * [WithTimeout], or [WithValue]. When a Context is canceled, all - * Contexts derived from it are also canceled. - * - * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a - * Context (the parent) and return a derived Context (the child) and a - * [CancelFunc]. Calling the CancelFunc cancels the child and its - * children, removes the parent's reference to the child, and stops - * any associated timers. Failing to call the CancelFunc leaks the - * child and its children until the parent is canceled or the timer - * fires. The go vet tool checks that CancelFuncs are used on all - * control-flow paths. - * - * The [WithCancelCause] function returns a [CancelCauseFunc], which - * takes an error and records it as the cancellation cause. Calling - * [Cause] on the canceled context or any of its children retrieves - * the cause. If no cause is specified, Cause(ctx) returns the same - * value as ctx.Err(). - * - * Programs that use Contexts should follow these rules to keep interfaces - * consistent across packages and enable static analysis tools to check context - * propagation: - * - * Do not store Contexts inside a struct type; instead, pass a Context - * explicitly to each function that needs it. The Context should be the first - * parameter, typically named ctx: - * - * ``` - * func DoSomething(ctx context.Context, arg Arg) error { - * // ... use ctx ... - * } - * ``` - * - * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] - * if you are unsure about which Context to use. - * - * Use context Values only for request-scoped data that transits processes and - * APIs, not for passing optional parameters to functions. - * - * The same Context may be passed to functions running in different goroutines; - * Contexts are safe for simultaneous use by multiple goroutines. - * - * See https://blog.golang.org/context for example code for a server that uses - * Contexts. - */ -namespace context { -} - /** * Package fs defines basic interfaces to a file system. * A file system can be provided by the host operating system @@ -20969,135 +20927,6 @@ namespace context { namespace fs { } -/** - * Package net provides a portable interface for network I/O, including - * TCP/IP, UDP, domain name resolution, and Unix domain sockets. - * - * Although the package provides access to low-level networking - * primitives, most clients will need only the basic interface provided - * by the [Dial], [Listen], and Accept functions and the associated - * [Conn] and [Listener] interfaces. The crypto/tls package uses - * the same interfaces and similar Dial and Listen functions. - * - * The Dial function connects to a server: - * - * ``` - * conn, err := net.Dial("tcp", "golang.org:80") - * if err != nil { - * // handle error - * } - * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") - * status, err := bufio.NewReader(conn).ReadString('\n') - * // ... - * ``` - * - * The Listen function creates servers: - * - * ``` - * ln, err := net.Listen("tcp", ":8080") - * if err != nil { - * // handle error - * } - * for { - * conn, err := ln.Accept() - * if err != nil { - * // handle error - * } - * go handleConnection(conn) - * } - * ``` - * - * # Name Resolution - * - * The method for resolving domain names, whether indirectly with functions like Dial - * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. - * - * On Unix systems, the resolver has two options for resolving names. - * It can use a pure Go resolver that sends DNS requests directly to the servers - * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C - * library routines such as getaddrinfo and getnameinfo. - * - * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS - * request consumes only a goroutine, while a blocked C call consumes an operating system thread. - * When cgo is available, the cgo-based resolver is used instead under a variety of - * conditions: on systems that do not let programs make direct DNS requests (OS X), - * when the LOCALDOMAIN environment variable is present (even if empty), - * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, - * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), - * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the - * Go resolver does not implement. - * - * On all systems (except Plan 9), when the cgo resolver is being used - * this package applies a concurrent cgo lookup limit to prevent the system - * from running out of system threads. Currently, it is limited to 500 concurrent lookups. - * - * The resolver decision can be overridden by setting the netdns value of the - * GODEBUG environment variable (see package runtime) to go or cgo, as in: - * - * ``` - * export GODEBUG=netdns=go # force pure Go resolver - * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) - * ``` - * - * The decision can also be forced while building the Go source tree - * by setting the netgo or netcgo build tag. - * - * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver - * to print debugging information about its decisions. - * To force a particular resolver while also printing debugging information, - * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. - * - * The Go resolver will send an EDNS0 additional header with a DNS request, - * to signal a willingness to accept a larger DNS packet size. - * This can reportedly cause sporadic failures with the DNS server run - * by some modems and routers. Setting GODEBUG=netedns0=0 will disable - * sending the additional header. - * - * On macOS, if Go code that uses the net package is built with - * -buildmode=c-archive, linking the resulting archive into a C program - * requires passing -lresolv when linking the C code. - * - * On Plan 9, the resolver always accesses /net/cs and /net/dns. - * - * On Windows, in Go 1.18.x and earlier, the resolver always used C - * library functions, such as GetAddrInfo and DnsQuery. - */ -namespace net { - /** - * Addr represents a network end point address. - * - * The two methods [Addr.Network] and [Addr.String] conventionally return strings - * that can be passed as the arguments to [Dial], but the exact form - * and meaning of the strings is up to the implementation. - */ - interface Addr { - [key:string]: any; - network(): string // name of the network (for example, "tcp", "udp") - string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") - } - /** - * A Listener is a generic network listener for stream-oriented protocols. - * - * Multiple goroutines may invoke methods on a Listener simultaneously. - */ - interface Listener { - [key:string]: any; - /** - * Accept waits for and returns the next connection to the listener. - */ - accept(): Conn - /** - * Close closes the listener. - * Any blocked Accept operations will be unblocked and return errors. - */ - close(): void - /** - * Addr returns the listener's network address. - */ - addr(): Addr - } -} - /** * Package url parses URLs and implements query escaping. */ @@ -21601,6 +21430,407 @@ namespace bufio { } } +/** + * Package context defines the Context type, which carries deadlines, + * cancellation signals, and other request-scoped values across API boundaries + * and between processes. + * + * Incoming requests to a server should create a [Context], and outgoing + * calls to servers should accept a Context. The chain of function + * calls between them must propagate the Context, optionally replacing + * it with a derived Context created using [WithCancel], [WithDeadline], + * [WithTimeout], or [WithValue]. When a Context is canceled, all + * Contexts derived from it are also canceled. + * + * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a + * Context (the parent) and return a derived Context (the child) and a + * [CancelFunc]. Calling the CancelFunc cancels the child and its + * children, removes the parent's reference to the child, and stops + * any associated timers. Failing to call the CancelFunc leaks the + * child and its children until the parent is canceled or the timer + * fires. The go vet tool checks that CancelFuncs are used on all + * control-flow paths. + * + * The [WithCancelCause] function returns a [CancelCauseFunc], which + * takes an error and records it as the cancellation cause. Calling + * [Cause] on the canceled context or any of its children retrieves + * the cause. If no cause is specified, Cause(ctx) returns the same + * value as ctx.Err(). + * + * Programs that use Contexts should follow these rules to keep interfaces + * consistent across packages and enable static analysis tools to check context + * propagation: + * + * Do not store Contexts inside a struct type; instead, pass a Context + * explicitly to each function that needs it. The Context should be the first + * parameter, typically named ctx: + * + * ``` + * func DoSomething(ctx context.Context, arg Arg) error { + * // ... use ctx ... + * } + * ``` + * + * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] + * if you are unsure about which Context to use. + * + * Use context Values only for request-scoped data that transits processes and + * APIs, not for passing optional parameters to functions. + * + * The same Context may be passed to functions running in different goroutines; + * Contexts are safe for simultaneous use by multiple goroutines. + * + * See https://blog.golang.org/context for example code for a server that uses + * Contexts. + */ +namespace context { +} + +/** + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. + * + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. + * + * Drivers that do not support context cancellation will not return until + * after the query is completed. + * + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. + */ +namespace sql { + /** + * IsolationLevel is the transaction isolation level used in [TxOptions]. + */ + interface IsolationLevel extends Number{} + interface IsolationLevel { + /** + * String returns the name of the transaction isolation level. + */ + string(): string + } + /** + * DBStats contains database statistics. + */ + interface DBStats { + maxOpenConnections: number // Maximum number of open connections to the database. + /** + * Pool Status + */ + openConnections: number // The number of established connections both in use and idle. + inUse: number // The number of connections currently in use. + idle: number // The number of idle connections. + /** + * Counters + */ + waitCount: number // The total number of connections waited for. + waitDuration: time.Duration // The total time blocked waiting for a new connection. + maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. + maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. + maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. + } + /** + * Conn represents a single database connection rather than a pool of database + * connections. Prefer running queries from [DB] unless there is a specific + * need for a continuous single database connection. + * + * A Conn must call [Conn.Close] to return the connection to the database pool + * and may do so concurrently with a running query. + * + * After a call to [Conn.Close], all operations on the + * connection fail with [ErrConnDone]. + */ + interface Conn { + } + interface Conn { + /** + * PingContext verifies the connection to the database is still alive. + */ + pingContext(ctx: context.Context): void + } + interface Conn { + /** + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. + */ + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface Conn { + /** + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + */ + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) + } + interface Conn { + /** + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * the [*Row.Scan] method is called. + * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. + * Otherwise, the [*Row.Scan] scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) + } + interface Conn { + /** + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's [*Stmt.Close] method + * when the statement is no longer needed. + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. + */ + prepareContext(ctx: context.Context, query: string): (Stmt) + } + interface Conn { + /** + * Raw executes f exposing the underlying driver connection for the + * duration of f. The driverConn must not be used outside of f. + * + * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable + * until [Conn.Close] is called. + */ + raw(f: (driverConn: any) => void): void + } + interface Conn { + /** + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. [Tx.Commit] will return an error if the context provided to + * BeginTx is canceled. + * + * The provided [TxOptions] is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. + */ + beginTx(ctx: context.Context, opts: TxOptions): (Tx) + } + interface Conn { + /** + * Close returns the connection to the connection pool. + * All operations after a Close will return with [ErrConnDone]. + * Close is safe to call concurrently with other operations and will + * block until all other operations finish. It may be useful to first + * cancel any used context and then call close directly after. + */ + close(): void + } + /** + * ColumnType contains the name and type of a column. + */ + interface ColumnType { + } + interface ColumnType { + /** + * Name returns the name or alias of the column. + */ + name(): string + } + interface ColumnType { + /** + * Length returns the column type length for variable length column types such + * as text and binary field types. If the type length is unbounded the value will + * be [math.MaxInt64] (any database limits will still apply). + * If the column type is not variable length, such as an int, or if not supported + * by the driver ok is false. + */ + length(): [number, boolean] + } + interface ColumnType { + /** + * DecimalSize returns the scale and precision of a decimal type. + * If not applicable or if not supported ok is false. + */ + decimalSize(): [number, number, boolean] + } + interface ColumnType { + /** + * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. + * If a driver does not support this property ScanType will return + * the type of an empty interface. + */ + scanType(): any + } + interface ColumnType { + /** + * Nullable reports whether the column may be null. + * If a driver does not support this property ok will be false. + */ + nullable(): [boolean, boolean] + } + interface ColumnType { + /** + * DatabaseTypeName returns the database system name of the column type. If an empty + * string is returned, then the driver type name is not supported. + * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers + * are not included. + * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". + */ + databaseTypeName(): string + } + /** + * Row is the result of calling [DB.QueryRow] to select a single row. + */ + interface Row { + } + interface Row { + /** + * Scan copies the columns from the matched row into the values + * pointed at by dest. See the documentation on [Rows.Scan] for details. + * If more than one row matches the query, + * Scan uses the first row and discards the rest. If no row matches + * the query, Scan returns [ErrNoRows]. + */ + scan(...dest: any[]): void + } + interface Row { + /** + * Err provides a way for wrapping packages to check for + * query errors without calling [Row.Scan]. + * Err returns the error, if any, that was encountered while running the query. + * If this error is not nil, this error will also be returned from [Row.Scan]. + */ + err(): void + } +} + +/** + * Package net provides a portable interface for network I/O, including + * TCP/IP, UDP, domain name resolution, and Unix domain sockets. + * + * Although the package provides access to low-level networking + * primitives, most clients will need only the basic interface provided + * by the [Dial], [Listen], and Accept functions and the associated + * [Conn] and [Listener] interfaces. The crypto/tls package uses + * the same interfaces and similar Dial and Listen functions. + * + * The Dial function connects to a server: + * + * ``` + * conn, err := net.Dial("tcp", "golang.org:80") + * if err != nil { + * // handle error + * } + * fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n") + * status, err := bufio.NewReader(conn).ReadString('\n') + * // ... + * ``` + * + * The Listen function creates servers: + * + * ``` + * ln, err := net.Listen("tcp", ":8080") + * if err != nil { + * // handle error + * } + * for { + * conn, err := ln.Accept() + * if err != nil { + * // handle error + * } + * go handleConnection(conn) + * } + * ``` + * + * # Name Resolution + * + * The method for resolving domain names, whether indirectly with functions like Dial + * or directly with functions like [LookupHost] and [LookupAddr], varies by operating system. + * + * On Unix systems, the resolver has two options for resolving names. + * It can use a pure Go resolver that sends DNS requests directly to the servers + * listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C + * library routines such as getaddrinfo and getnameinfo. + * + * On Unix the pure Go resolver is preferred over the cgo resolver, because a blocked DNS + * request consumes only a goroutine, while a blocked C call consumes an operating system thread. + * When cgo is available, the cgo-based resolver is used instead under a variety of + * conditions: on systems that do not let programs make direct DNS requests (OS X), + * when the LOCALDOMAIN environment variable is present (even if empty), + * when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, + * when the ASR_CONFIG environment variable is non-empty (OpenBSD only), + * when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the + * Go resolver does not implement. + * + * On all systems (except Plan 9), when the cgo resolver is being used + * this package applies a concurrent cgo lookup limit to prevent the system + * from running out of system threads. Currently, it is limited to 500 concurrent lookups. + * + * The resolver decision can be overridden by setting the netdns value of the + * GODEBUG environment variable (see package runtime) to go or cgo, as in: + * + * ``` + * export GODEBUG=netdns=go # force pure Go resolver + * export GODEBUG=netdns=cgo # force native resolver (cgo, win32) + * ``` + * + * The decision can also be forced while building the Go source tree + * by setting the netgo or netcgo build tag. + * + * A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver + * to print debugging information about its decisions. + * To force a particular resolver while also printing debugging information, + * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. + * + * The Go resolver will send an EDNS0 additional header with a DNS request, + * to signal a willingness to accept a larger DNS packet size. + * This can reportedly cause sporadic failures with the DNS server run + * by some modems and routers. Setting GODEBUG=netedns0=0 will disable + * sending the additional header. + * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * + * On Plan 9, the resolver always accesses /net/cs and /net/dns. + * + * On Windows, in Go 1.18.x and earlier, the resolver always used C + * library functions, such as GetAddrInfo and DnsQuery. + */ +namespace net { + /** + * Addr represents a network end point address. + * + * The two methods [Addr.Network] and [Addr.String] conventionally return strings + * that can be passed as the arguments to [Dial], but the exact form + * and meaning of the strings is up to the implementation. + */ + interface Addr { + [key:string]: any; + network(): string // name of the network (for example, "tcp", "udp") + string(): string // string form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80") + } + /** + * A Listener is a generic network listener for stream-oriented protocols. + * + * Multiple goroutines may invoke methods on a Listener simultaneously. + */ + interface Listener { + [key:string]: any; + /** + * Accept waits for and returns the next connection to the listener. + */ + accept(): Conn + /** + * Close closes the listener. + * Any blocked Accept operations will be unblocked and return errors. + */ + close(): void + /** + * Addr returns the listener's network address. + */ + addr(): Addr + } +} + /** * Package textproto implements generic support for text-based request/response * protocols in the style of HTTP, NNTP, and SMTP. @@ -22162,106 +22392,208 @@ namespace http { } } -/** - * Package oauth2 provides support for making - * OAuth2 authorized and authenticated HTTP requests, - * as specified in RFC 6749. - * It can additionally grant authorization with Bearer JWT. - */ -/** - * Copyright 2023 The Go Authors. All rights reserved. - * Use of this source code is governed by a BSD-style - * license that can be found in the LICENSE file. - */ -namespace oauth2 { +namespace store { +} + +namespace hook { /** - * An AuthCodeOption is passed to Config.AuthCodeURL. + * wrapped local Hook embedded struct to limit the public API surface. */ - interface AuthCodeOption { - [key:string]: any; + type _subGpDsn = Hook + interface mainHook extends _subGpDsn { + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { +} + +namespace search { +} + +namespace router { + // @ts-ignore + import validation = ozzo_validation + /** + * RouterGroup represents a collection of routes and other sub groups + * that share common pattern prefix and middlewares. + */ + interface RouterGroup { + prefix: string + middlewares: Array<(hook.Handler | undefined)> + } + interface RouterGroup { + /** + * Group creates and register a new child Group into the current one + * with the specified prefix. + * + * The prefix follows the standard Go net/http ServeMux pattern format ("[HOST]/[PATH]") + * and will be concatenated recursively into the final route path, meaning that + * only the root level group could have HOST as part of the prefix. + * + * Returns the newly created group to allow chaining and registering + * sub-routes and group specific middlewares. + */ + group(prefix: string): (RouterGroup) + } + interface RouterGroup { + /** + * BindFunc registers one or multiple middleware functions to the current group. + * + * The registered middleware functions are "anonymous" and with default priority, + * aka. executes in the order they were registered. + * + * If you need to specify a named middleware (ex. so that it can be removed) + * or middleware with custom exec prirority, use [RouterGroup.Bind] method. + */ + bindFunc(...middlewareFuncs: ((e: T) => void)[]): (RouterGroup) + } + interface RouterGroup { + /** + * Bind registers one or multiple middleware handlers to the current group. + */ + bind(...middlewares: (hook.Handler | undefined)[]): (RouterGroup) + } + interface RouterGroup { + /** + * Unbind removes one or more middlewares with the specified id(s) + * from the current group and its children (if any). + * + * Anonymous middlewares are not removable, aka. this method does nothing + * if the middleware id is an empty string. + */ + unbind(...middlewareIds: string[]): (RouterGroup) + } + interface RouterGroup { + /** + * Route registers a single route into the current group. + * + * Note that the final route path will be the concatenation of all parent groups prefixes + the route path. + * The path follows the standard Go net/http ServeMux format ("[HOST]/[PATH]"), + * meaning that only a top level group route could have HOST as part of the prefix. + * + * Returns the newly created route to allow attaching route-only middlewares. + */ + route(method: string, path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * Any is a shorthand for [RouterGroup.AddRoute] with "" as route method (aka. matches any method). + */ + any(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * GET is a shorthand for [RouterGroup.AddRoute] with GET as route method. + */ + get(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * SEARCH is a shorthand for [RouterGroup.AddRoute] with SEARCH as route method. + */ + search(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * POST is a shorthand for [RouterGroup.AddRoute] with POST as route method. + */ + post(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * DELETE is a shorthand for [RouterGroup.AddRoute] with DELETE as route method. + */ + delete(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * PATCH is a shorthand for [RouterGroup.AddRoute] with PATCH as route method. + */ + patch(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * PUT is a shorthand for [RouterGroup.AddRoute] with PUT as route method. + */ + put(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * HEAD is a shorthand for [RouterGroup.AddRoute] with HEAD as route method. + */ + head(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * OPTIONS is a shorthand for [RouterGroup.AddRoute] with OPTIONS as route method. + */ + options(path: string, action: (e: T) => void): (Route) + } + interface RouterGroup { + /** + * HasRoute checks whether the specified route pattern (method + path) + * is registered in the current group or its children. + * + * This could be useful to conditionally register and checks for routes + * in order prevent panic on duplicated routes. + * + * Note that routes with anonymous and named wildcard placeholder are treated as equal, + * aka. "GET /abc/" is considered the same as "GET /abc/{something...}". + */ + hasRoute(method: string, path: string): boolean + } +} + +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { + interface PositionalArgs {(cmd: Command, args: Array): void } + // @ts-ignore + import flag = pflag + /** + * FParseErrWhitelist configures Flag parse errors to be ignored + */ + interface FParseErrWhitelist extends _TygojaAny{} + /** + * Group Structure to manage groups for commands + */ + interface Group { + id: string + title: string } /** - * Token represents the credentials used to authorize - * the requests to access protected resources on the OAuth 2.0 - * provider's backend. - * - * Most users of this package should not access fields of Token - * directly. They're exported mostly for use by related packages - * implementing derivative OAuth2 flows. + * ShellCompDirective is a bit map representing the different behaviors the shell + * can be instructed to have once completions have been provided. */ - interface Token { + interface ShellCompDirective extends Number{} + /** + * CompletionOptions are the options to control shell completion + */ + interface CompletionOptions { /** - * AccessToken is the token that authorizes and authenticates - * the requests. + * DisableDefaultCmd prevents Cobra from creating a default 'completion' command */ - accessToken: string + disableDefaultCmd: boolean /** - * TokenType is the type of token. - * The Type method returns either this or "Bearer", the default. + * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag + * for shells that support completion descriptions */ - tokenType: string + disableNoDescFlag: boolean /** - * RefreshToken is a token that's used by the application - * (as opposed to the user) to refresh the access token - * if it expires. + * DisableDescriptions turns off all completion descriptions for shells + * that support them */ - refreshToken: string + disableDescriptions: boolean /** - * Expiry is the optional expiration time of the access token. - * - * If zero, TokenSource implementations will reuse the same - * token forever and RefreshToken or equivalent - * mechanisms for that TokenSource will not be used. + * HiddenDefaultCmd makes the default 'completion' command hidden */ - expiry: time.Time - /** - * ExpiresIn is the OAuth2 wire format "expires_in" field, - * which specifies how many seconds later the token expires, - * relative to an unknown time base approximately around "now". - * It is the application's responsibility to populate - * `Expiry` from `ExpiresIn` when required. - */ - expiresIn: number - } - interface Token { - /** - * Type returns t.TokenType if non-empty, else "Bearer". - */ - type(): string - } - interface Token { - /** - * SetAuthHeader sets the Authorization header to r using the access - * token in t. - * - * This method is unnecessary when using Transport or an HTTP Client - * returned by this package. - */ - setAuthHeader(r: http.Request): void - } - interface Token { - /** - * WithExtra returns a new Token that's a clone of t, but using the - * provided raw extra map. This is only intended for use by packages - * implementing derivative OAuth2 flows. - */ - withExtra(extra: { - }): (Token) - } - interface Token { - /** - * Extra returns an extra field. - * Extra fields are key-value pairs returned by the server as a - * part of the token retrieval response. - */ - extra(key: string): { - } - } - interface Token { - /** - * Valid reports whether t is non-nil, has an AccessToken, and is not expired. - */ - valid(): boolean + hiddenDefaultCmd: boolean } } @@ -22804,697 +23136,109 @@ namespace slog { import loginternal = internal } -namespace store { -} - -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { - /** - * IsolationLevel is the transaction isolation level used in [TxOptions]. - */ - interface IsolationLevel extends Number{} - interface IsolationLevel { - /** - * String returns the name of the transaction isolation level. - */ - string(): string - } - /** - * DBStats contains database statistics. - */ - interface DBStats { - maxOpenConnections: number // Maximum number of open connections to the database. - /** - * Pool Status - */ - openConnections: number // The number of established connections both in use and idle. - inUse: number // The number of connections currently in use. - idle: number // The number of idle connections. - /** - * Counters - */ - waitCount: number // The total number of connections waited for. - waitDuration: time.Duration // The total time blocked waiting for a new connection. - maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. - maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. - maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. - } - /** - * Conn represents a single database connection rather than a pool of database - * connections. Prefer running queries from [DB] unless there is a specific - * need for a continuous single database connection. - * - * A Conn must call [Conn.Close] to return the connection to the database pool - * and may do so concurrently with a running query. - * - * After a call to [Conn.Close], all operations on the - * connection fail with [ErrConnDone]. - */ - interface Conn { - } - interface Conn { - /** - * PingContext verifies the connection to the database is still alive. - */ - pingContext(ctx: context.Context): void - } - interface Conn { - /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface Conn { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows) - } - interface Conn { - /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * the [*Row.Scan] method is called. - * If the query selects no rows, the [*Row.Scan] will return [ErrNoRows]. - * Otherwise, the [*Row.Scan] scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row) - } - interface Conn { - /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's [*Stmt.Close] method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - */ - prepareContext(ctx: context.Context, query: string): (Stmt) - } - interface Conn { - /** - * Raw executes f exposing the underlying driver connection for the - * duration of f. The driverConn must not be used outside of f. - * - * Once f returns and err is not [driver.ErrBadConn], the [Conn] will continue to be usable - * until [Conn.Close] is called. - */ - raw(f: (driverConn: any) => void): void - } - interface Conn { - /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. [Tx.Commit] will return an error if the context provided to - * BeginTx is canceled. - * - * The provided [TxOptions] is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. - */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx) - } - interface Conn { - /** - * Close returns the connection to the connection pool. - * All operations after a Close will return with [ErrConnDone]. - * Close is safe to call concurrently with other operations and will - * block until all other operations finish. It may be useful to first - * cancel any used context and then call close directly after. - */ - close(): void - } - /** - * ColumnType contains the name and type of a column. - */ - interface ColumnType { - } - interface ColumnType { - /** - * Name returns the name or alias of the column. - */ - name(): string - } - interface ColumnType { - /** - * Length returns the column type length for variable length column types such - * as text and binary field types. If the type length is unbounded the value will - * be [math.MaxInt64] (any database limits will still apply). - * If the column type is not variable length, such as an int, or if not supported - * by the driver ok is false. - */ - length(): [number, boolean] - } - interface ColumnType { - /** - * DecimalSize returns the scale and precision of a decimal type. - * If not applicable or if not supported ok is false. - */ - decimalSize(): [number, number, boolean] - } - interface ColumnType { - /** - * ScanType returns a Go type suitable for scanning into using [Rows.Scan]. - * If a driver does not support this property ScanType will return - * the type of an empty interface. - */ - scanType(): any - } - interface ColumnType { - /** - * Nullable reports whether the column may be null. - * If a driver does not support this property ok will be false. - */ - nullable(): [boolean, boolean] - } - interface ColumnType { - /** - * DatabaseTypeName returns the database system name of the column type. If an empty - * string is returned, then the driver type name is not supported. - * Consult your driver documentation for a list of driver data types. [ColumnType.Length] specifiers - * are not included. - * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - * "INT", and "BIGINT". - */ - databaseTypeName(): string - } - /** - * Row is the result of calling [DB.QueryRow] to select a single row. - */ - interface Row { - } - interface Row { - /** - * Scan copies the columns from the matched row into the values - * pointed at by dest. See the documentation on [Rows.Scan] for details. - * If more than one row matches the query, - * Scan uses the first row and discards the rest. If no row matches - * the query, Scan returns [ErrNoRows]. - */ - scan(...dest: any[]): void - } - interface Row { - /** - * Err provides a way for wrapping packages to check for - * query errors without calling [Row.Scan]. - * Err returns the error, if any, that was encountered while running the query. - * If this error is not nil, this error will also be returned from [Row.Scan]. - */ - err(): void - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { -} - -namespace search { -} - -namespace hook { - /** - * wrapped local Hook embedded struct to limit the public API surface. - */ - type _subTEOLa = Hook - interface mainHook extends _subTEOLa { - } -} - -/** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. - */ -namespace cobra { - interface PositionalArgs {(cmd: Command, args: Array): void } - // @ts-ignore - import flag = pflag - /** - * FParseErrWhitelist configures Flag parse errors to be ignored - */ - interface FParseErrWhitelist extends _TygojaAny{} - /** - * Group Structure to manage groups for commands - */ - interface Group { - id: string - title: string - } - /** - * ShellCompDirective is a bit map representing the different behaviors the shell - * can be instructed to have once completions have been provided. - */ - interface ShellCompDirective extends Number{} - /** - * CompletionOptions are the options to control shell completion - */ - interface CompletionOptions { - /** - * DisableDefaultCmd prevents Cobra from creating a default 'completion' command - */ - disableDefaultCmd: boolean - /** - * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag - * for shells that support completion descriptions - */ - disableNoDescFlag: boolean - /** - * DisableDescriptions turns off all completion descriptions for shells - * that support them - */ - disableDescriptions: boolean - /** - * HiddenDefaultCmd makes the default 'completion' command hidden - */ - hiddenDefaultCmd: boolean - } -} - -namespace router { - // @ts-ignore - import validation = ozzo_validation - /** - * RouterGroup represents a collection of routes and other sub groups - * that share common pattern prefix and middlewares. - */ - interface RouterGroup { - prefix: string - middlewares: Array<(hook.Handler | undefined)> - } - interface RouterGroup { - /** - * Group creates and register a new child Group into the current one - * with the specified prefix. - * - * The prefix follows the standard Go net/http ServeMux pattern format ("[HOST]/[PATH]") - * and will be concatenated recursively into the final route path, meaning that - * only the root level group could have HOST as part of the prefix. - * - * Returns the newly created group to allow chaining and registering - * sub-routes and group specific middlewares. - */ - group(prefix: string): (RouterGroup) - } - interface RouterGroup { - /** - * BindFunc registers one or multiple middleware functions to the current group. - * - * The registered middleware functions are "anonymous" and with default priority, - * aka. executes in the order they were registered. - * - * If you need to specify a named middleware (ex. so that it can be removed) - * or middleware with custom exec prirority, use [RouterGroup.Bind] method. - */ - bindFunc(...middlewareFuncs: ((e: T) => void)[]): (RouterGroup) - } - interface RouterGroup { - /** - * Bind registers one or multiple middleware handlers to the current group. - */ - bind(...middlewares: (hook.Handler | undefined)[]): (RouterGroup) - } - interface RouterGroup { - /** - * Unbind removes one or more middlewares with the specified id(s) - * from the current group and its children (if any). - * - * Anonymous middlewares are not removable, aka. this method does nothing - * if the middleware id is an empty string. - */ - unbind(...middlewareIds: string[]): (RouterGroup) - } - interface RouterGroup { - /** - * Route registers a single route into the current group. - * - * Note that the final route path will be the concatenation of all parent groups prefixes + the route path. - * The path follows the standard Go net/http ServeMux format ("[HOST]/[PATH]"), - * meaning that only a top level group route could have HOST as part of the prefix. - * - * Returns the newly created route to allow attaching route-only middlewares. - */ - route(method: string, path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * Any is a shorthand for [RouterGroup.AddRoute] with "" as route method (aka. matches any method). - */ - any(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * GET is a shorthand for [RouterGroup.AddRoute] with GET as route method. - */ - get(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * SEARCH is a shorthand for [RouterGroup.AddRoute] with SEARCH as route method. - */ - search(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * POST is a shorthand for [RouterGroup.AddRoute] with POST as route method. - */ - post(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * DELETE is a shorthand for [RouterGroup.AddRoute] with DELETE as route method. - */ - delete(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * PATCH is a shorthand for [RouterGroup.AddRoute] with PATCH as route method. - */ - patch(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * PUT is a shorthand for [RouterGroup.AddRoute] with PUT as route method. - */ - put(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * HEAD is a shorthand for [RouterGroup.AddRoute] with HEAD as route method. - */ - head(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * OPTIONS is a shorthand for [RouterGroup.AddRoute] with OPTIONS as route method. - */ - options(path: string, action: (e: T) => void): (Route) - } - interface RouterGroup { - /** - * HasRoute checks whether the specified route pattern (method + path) - * is registered in the current group or its children. - * - * This could be useful to conditionally register and checks for routes - * in order prevent panic on duplicated routes. - * - * Note that routes with anonymous and named wildcard placeholder are treated as equal, - * aka. "GET /abc/" is considered the same as "GET /abc/{something...}". - */ - hasRoute(method: string, path: string): boolean - } -} - namespace subscriptions { } /** - * Package url parses URLs and implements query escaping. + * Package oauth2 provides support for making + * OAuth2 authorized and authenticated HTTP requests, + * as specified in RFC 6749. + * It can additionally grant authorization with Bearer JWT. */ -namespace url { - /** - * The Userinfo type is an immutable encapsulation of username and - * password details for a [URL]. An existing Userinfo value is guaranteed - * to have a username set (potentially empty, as allowed by RFC 2396), - * and optionally a password. - */ - interface Userinfo { - } - interface Userinfo { - /** - * Username returns the username. - */ - username(): string - } - interface Userinfo { - /** - * Password returns the password in case it is set, and whether it is set. - */ - password(): [string, boolean] - } - interface Userinfo { - /** - * String returns the encoded userinfo information in the standard form - * of "username[:password]". - */ - string(): string - } -} - /** - * Package multipart implements MIME multipart parsing, as defined in RFC - * 2046. - * - * The implementation is sufficient for HTTP (RFC 2388) and the multipart - * bodies generated by popular browsers. - * - * # Limits - * - * To protect against malicious inputs, this package sets limits on the size - * of the MIME data it processes. - * - * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a - * part to 10000 and [Reader.ReadForm] limits the total number of headers in all - * FileHeaders to 10000. - * These limits may be adjusted with the GODEBUG=multipartmaxheaders= - * setting. - * - * Reader.ReadForm further limits the number of parts in a form to 1000. - * This limit may be adjusted with the GODEBUG=multipartmaxparts= - * setting. + * Copyright 2023 The Go Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. */ -namespace multipart { +namespace oauth2 { /** - * A Part represents a single part in a multipart body. + * An AuthCodeOption is passed to Config.AuthCodeURL. */ - interface Part { - /** - * The headers of the body, if any, with the keys canonicalized - * in the same fashion that the Go http.Request headers are. - * For example, "foo-bar" changes case to "Foo-Bar" - */ - header: textproto.MIMEHeader + interface AuthCodeOption { + [key:string]: any; } - interface Part { - /** - * FormName returns the name parameter if p has a Content-Disposition - * of type "form-data". Otherwise it returns the empty string. - */ - formName(): string - } - interface Part { - /** - * FileName returns the filename parameter of the [Part]'s Content-Disposition - * header. If not empty, the filename is passed through filepath.Base (which is - * platform dependent) before being returned. - */ - fileName(): string - } - interface Part { - /** - * Read reads the body of a part, after its headers and before the - * next part (if any) begins. - */ - read(d: string|Array): number - } - interface Part { - close(): void - } -} - -/** - * Package http provides HTTP client and server implementations. - * - * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: - * - * ``` - * resp, err := http.Get("http://example.com/") - * ... - * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) - * ... - * resp, err := http.PostForm("http://example.com/form", - * url.Values{"key": {"Value"}, "id": {"123"}}) - * ``` - * - * The caller must close the response body when finished with it: - * - * ``` - * resp, err := http.Get("http://example.com/") - * if err != nil { - * // handle error - * } - * defer resp.Body.Close() - * body, err := io.ReadAll(resp.Body) - * // ... - * ``` - * - * # Clients and Transports - * - * For control over HTTP client headers, redirect policy, and other - * settings, create a [Client]: - * - * ``` - * client := &http.Client{ - * CheckRedirect: redirectPolicyFunc, - * } - * - * resp, err := client.Get("http://example.com") - * // ... - * - * req, err := http.NewRequest("GET", "http://example.com", nil) - * // ... - * req.Header.Add("If-None-Match", `W/"wyzzy"`) - * resp, err := client.Do(req) - * // ... - * ``` - * - * For control over proxies, TLS configuration, keep-alives, - * compression, and other settings, create a [Transport]: - * - * ``` - * tr := &http.Transport{ - * MaxIdleConns: 10, - * IdleConnTimeout: 30 * time.Second, - * DisableCompression: true, - * } - * client := &http.Client{Transport: tr} - * resp, err := client.Get("https://example.com") - * ``` - * - * Clients and Transports are safe for concurrent use by multiple - * goroutines and for efficiency should only be created once and re-used. - * - * # Servers - * - * ListenAndServe starts an HTTP server with a given address and handler. - * The handler is usually nil, which means to use [DefaultServeMux]. - * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: - * - * ``` - * http.Handle("/foo", fooHandler) - * - * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { - * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) - * }) - * - * log.Fatal(http.ListenAndServe(":8080", nil)) - * ``` - * - * More control over the server's behavior is available by creating a - * custom Server: - * - * ``` - * s := &http.Server{ - * Addr: ":8080", - * Handler: myHandler, - * ReadTimeout: 10 * time.Second, - * WriteTimeout: 10 * time.Second, - * MaxHeaderBytes: 1 << 20, - * } - * log.Fatal(s.ListenAndServe()) - * ``` - * - * # HTTP/2 - * - * Starting with Go 1.6, the http package has transparent support for the - * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 - * can do so by setting [Transport.TLSNextProto] (for clients) or - * [Server.TLSNextProto] (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG settings are - * currently supported: - * - * ``` - * GODEBUG=http2client=0 # disable HTTP/2 client support - * GODEBUG=http2server=0 # disable HTTP/2 server support - * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs - * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps - * ``` - * - * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug - * - * The http package's [Transport] and [Server] both automatically enable - * HTTP/2 support for simple configurations. To enable HTTP/2 for more - * complex configurations, to use lower-level HTTP/2 features, or to use - * a newer version of Go's http2 package, import "golang.org/x/net/http2" - * directly and use its ConfigureTransport and/or ConfigureServer - * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 - * package takes precedence over the net/http package's built-in HTTP/2 - * support. - */ -namespace http { /** - * SameSite allows a server to define a cookie attribute making it impossible for - * the browser to send this cookie along with cross-site requests. The main - * goal is to mitigate the risk of cross-origin information leakage, and provide - * some protection against cross-site request forgery attacks. + * Token represents the credentials used to authorize + * the requests to access protected resources on the OAuth 2.0 + * provider's backend. * - * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. + * Most users of this package should not access fields of Token + * directly. They're exported mostly for use by related packages + * implementing derivative OAuth2 flows. */ - interface SameSite extends Number{} - // @ts-ignore - import mathrand = rand - // @ts-ignore - import urlpkg = url -} - -namespace router { - // @ts-ignore - import validation = ozzo_validation - interface Route { - action: (e: T) => void - method: string - path: string - middlewares: Array<(hook.Handler | undefined)> - } - interface Route { + interface Token { /** - * BindFunc registers one or multiple middleware functions to the current route. - * - * The registered middleware functions are "anonymous" and with default priority, - * aka. executes in the order they were registered. - * - * If you need to specify a named middleware (ex. so that it can be removed) - * or middleware with custom exec prirority, use the [Route.Bind] method. + * AccessToken is the token that authorizes and authenticates + * the requests. */ - bindFunc(...middlewareFuncs: ((e: T) => void)[]): (Route) - } - interface Route { + accessToken: string /** - * Bind registers one or multiple middleware handlers to the current route. + * TokenType is the type of token. + * The Type method returns either this or "Bearer", the default. */ - bind(...middlewares: (hook.Handler | undefined)[]): (Route) - } - interface Route { + tokenType: string /** - * Unbind removes one or more middlewares with the specified id(s) from the current route. - * - * It also adds the removed middleware ids to an exclude list so that they could be skipped from - * the execution chain in case the middleware is registered in a parent group. - * - * Anonymous middlewares are considered non-removable, aka. this method - * does nothing if the middleware id is an empty string. + * RefreshToken is a token that's used by the application + * (as opposed to the user) to refresh the access token + * if it expires. */ - unbind(...middlewareIds: string[]): (Route) + refreshToken: string + /** + * Expiry is the optional expiration time of the access token. + * + * If zero, TokenSource implementations will reuse the same + * token forever and RefreshToken or equivalent + * mechanisms for that TokenSource will not be used. + */ + expiry: time.Time + /** + * ExpiresIn is the OAuth2 wire format "expires_in" field, + * which specifies how many seconds later the token expires, + * relative to an unknown time base approximately around "now". + * It is the application's responsibility to populate + * `Expiry` from `ExpiresIn` when required. + */ + expiresIn: number + } + interface Token { + /** + * Type returns t.TokenType if non-empty, else "Bearer". + */ + type(): string + } + interface Token { + /** + * SetAuthHeader sets the Authorization header to r using the access + * token in t. + * + * This method is unnecessary when using Transport or an HTTP Client + * returned by this package. + */ + setAuthHeader(r: http.Request): void + } + interface Token { + /** + * WithExtra returns a new Token that's a clone of t, but using the + * provided raw extra map. This is only intended for use by packages + * implementing derivative OAuth2 flows. + */ + withExtra(extra: { + }): (Token) + } + interface Token { + /** + * Extra returns an extra field. + * Extra fields are key-value pairs returned by the server as a + * part of the token retrieval response. + */ + extra(key: string): { + } + } + interface Token { + /** + * Valid reports whether t is non-nil, has an AccessToken, and is not expired. + */ + valid(): boolean } } @@ -24043,6 +23787,276 @@ namespace slog { } } +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { + /** + * The Userinfo type is an immutable encapsulation of username and + * password details for a [URL]. An existing Userinfo value is guaranteed + * to have a username set (potentially empty, as allowed by RFC 2396), + * and optionally a password. + */ + interface Userinfo { + } + interface Userinfo { + /** + * Username returns the username. + */ + username(): string + } + interface Userinfo { + /** + * Password returns the password in case it is set, and whether it is set. + */ + password(): [string, boolean] + } + interface Userinfo { + /** + * String returns the encoded userinfo information in the standard form + * of "username[:password]". + */ + string(): string + } +} + +/** + * Package multipart implements MIME multipart parsing, as defined in RFC + * 2046. + * + * The implementation is sufficient for HTTP (RFC 2388) and the multipart + * bodies generated by popular browsers. + * + * # Limits + * + * To protect against malicious inputs, this package sets limits on the size + * of the MIME data it processes. + * + * [Reader.NextPart] and [Reader.NextRawPart] limit the number of headers in a + * part to 10000 and [Reader.ReadForm] limits the total number of headers in all + * FileHeaders to 10000. + * These limits may be adjusted with the GODEBUG=multipartmaxheaders= + * setting. + * + * Reader.ReadForm further limits the number of parts in a form to 1000. + * This limit may be adjusted with the GODEBUG=multipartmaxparts= + * setting. + */ +namespace multipart { + /** + * A Part represents a single part in a multipart body. + */ + interface Part { + /** + * The headers of the body, if any, with the keys canonicalized + * in the same fashion that the Go http.Request headers are. + * For example, "foo-bar" changes case to "Foo-Bar" + */ + header: textproto.MIMEHeader + } + interface Part { + /** + * FormName returns the name parameter if p has a Content-Disposition + * of type "form-data". Otherwise it returns the empty string. + */ + formName(): string + } + interface Part { + /** + * FileName returns the filename parameter of the [Part]'s Content-Disposition + * header. If not empty, the filename is passed through filepath.Base (which is + * platform dependent) before being returned. + */ + fileName(): string + } + interface Part { + /** + * Read reads the body of a part, after its headers and before the + * next part (if any) begins. + */ + read(d: string|Array): number + } + interface Part { + close(): void + } +} + +/** + * Package http provides HTTP client and server implementations. + * + * [Get], [Head], [Post], and [PostForm] make HTTP (or HTTPS) requests: + * + * ``` + * resp, err := http.Get("http://example.com/") + * ... + * resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf) + * ... + * resp, err := http.PostForm("http://example.com/form", + * url.Values{"key": {"Value"}, "id": {"123"}}) + * ``` + * + * The caller must close the response body when finished with it: + * + * ``` + * resp, err := http.Get("http://example.com/") + * if err != nil { + * // handle error + * } + * defer resp.Body.Close() + * body, err := io.ReadAll(resp.Body) + * // ... + * ``` + * + * # Clients and Transports + * + * For control over HTTP client headers, redirect policy, and other + * settings, create a [Client]: + * + * ``` + * client := &http.Client{ + * CheckRedirect: redirectPolicyFunc, + * } + * + * resp, err := client.Get("http://example.com") + * // ... + * + * req, err := http.NewRequest("GET", "http://example.com", nil) + * // ... + * req.Header.Add("If-None-Match", `W/"wyzzy"`) + * resp, err := client.Do(req) + * // ... + * ``` + * + * For control over proxies, TLS configuration, keep-alives, + * compression, and other settings, create a [Transport]: + * + * ``` + * tr := &http.Transport{ + * MaxIdleConns: 10, + * IdleConnTimeout: 30 * time.Second, + * DisableCompression: true, + * } + * client := &http.Client{Transport: tr} + * resp, err := client.Get("https://example.com") + * ``` + * + * Clients and Transports are safe for concurrent use by multiple + * goroutines and for efficiency should only be created once and re-used. + * + * # Servers + * + * ListenAndServe starts an HTTP server with a given address and handler. + * The handler is usually nil, which means to use [DefaultServeMux]. + * [Handle] and [HandleFunc] add handlers to [DefaultServeMux]: + * + * ``` + * http.Handle("/foo", fooHandler) + * + * http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) { + * fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) + * }) + * + * log.Fatal(http.ListenAndServe(":8080", nil)) + * ``` + * + * More control over the server's behavior is available by creating a + * custom Server: + * + * ``` + * s := &http.Server{ + * Addr: ":8080", + * Handler: myHandler, + * ReadTimeout: 10 * time.Second, + * WriteTimeout: 10 * time.Second, + * MaxHeaderBytes: 1 << 20, + * } + * log.Fatal(s.ListenAndServe()) + * ``` + * + * # HTTP/2 + * + * Starting with Go 1.6, the http package has transparent support for the + * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 + * can do so by setting [Transport.TLSNextProto] (for clients) or + * [Server.TLSNextProto] (for servers) to a non-nil, empty + * map. Alternatively, the following GODEBUG settings are + * currently supported: + * + * ``` + * GODEBUG=http2client=0 # disable HTTP/2 client support + * GODEBUG=http2server=0 # disable HTTP/2 server support + * GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs + * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps + * ``` + * + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug + * + * The http package's [Transport] and [Server] both automatically enable + * HTTP/2 support for simple configurations. To enable HTTP/2 for more + * complex configurations, to use lower-level HTTP/2 features, or to use + * a newer version of Go's http2 package, import "golang.org/x/net/http2" + * directly and use its ConfigureTransport and/or ConfigureServer + * functions. Manually configuring HTTP/2 via the golang.org/x/net/http2 + * package takes precedence over the net/http package's built-in HTTP/2 + * support. + */ +namespace http { + /** + * SameSite allows a server to define a cookie attribute making it impossible for + * the browser to send this cookie along with cross-site requests. The main + * goal is to mitigate the risk of cross-origin information leakage, and provide + * some protection against cross-site request forgery attacks. + * + * See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. + */ + interface SameSite extends Number{} + // @ts-ignore + import mathrand = rand + // @ts-ignore + import urlpkg = url +} + +namespace router { + // @ts-ignore + import validation = ozzo_validation + interface Route { + action: (e: T) => void + method: string + path: string + middlewares: Array<(hook.Handler | undefined)> + } + interface Route { + /** + * BindFunc registers one or multiple middleware functions to the current route. + * + * The registered middleware functions are "anonymous" and with default priority, + * aka. executes in the order they were registered. + * + * If you need to specify a named middleware (ex. so that it can be removed) + * or middleware with custom exec prirority, use the [Route.Bind] method. + */ + bindFunc(...middlewareFuncs: ((e: T) => void)[]): (Route) + } + interface Route { + /** + * Bind registers one or multiple middleware handlers to the current route. + */ + bind(...middlewares: (hook.Handler | undefined)[]): (Route) + } + interface Route { + /** + * Unbind removes one or more middlewares with the specified id(s) from the current route. + * + * It also adds the removed middleware ids to an exclude list so that they could be skipped from + * the execution chain in case the middleware is registered in a parent group. + * + * Anonymous middlewares are considered non-removable, aka. this method + * does nothing if the middleware id is an empty string. + */ + unbind(...middlewareIds: string[]): (Route) + } +} + namespace router { // @ts-ignore import validation = ozzo_validation