const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-D-1ZZ6vG.js","./index-CN02J7Id.js","./ListApiDocs-DsAmEbM3.js","./FieldsQueryParam-CjR_BU8D.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-DqEDdnyY.js","./CreateApiDocs-sDJMrVIw.js","./UpdateApiDocs-CikXaXuI.js","./AuthMethodsDocs-CsGe8sKc.js","./AuthWithPasswordDocs-o2pFaAVH.js","./AuthWithOAuth2Docs-BsNjOBUC.js","./AuthWithOtpDocs-CANXjCPh.js","./AuthRefreshDocs-u8ClktFa.js","./CodeEditor-D_vAHbp-.js","./Leaflet-D00ErV4n.js","./Leaflet-DCQr6yJv.css"])))=>i.map(i=>d[i]);
var Xy=Object.defineProperty;var Qy=(n,e,t)=>e in n?Xy(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>Qy(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 so=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function xy(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function s0(n){return n()}function bf(){return Object.create(null)}function Ee(n){n.forEach(s0)}function Lt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function wn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function ev(n){return Object.keys(n).length===0}function ku(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 o0(n){let e;return ku(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(ku(e,t))}function Nt(n,e,t,i){if(n){const l=r0(n,e,t,i);return n[0](l)}}function r0(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function Rt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r This feature is experimental and may change in the future. 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) . 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: You can clear the headers field if PocketBase is not deployed behind a proxy. Please note that during the backup other concurrent write requests may fail since the
database will be temporary "locked" (this usually happens only during the ZIP generation). If you are using S3 storage for the collections file upload, you'll have to backup them
separately since they are not locally stored and will not be included in the final backup! Please proceed with caution and use it only with trusted backups! Backup restore is experimental and works only on UNIX based systems. The restore operation will attempt to replace your existing 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
=3&&(a+="T"),a+=Yf(this,r,t,i,l,s,o),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?la(this,e==="extended",Qo(t)):null}toISOWeekDate(){return Mo(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:l=!1,extendedZone:s=!1,format:o="extended",precision:r="milliseconds"}={}){return this.isValid?(r=Qo(r),(l&&Xo.indexOf(r)>=3?"T":"")+Yf(this,o==="extended",t,e,i,s,r)):null}toRFC2822(){return Mo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mo(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?la(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let l="HH:mm:ss.SSS";return(t||e)&&(i&&(l+=" "),t?l+="z":e&&(l+="ZZ")),Mo(this,l,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ta}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return Tt.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=Jv(t).map(Tt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=X2(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?Qt.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?this '},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function Lc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=Y(e,"click",n[26]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function Ac(n){let e,t=de(n[34]),i=[];for(let l=0;l n,x:n=>n.x,y:n=>n.y};function FS(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 qS(n){const e=FS(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function gr(n,e){return(Vc[e]||(Vc[e]=qS(e)))(n)}function Yu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const br=n=>typeof n<"u",ol=n=>typeof n=="function",Bc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function jS(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const vn=Math.PI,Ci=2*vn,HS=Ci+vn,kr=Number.POSITIVE_INFINITY,zS=vn/180,ci=vn/2,kl=vn/4,Wc=vn*2/3,zk=Math.log10,rl=Math.sign;function Ml(n,e,t){return Math.abs(n-e)t&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Nl(n,e){return Object.assign(Object.create(n),e)}function Xu(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=xk("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Xu([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 Xk(r,a,()=>A4(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return sd(r).includes(a)},ownKeys(r){return sd(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function os(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Gk(n,i),setContext:s=>os(n,s,t,i),override:s=>os(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 Xk(s,o,()=>O4(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 Gk(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:ol(t)?t:()=>t,isIndexable:ol(i)?i:()=>i}}const C4=(n,e)=>n?n+Yu(e):e,Qu=(n,e)=>St(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Xk(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function O4(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return ol(r)&&o.isScriptable(e)&&(r=M4(e,r,n,t)),dn(r)&&r.length&&(r=E4(e,r,n,o.isIndexable)),Qu(e,r)&&(r=os(r,l,s&&s[e],o)),r}function M4(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),Qu(n,a)&&(a=xu(l._scopes,l,n,a)),a}function E4(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(St(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=xu(u,l,n,f);e.push(os(c,s,o&&o[n],r))}}return e}function Qk(n,e,t){return ol(n)?n(e,t):n}const D4=(n,e)=>n===!0?e:typeof n=="string"?gr(e,n):void 0;function I4(n,e,t,i,l){for(const s of e){const o=D4(t,s);if(o){n.add(o);const r=Qk(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 xu(n,e,t,i){const l=e._rootScopes,s=Qk(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=ld(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=ld(r,o,s,a,i),a===null)?!1:Xu(Array.from(r),[""],l,s,()=>L4(e,t,i))}function ld(n,e,t,i,l){for(;t;)t=I4(n,e,t,i,l);return t}function L4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return dn(l)&&St(t)?t:l||{}}function A4(n,e,t,i){let l;for(const s of e)if(l=xk(C4(s,n),t),typeof l<"u")return Qu(n,l)?xu(t,i,n,l):l}function xk(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function sd(n){let e=n._keys;return e||(e=n._keys=P4(n._scopes)),e}function P4(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 N4=Number.EPSILON||1e-14,rs=(n,e)=>e=0&&eS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,id(e,{x:g,y:h,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),id(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=$i(i.bodyFont);let d=c.lineHeight,m=0;const h=pa(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=Uo(this,_,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=l.length;T 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),w(_,t,k),w(_,i,k),y(i,l);for(let S=0;S+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=di(t,0,o),i=di(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||Gd(s.minUnit,t,i,this._getLabelCapacity(t)),r=Et(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Qs(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 ft(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}=Cl(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}=Cl(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 xd extends eo{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=Vo(t,this.min),this._tableRange=Vo(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;o0 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){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),me(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=Y(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&&mt(s.value)!==c[1].logs.maxDays&&me(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function j$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Ry({}),{c(){e=b("label"),t=W("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(),H(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){w(h,e,g),y(e,t),w(h,l,g),w(h,s,g),me(s,n[1].logs.minLevel),w(h,o,g),w(h,r,g),y(r,a),y(r,u),q(f,r,null),c=!0,d||(m=Y(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&mt(s.value)!==h[1].logs.minLevel&&me(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&&(v(e),v(l),v(s),v(o),v(r)),j(f),d=!1,m()}}}function H$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIP,w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(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&&(v(e),v(i),v(l)),r=!1,a()}}}function z$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logAuthId,w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(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&&(v(e),v(i),v(l)),r=!1,a()}}}function U$(n){let e,t,i,l;const s=[F$,R$],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),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&&v(i),o[e].d(a)}}}function V$(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function B$(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],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(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&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function W$(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[B$],header:[V$],default:[U$]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){H(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),j(e,l)}}}function Y$(n,e,t){let i,l;const s=wt(),o="logs_settings_"+U.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(){Jt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await he.settings.getAll()||{};k(P)}catch(P){he.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await he.settings.update(U.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),he.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=mt(this.value),t(1,c)}function $(){c.logs.minLevel=mt(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){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.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 K$ extends ve{constructor(e){super(),ye(this,e,Y$,W$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function J$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,l,f),y(l,s),r||(a=Y(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&&(v(e),v(i),v(l)),r=!1,a()}}}function kp(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 d$({props:s}),ne.push(()=>ge(e,"zoom",l)),{c(){H(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){j(e,o)}}}function yp(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 fS({props:r}),ne.push(()=>ge(e,"filter",s)),ne.push(()=>ge(e,"zoom",o)),e.$on("select",n[17]),{c(){H(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){j(e,a)}}}function Z$(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 Fr({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[J$,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Rr({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 Ry({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=kp(n),R=yp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=W(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),H(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),H(h.$$.fragment),g=C(),H(_.$$.fragment),k=C(),H(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ke(),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){w(z,e,F),y(e,t),y(t,i),y(i,l),y(l,s),y(t,o),y(t,r),y(t,a),q(u,t,null),y(t,f),y(t,c),y(t,d),y(t,m),q(h,m,null),y(e,g),q(_,e,null),y(e,k),q(S,e,null),y(e,$),N.m(e,null),w(z,O,F),R.m(z,F),w(z,L,F),I=!0,A||(P=[Oe(Re.call(null,r,{text:"Logs settings",position:"right"})),Y(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&se(s,z[7]);const B={};F&100663300&&(B.$$scope={dirty:F,ctx:z}),h.$set(B);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&be(T,T=z[4])?(oe(),D(N,1,1,te),re(),N=kp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&be(E,E=z[4])?(oe(),D(R,1,1,te),re(),R=yp(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&&(v(e),v(O),v(L)),j(u),j(h),j(_),j(S),N.d(z),R.d(z),A=!1,Ee(P)}}}function G$(n){let e,t,i,l,s,o;e=new si({props:{$$slots:{default:[Z$]},$$scope:{ctx:n}}});let r={};i=new I$({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new K$({props:a}),n[21](s),s.$on("save",n[8]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(u,f){q(e,u,f),w(u,t,f),q(i,u,f),w(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&&(v(t),v(l)),j(e,u),n[18](null),j(i,u),n[21](null),j(s,u)}}}const Wo="logId",vp="superuserRequests",wp="superuserLogRequests";function X$(n,e,t){var R;let i,l,s;Ge(n,zu,z=>t(22,l=z)),Ge(n,an,z=>t(7,s=z)),En(an,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(vp)||((R=window.localStorage)==null?void 0:R.getItem(wp)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[vp]=d<<0||null,U.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){ne[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var B;let F={};F[Wo]=((B=z.detail)==null?void 0:B.id)||null,U.replaceHashQueryParams(F)},P=()=>{let z={};z[Wo]=null,U.replaceHashQueryParams(z)};function N(z){ne[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Wo)&&r&&r.show(o.get(Wo)),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(wp,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 Q$ extends ve{constructor(e){super(),ye(this,e,X$,G$,be,{})}}function Sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Tp(n){n[18]=n[19].default}function $p(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Cp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function x$(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),l=C(),p(e,"type","button"),p(e,"class","sidebar-item"),x(e,"active",n[5]===n[14])},m(a,u){w(a,e,u),y(e,i),y(e,l),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&se(i,t),u&40&&x(e,"active",n[5]===n[14])},d(a){a&&v(e),s=!1,o()}}}function eC(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=W(t),l=C(),p(e,"class","sidebar-item disabled")},m(r,a){w(r,e,a),y(e,i),y(e,l),s||(o=Oe(Re.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&se(i,t)},d(r){r&&v(e),s=!1,o()}}}function Op(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&Cp();function r(f,c){return f[15].disabled?eC:x$}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ke(),o&&o.c(),l=C(),u.c(),s=ke(),this.first=t},m(f,c){w(f,t,c),o&&o.m(f,c),w(f,l,c),u.m(f,c),w(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=Cp(),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&&(v(t),v(l),v(s)),o&&o.d(f),u.d(f)}}}function Mp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:iC,then:nC,catch:tC,value:19,blocks:[,,,]};return yf(t=n[15].component,l),{c(){e=ke(),l.block.c()},m(s,o){w(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)&&yf(t,l)||mv(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&&v(e),l.block.d(s),l.token=null,l=null}}}function tC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function nC(n){Tp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=C()},m(l,s){q(e,l,s),w(l,t,s),i=!0},p(l,s){Tp(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&&v(t),j(e,l)}}}function iC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Ep(n,e){let t,i,l,s=e[5]===e[14]&&Mp(e);return{key:n,first:null,c(){t=ke(),s&&s.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(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=Mp(e),s.c(),M(s,1),s.m(i.parentNode,i)):s&&(oe(),D(s,1,1,()=>{s=null}),re())},i(o){l||(M(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function lC(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;gemail != ''.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,l,r),w(o,s,r)},p:te,d(o){o&&(v(e),v(t),v(i),v(l),v(s))}}}function HC(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:[qC,({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:[jC]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new sl({props:c}),ne.push(()=>ge(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`id_token
is a direct result of the trusted server code->token exchange response.`,i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){w(u,e,f),y(e,t),y(e,i),q(l,e,null),y(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=qe(e,ht,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=qe(e,ht,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),j(l),j(o),u&&r&&r.end()}}}function x8(n){let e,t,i,l;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[nO,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","content")},m(s,o){w(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=qe(e,ht,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=qe(e,ht,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&v(e),j(t),s&&i&&i.end()}}}function eO(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){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),me(r,n[0].extra.jwksURL),u||(f=[Oe(Re.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),Y(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&&me(r,c[0].extra.jwksURL)},d(c){c&&(v(e),v(o),v(r)),u=!1,Ee(f)}}}function tO(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 _o({props:m}),ne.push(()=>ge(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){w(h,e,g),y(e,t),y(e,i),y(e,l),w(h,o,g),q(r,h,g),u=!0,f||(c=Oe(Re.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&&(v(e),v(o)),j(r,h),f=!1,c()}}}function nO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("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){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),me(s,n[0].userInfoURL),r||(a=Y(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&&me(s,u[0].userInfoURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function iO(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){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[Y(e,"change",n[11]),Oe(Re.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&&(v(e),v(i),v(l)),u=!1,Ee(f)}}}function lO(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:[J8,({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:[Z8,({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:[G8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[X8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[x8,Q8],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:[iO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),H(s.$$.fragment),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),H(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),w(T,t,O),w(T,i,O),w(T,l,O),q(s,T,O),w(T,o,O),q(r,T,O),w(T,a,O),q(u,T,O),w(T,f,O),w(T,c,O),S[d].m(c,null),w(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):(oe(),D(S[P],1,1,()=>{S[P]=null}),re(),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&&(v(t),v(i),v(l),v(o),v(a),v(f),v(c),v(h)),j(e,T),j(s,T),j(r,T),j(u,T),S[d].d(),j(g,T)}}}function sO(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;U.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 Ta extends ve{constructor(e){super(),ye(this,e,sO,lO,be,{key:1,config:0})}}function oO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("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){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),me(s,n[0].authURL),r||(a=Y(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&&me(s,u[0].authURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function rO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("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){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),me(s,n[0].tokenURL),r||(a=Y(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&&me(s,u[0].tokenURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function aO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("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){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),me(s,n[0].userInfoURL),r||(a=Y(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&&me(s,u[0].userInfoURL)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function uO(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:[oO,({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:[rO,({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:[aO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),y(e,t),w(f,i,c),q(l,f,c),w(f,s,c),q(o,f,c),w(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(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&&(v(e),v(i),v(s),v(r)),j(l,f),j(o,f),j(a,f)}}}function fO(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 $a extends ve{constructor(e){super(),ye(this,e,fO,uO,be,{key:1,config:0,required:4,title:2})}}const af=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:D8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:W8},{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:$a,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:$a,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"X/Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"lark",title:"Lark",logo:"lark.svg",optionsComponent:H8},{key:"box",title:"Box",logo:"box.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"trakt",title:"Trakt",logo:"trakt.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:$a,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta}];function _m(n,e,t){const i=n.slice();return i[16]=e[t],i}function gm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=Y(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function cO(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&gm(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ke(),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){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),me(s,n[1]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(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]&&me(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=gm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(oe(),D(c,1,1,()=>{c=null}),re())},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function bm(n){let e,t,i,l,s=n[1]!=""&&km(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){w(o,e,r),y(e,t),y(e,i),s&&s.m(e,null),y(e,l)},p(o,r){o[1]!=""?s?s.p(o,r):(s=km(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&v(e),s&&s.d()}}}function km(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){w(l,e,s),t||(i=Y(e,"click",n[5]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function ym(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&8&&!wn(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&&v(e)}}}function vm(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&&ym(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=W(a),f=C(),c=b("em"),m=W(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){w($,t,T),y(t,i),y(i,l),k&&k.m(l,null),y(i,s),y(i,o),y(o,r),y(r,u),y(o,f),y(o,c),y(c,m),y(t,h),g||(_=Y(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=ym(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&se(u,a),T&8&&d!==(d=e[16].key+"")&&se(m,d)},d($){$&&v(t),k&&k.d(),g=!1,_()}}}function dO(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[cO,({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;ftrue",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=W(L),A=W(" 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)",B=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",V=W(`
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(pe,ae){w(pe,e,ae),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(m,h),y(m,g),y(m,_),y(m,k),y(m,S),y(m,$),y(m,T),y(m,O),y(m,E),y(E,I),y(E,A),y(E,P),y(m,N),y(m,R),y(m,z),y(m,F),y(m,B),y(m,J),y(i,V),y(i,Z),ce=!0},i(pe){ce||(pe&&tt(()=>{ce&&(G||(G=qe(e,ht,{duration:150},!0)),G.run(1))}),ce=!0)},o(pe){pe&&(G||(G=qe(e,ht,{duration:150},!1)),G.run(0)),ce=!1},d(pe){pe&&v(e),pe&&G&&G.end()}}}function JE(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:[WE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,k){return _[2]?KE:YE}let m=d(n),h=m(n),g=n[2]&&hh();return{c(){H(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=ke(),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),w(_,t,k),w(_,i,k),y(i,l),y(i,s),h.m(i,null),w(_,r,k),g&&g.m(_,k),w(_,a,k),u=!0,f||(c=Y(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=hh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(v(t),v(i),v(r),v(a)),j(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function ZE(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[JE]},$$scope:{ctx:n}};for(let r=0;r*) are not supported.id column.
If your query doesn't have a suitable one, you can use the universal
(ROW_NUMBER() OVER()) as id.MAX(balance) as maxBalance.(MAX(balance) + 1) as maxBalance.@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){w(N,e,R),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let z=0;zverified = 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){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),w(a,o,u),w(a,r,u)},p:te,d(a){a&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r))}}}function pI(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){w(l,e,s),w(l,t,s),w(l,i,s)},p:te,d(l){l&&(v(e),v(t),v(i))}}}function mI(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]&&Mh(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 sl({props:L}),ne.push(()=>ge(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 sl({props:A}),ne.push(()=>ge(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&Ih(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&Ph(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=W(o),a=C(),O&&O.c(),u=C(),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),P&&P.c(),_=C(),N&&N.c(),k=ke(),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,B){w(F,e,B),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),O&&O.m(e,null),w(F,u,B),q(f,F,B),w(F,d,B),q(m,F,B),w(F,g,B),P&&P.m(F,B),w(F,_,B),N&&N.m(F,B),w(F,k,B),S=!0,$||(T=Y(s,"click",n[5]),$=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&se(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=Mh(F),O.c(),M(O,1),O.m(e,null)):O&&(oe(),D(O,1,1,()=>{O=null}),re());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,$e(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!h&&B&1&&(h=!0,V.rule=F[0].viewRule,$e(()=>h=!1)),m.$set(V),((Z=F[0])==null?void 0:Z.type)!=="view"?P?(P.p(F,B),B&1&&M(P,1)):(P=Ih(F),P.c(),M(P,1),P.m(_.parentNode,_)):P&&(oe(),D(P,1,1,()=>{P=null}),re()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,B),B&1&&M(N,1)):(N=Ph(F),N.c(),M(N,1),N.m(k.parentNode,k)):N&&(oe(),D(N,1,1,()=>{N=null}),re())},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&&(v(e),v(u),v(d),v(g),v(_),v(k)),O&&O.d(),j(f,F),j(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function hI(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=U.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 _I extends ve{constructor(e){super(),ye(this,e,hI,mI,be,{collection:0})}}function Rh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Fh(n,e,t){const i=n.slice();return i[30]=e[t],i}function qh(n,e,t){const i=n.slice();return i[33]=e[t],i}function jh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[33]=e[t],i}function zh(n){let e,t,i,l,s,o,r=n[9].length&&Uh();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){w(a,e,u),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),r&&r.m(l,null)},p(a,u){a[9].length?r||(r=Uh(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&v(e),r&&r.d()}}}function Uh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Vh(n){let e,t,i,l,s,o,r=n[5]&&Bh(n),a=!n[4]&&Wh(n),u=de(n[3]),f=[];for(let m=0;m'},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function yN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=Y(e,"click",n[38]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function vN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=Y(e,"click",n[37]),t=!0)},p:te,d(l){l&&v(e),t=!1,i()}}}function w1(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){w(d,e,m),y(e,t),y(t,i),y(t,o),y(t,r),u||(f=[Y(i,"change",c),Y(t,"click",tn(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&&v(e),u=!1,Ee(f)}}}function S1(n,e){let t,i,l,s;return i=new By({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",l="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){w(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&&v(t),j(i)}}}function T1(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&w1(e),d=de(e[15]);const m=_=>_[61].id;for(let _=0;_ Loading collections...
',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function jN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[LN,IN,DN],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 ff({props:g}),n[32](l),l.$on("truncate",n[33]);let _={};o=new aC({props:_}),n[34](o);let k={collection:n[2]};a=new pf({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 tA({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),H(l.$$.fragment),s=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),H(f.$$.fragment)},m($,T){m[e].m($,T),w($,i,T),q(l,$,T),w($,s,T),q(o,$,T),w($,r,T),q(a,$,T),w($,u,T),q(f,$,T),c=!0},p($,T){let O=e;e=h($),e===O?m[e].p($,T):(oe(),D(m[O],1,1,()=>{m[O]=null}),re(),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($){$&&(v(i),v(s),v(r),v(u)),m[e].d($),n[32](null),j(l,$),n[34](null),j(o,$),n[35](null),j(a,$),n[39](null),j(f,$)}}}function HN(n,e,t){let i,l,s,o,r,a,u,f;Ge(n,ii,De=>t(2,s=De)),Ge(n,an,De=>t(41,o=De)),Ge(n,Zs,De=>t(3,r=De)),Ge(n,zu,De=>t(17,a=De)),Ge(n,In,De=>t(11,u=De)),Ge(n,Il,De=>t(12,f=De));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;ju(T);async function E(De){await _n(),(s==null?void 0:s.type)==="view"?g.show(De):h==null||h.show(De)}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 De=U.getAllCollectionIdentifiers(s),ot=$.split(",").map(Ie=>Ie.startsWith("+")||Ie.startsWith("-")?Ie.substring(1):Ie);ot.filter(Ie=>De.includes(Ie)).length!=ot.length&&((s==null?void 0:s.type)!="view"?t(1,$="-@rowid"):De.includes("created")?t(1,$="-created"):t(1,$=""))}function A(De={}){const ot=Object.assign({collection:(s==null?void 0:s.id)||"",filter:S,sort:$},De);U.replaceHashQueryParams(ot)}const P=()=>d==null?void 0:d.show();function N(De){ne[De?"unshift":"push"](()=>{k=De,t(9,k)})}function R(De){O=De,t(10,O)}const z=()=>d==null?void 0:d.show(s),F=()=>{_==null||_.load(),k==null||k.reload()},B=()=>m==null?void 0:m.show(s),J=()=>h==null?void 0:h.show(),V=De=>t(0,S=De.detail);function Z(De){ne[De?"unshift":"push"](()=>{_=De,t(8,_)})}function G(De){S=De,t(0,S)}function ce(De){$=De,t(1,$)}const pe=De=>{A({recordId:De.detail.id});let ot=De.detail._partial?De.detail.id:De.detail;s.type==="view"?g==null||g.show(ot):h==null||h.show(ot)},ae=()=>{k==null||k.reload()},Ce=()=>h==null?void 0:h.show();function Ye(De){ne[De?"unshift":"push"](()=>{d=De,t(4,d)})}const Ke=()=>{_==null||_.load(),k==null||k.reload()};function ct(De){ne[De?"unshift":"push"](()=>{m=De,t(5,m)})}function et(De){ne[De?"unshift":"push"](()=>{h=De,t(6,h)})}const xe=()=>{A({recordId:null})},Be=De=>{S?k==null||k.reload():De.detail.isNew&&t(10,O++,O),_==null||_.reloadLoadedPages()},ut=De=>{(!S||_!=null&&_.hasRecord(De.detail.id))&&t(10,O--,O),_==null||_.reloadLoadedPages()};function Bt(De){ne[De?"unshift":"push"](()=>{g=De,t(7,g)})}const Ue=()=>{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)&&c3(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&&En(an,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,B,J,V,Z,G,ce,pe,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue]}class zN extends ve{constructor(e){super(),ye(this,e,HN,jN,be,{},null,[-1,-1])}}function L1(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){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),o||(r=[Oe(Si.call(null,i,{path:"/settings/export-collections/?.*"})),Oe(Fn.call(null,i)),Oe(Si.call(null,s,{path:"/settings/import-collections/?.*"})),Oe(Fn.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,Ee(r)}}}function UN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_=!n[0]&&L1();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(),d=b("a"),d.innerHTML=' Crons',m=C(),_&&_.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(d,"href","/settings/crons"),p(d,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(k,S){w(k,e,S),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),y(e,r),y(e,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),_&&_.m(e,null),h||(g=[Oe(Si.call(null,l,{path:"/settings"})),Oe(Fn.call(null,l)),Oe(Si.call(null,o,{path:"/settings/mail/?.*"})),Oe(Fn.call(null,o)),Oe(Si.call(null,a,{path:"/settings/storage/?.*"})),Oe(Fn.call(null,a)),Oe(Si.call(null,f,{path:"/settings/backups/?.*"})),Oe(Fn.call(null,f)),Oe(Si.call(null,d,{path:"/settings/crons/?.*"})),Oe(Fn.call(null,d))],h=!0)},p(k,S){k[0]?_&&(_.d(1),_=null):_||(_=L1(),_.c(),_.m(e,null))},d(k){k&&v(e),_&&_.d(),h=!1,Ee(g)}}}function VN(n){let e,t;return e=new zy({props:{class:"settings-sidebar",$$slots:{default:[UN]},$$scope:{ctx:n}}}),{c(){H(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){j(e,i)}}}function BN(n,e,t){let i;return Ge(n,Il,l=>t(0,i=l)),[i]}class Fl extends ve{constructor(e){super(),ye(this,e,BN,VN,be,{})}}function WN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=C(),l=b("label"),s=W("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){w(f,e,c),e.checked=n[0].batch.enabled,w(f,i,c),w(f,l,c),y(l,s),y(l,o),a||(u=Y(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&&(v(e),v(i),v(l)),a=!1,u()}}}function YN(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Max requests in a batch",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[8]),p(r,"type","number"),p(r,"id",a=n[8]),p(r,"min","0"),p(r,"step","1"),r.required=n[1]},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),me(r,n[0].batch.maxRequests),u||(f=[Oe(Re.call(null,l,{text:"Rate limiting (if enabled) also applies for the batch create/update/upsert/delete requests.",position:"right"})),Y(r,"input",n[5])],u=!0)},p(c,d){d&256&&s!==(s=c[8])&&p(e,"for",s),d&256&&a!==(a=c[8])&&p(r,"id",a),d&2&&(r.required=c[1]),d&1&&mt(r.value)!==c[0].batch.maxRequests&&me(r,c[0].batch.maxRequests)},d(c){c&&(v(e),v(o),v(r)),u=!1,Ee(f)}}}function KN(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){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),me(s,n[0].batch.timeout),r||(a=Y(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&&mt(s.value)!==u[0].batch.timeout&&me(s,u[0].batch.timeout)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function JN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("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){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),a||(u=Y(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&&(v(e),v(l),v(s)),a=!1,u()}}}function ZN(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:[WN,({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:[YN,({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:[KN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[JN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),l=b("div"),H(s.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),u=C(),f=b("div"),H(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),w(m,t,h),w(m,i,h),y(i,l),q(s,l,null),y(i,o),y(i,r),q(a,r,null),y(i,u),y(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&&(v(t),v(i)),j(e,m),j(s),j(a),j(c)}}}function GN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function XN(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function A1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function QN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?XN:GN}let a=r(n),u=a(n),f=n[2]&&A1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(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=A1(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function xN(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[QN],default:[ZN]},$$scope:{ctx:n}}}),{c(){H(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){j(e,i)}}}function eR(n,e,t){let i,l,s;Ge(n,Tn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=mt(this.value),t(0,o)}function u(){o.batch.timeout=mt(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=!U.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 tR extends ve{constructor(e){super(),ye(this,e,eR,xN,be,{formSettings:0})}}function P1(n,e,t){const i=n.slice();return i[17]=e[t],i}function N1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&se(i,t)},d(a){a&&(v(e),v(l)),s=!1,o()}}}function nR(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 _o({props:S}),ne.push(()=>ge(s,"value",k));let $=de(n[2]),T=[];for(let O=0;O<$.length;O+=1)T[O]=N1(P1(n,$,O));return{c(){e=b("label"),t=W("Trusted IP proxy headers"),l=C(),H(s.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=W(`Comma separated list of headers such as:
`);for(let O=0;O ',i=C(),l=b("tbody");for(let u=0;uRate limit label Max requests
(per IP)Interval
(in seconds)Targeted users users:create) *:create)POST /a/b)POST /a/b/)/a/b)/a/b/)[METHOD ]/my/path - full exact route match (
must be without trailing slash ; "METHOD" is optional).
For example:
`,m=C(),h=b("li"),h.innerHTML=`/hello - matches GET /hello, POST /hello, etc.POST /hello - matches only POST /hello[METHOD ]/my/prefix/ - path prefix (
must end with trailing slash;
"METHOD" is optional). For example:
`,g=C(),_=b("li"),k=b("code"),k.textContent="collectionName:predefinedTag",S=W(` - targets a specific action of a single collection. To
apply the rule for all collections you can use the `),$=b("code"),$.textContent="*",T=W(` wildcard. For example:
`),O=b("code"),O.textContent="posts:create",E=W(", "),L=b("code"),L.textContent="users:listAuthMethods",I=W(", "),A=b("code"),A.textContent="*:auth",P=W(`.
`),N=b("br"),R=W(`
The predifined collection tags are (`),z=b("em"),z.textContent="there should be autocomplete once you start typing",F=W(`):
`),B=b("ul");for(let Z=0;Z/hello/ - matches GET /hello,
POST /hello/a/b/c, etc.POST /hello/ - matches POST /hello,
POST /hello/a/b/c, etc.pb_data with the one from
the backup and will restart the application process.data.db file).
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){w(T,e,O),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,O),w(T,a,O),y(a,u),y(u,f),y(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[29])),g=!0)},p(T,O){(!h||O[0]&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),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&&(v(e),v(r),v(a)),S[d].d(),g=!1,_()}}}function Iq(n){let e,t,i,l,s,o;e=new Fl({}),i=new si({props:{$$slots:{default:[Dq]},$$scope:{ctx:n}}});let r={};return s=new Fy({props:r}),n[30](s),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),H(s.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(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&&(v(t),v(l)),j(e,a),j(i,a),n[30](null),j(s,a)}}}function Lq(n,e,t){let i,l,s;Ge(n,an,ce=>t(7,s=ce));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];En(an,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 ce=await he.settings.getAll()||{};k(ce)}catch(ce){he.error(ce)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const ce=await he.settings.update(U.filterRedactedProps(f));k(ce),Jt({}),nn("Successfully saved mail settings.")}catch(ce){he.error(ce)}t(3,d=!1)}}function k(ce={}){t(0,f={meta:(ce==null?void 0:ce.meta)||{},smtp:(ce==null?void 0:ce.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=mt(this.value),t(0,f)}function I(){f.smtp.username=this.value,t(0,f)}function A(ce){m=ce,t(4,m)}function P(ce){n.$$.not_equal(f.smtp.password,ce)&&(f.smtp.password=ce,t(0,f))}const N=()=>{t(5,h=!h)};function R(ce){n.$$.not_equal(f.smtp.tls,ce)&&(f.smtp.tls=ce,t(0,f))}function z(ce){n.$$.not_equal(f.smtp.authMethod,ce)&&(f.smtp.authMethod=ce,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const B=()=>S(),J=()=>_(),V=()=>a==null?void 0:a.show(),Z=()=>_();function G(ce){ne[ce?"unshift":"push"](()=>{a=ce,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,B,J,V,Z,G]}class Aq extends ve{constructor(e){super(),ye(this,e,Lq,Iq,be,{},null,[-1,-1])}}function Pq(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:[Rq]},$$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 Yy({props:T}),ne.push(()=>ge(e,"config",k)),ne.push(()=>ge(e,"isTesting",S)),ne.push(()=>ge(e,"testError",$));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&Qb(n),E=n[6]&&xb(n);return{c(){H(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],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),w(I,s,A),w(I,o,A),y(o,r),y(o,a),O&&O.m(o,null),y(o,u),E&&E.m(o,null),y(o,f),y(o,c),y(c,d),h=!0,g||(_=Y(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=Qb(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?E?E.p(I,A):(E=xb(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)&&x(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&&(v(s),v(o)),j(e,I),O&&O.d(),E&&E.d(),g=!1,_()}}}function Nq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function Xb(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=W(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),u=W(a),f=W(` to the `),c=b("strong"),m=W(d),h=W(`. `),g=b("br"),_=W(` There are numerous command line tools that can help you, such as: `),k=b("a"),k.textContent=`rclone `,S=W(`, `),$=b("a"),$.textContent=`s5cmd `,T=W(", 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){w(P,e,N),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(r,u),y(s,f),y(s,c),y(c,m),y(s,h),y(s,g),y(s,_),y(s,k),y(s,S),y(s,$),y(s,T),y(e,O),y(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")&&se(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=qe(e,ht,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=qe(e,ht,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&v(e),P&&L&&L.end()}}}function Rq(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Xb(n);return{c(){t&&t.c(),e=ke()},m(l,s){t&&t.m(l,s),w(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=Xb(l),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(oe(),D(t,1,1,()=>{t=null}),re())},d(l){l&&v(e),t&&t.d(l)}}}function Qb(n){let e;function t(s,o){return s[4]?jq:s[5]?qq:Fq}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function Fq(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){w(t,e,i)},p:te,d(t){t&&v(e)}}}function qq(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;w(s,e,o),i||(l=Oe(t=Re.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Lt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function jq(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function xb(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){w(s,e,o),y(e,t),i||(l=Y(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function Hq(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[Nq,Pq],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=W(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){w(T,e,O),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,O),w(T,a,O),y(a,u),y(u,f),y(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[16])),g=!0)},p(T,O){(!h||O&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),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&&(v(e),v(r),v(a)),S[d].d(),g=!1,_()}}}function zq(n){let e,t,i,l;return e=new Fl({}),i=new si({props:{$$slots:{default:[Hq]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(s,o){q(e,s,o),w(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&&v(t),j(e,s),j(i,s)}}}const Uq="s3_test_request";function Vq(n,e,t){let i,l,s;Ge(n,an,E=>t(7,s=E)),En(an,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 he.settings.getAll()||{};h(E)}catch(E){he.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{he.cancelRequest(Uq);const E=await he.settings.update(U.filterRedactedProps(r));Jt({}),await h(E),As(),nn("Successfully saved storage settings.")}catch(E){he.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 Bq extends ve{constructor(e){super(),ye(this,e,Vq,zq,be,{})}}function e0(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='