pocketbase/ui/dist/assets/autocomplete.worker-C4VNFyM...

5 lines
89 KiB
JavaScript
Raw Normal View History

2025-04-02 16:38:19 +08:00
(function(){"use strict";class Y extends Error{}class qn extends Y{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class zn extends Y{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Pn extends Y{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class j extends Y{}class lt extends Y{constructor(e){super(`Invalid unit ${e}`)}}class x extends Y{}class U extends Y{constructor(){super("Zone is an abstract class")}}const c="numeric",W="short",v="long",Se={year:c,month:c,day:c},ct={year:c,month:W,day:c},Yn={year:c,month:W,day:c,weekday:W},ft={year:c,month:v,day:c},dt={year:c,month:v,day:c,weekday:v},ht={hour:c,minute:c},mt={hour:c,minute:c,second:c},yt={hour:c,minute:c,second:c,timeZoneName:W},gt={hour:c,minute:c,second:c,timeZoneName:v},pt={hour:c,minute:c,hourCycle:"h23"},wt={hour:c,minute:c,second:c,hourCycle:"h23"},St={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:W},kt={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:v},Tt={year:c,month:c,day:c,hour:c,minute:c},Ot={year:c,month:c,day:c,hour:c,minute:c,second:c},Et={year:c,month:W,day:c,hour:c,minute:c},Nt={year:c,month:W,day:c,hour:c,minute:c,second:c},Jn={year:c,month:W,day:c,weekday:W,hour:c,minute:c},xt={year:c,month:v,day:c,hour:c,minute:c,timeZoneName:W},bt={year:c,month:v,day:c,hour:c,minute:c,second:c,timeZoneName:W},It={year:c,month:v,day:c,weekday:v,hour:c,minute:c,timeZoneName:v},vt={year:c,month:v,day:c,weekday:v,hour:c,minute:c,second:c,timeZoneName:v};class oe{get type(){throw new U}get name(){throw new U}get ianaName(){return this.name}get isUniversal(){throw new U}offsetName(e,t){throw new U}formatOffset(e,t){throw new U}offset(e){throw new U}equals(e){throw new U}get isValid(){throw new U}}let $e=null;class ke extends oe{static get instance(){return $e===null&&($e=new ke),$e}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Xt(e,t,n)}formatOffset(e,t){return fe(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Te={};function Bn(r){return Te[r]||(Te[r]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Te[r]}const Gn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function jn(r,e){const t=r.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,i,a,o,u,l,f]=n;return[a,s,i,o,u,l,f]}function Kn(r,e){const t=r.formatToParts(e),n=[];for(let s=0;s<t.length;s++){const{type:i,value:a}=t[s],o=Gn[i];i==="era"?n[o]=a:g(o)||(n[o]=parseInt(a,10))}return n}let Oe={};class $ extends oe{static create(e){return Oe[e]||(Oe[e]=new $(e)),Oe[e]}static resetCache(){Oe={},Te={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=$.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Xt(e,t,n,this.name)}formatOffset(e,t){return fe(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=Bn(this.name);let[s,i,a,o,u,l,f]=n.formatToParts?Kn(n,t):jn(n,t);o==="BC"&&(s=-Math.abs(s)+1);const k=Ie({year:s,month:i,day:a,hour:u===24?0:u,minute:l,second:f,millisecond:0});let m=+t;const E=m%1e3;return m-=E>=0?E:1e3+E,(k-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Mt={};function Hn(r,e={}){const t=JSON.stringify([r,e]);let n=Mt[t];return n||(n=new Intl.ListFormat(r,e),Mt[t]=n),n}let Ue={};function Ze(r,e={}){const t=JSON.stringify([r,e]);let n=Ue[t];return n||(n=new Intl.DateTimeFormat(r,e),Ue[t]=n),n}let qe={};function Qn(r,e={}){const t=JSON.stringify([r,e]);let n=qe[t];return n||(n=new Intl.NumberFormat(r,e),qe[t]=n),n}let ze={};function _n(r,e={}){const{b
2024-09-30 00:23:19 +08:00
`),t+=n.map(s=>{let i="";return s.name.includes("(")||s.name.includes(" ")?i+=s.name:i+="`"+s.name+"`",s.collate&&(i+=" COLLATE "+s.collate),s.sort&&(i+=" "+s.sort.toUpperCase()),i}).join(`,
`),n.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const n=d.parseIndex(e);return n.tableName=t,d.buildIndex(n)}static replaceIndexColumn(e,t,n){if(t===n)return e;const s=d.parseIndex(e);let i=!1;for(let a of s.columns)a.name===t&&(a.name=n,i=!0);return i?d.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const n=["=","!=","~","!~",">",">=","<","<="];for(const s of n)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return d.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="",n=window.location.hash;const s=n.indexOf("?");s>-1&&(t=n.substring(s+1),n=n.substring(0,s));const i=new URLSearchParams(t);for(let u in e){const l=e[u];l===null?i.delete(u):i.set(u,l)}t=i.toString(),t!=""&&(n+="?"+t);let a=window.location.href;const o=a.indexOf("#");o>-1&&(a=a.substring(0,o)),window.location.replace(a+n)}}const at=11e3;onmessage=r=>{var t,n;if(!r.data.collections)return;const e={};e.baseKeys=d.getCollectionAutocompleteKeys(r.data.collections,(t=r.data.baseCollection)==null?void 0:t.name),e.baseKeys=ut(e.baseKeys.sort(ot),at),r.data.disableRequestKeys||(e.requestKeys=d.getRequestAutocompleteKeys(r.data.collections,(n=r.data.baseCollection)==null?void 0:n.name),e.requestKeys=ut(e.requestKeys.sort(ot),at)),r.data.disableCollectionJoinKeys||(e.collectionJoinKeys=d.getCollectionJoinAutocompleteKeys(r.data.collections),e.collectionJoinKeys=ut(e.collectionJoinKeys.sort(ot),at)),postMessage(e)};function ot(r,e){return r.length-e.length}function ut(r,e){return r.length>e?r.slice(0,e):r}})();