PageSourceSearch

https://thirdfactor.ai/_next/static/chunks/3ebwcipe01-lm.js

js thirdfactor.ai collected 2026-10-05 15:54:46 UTC 53,205 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1191,(e,t,i)=>{"use strict";e.i(22287),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"Image",{enumerable:!0,get:function(){return O}});let s=e.r(36437),n=e.r(56421),r=e.r(26755),o=n._(e.r(29539)),a=s._(e.r(71421)),l=s._(e.r(7251)),c=e.r(40991),u=e.r(10892),d=e.r(90981),h=e.r(57737),p=s._(e.r(3997)),f=e.r(4943),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function b(e,t,i,s,n,r,o){let a=e?.src;e&&e["data-loaded-src"]!==a&&(e["data-loaded-src"]=a,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&n(!0),i?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let s=!1,n=!1;i.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>s,isPropagationStopped:()=>n,persist:()=>{},preventDefault:()=>{s=!0,t.preventDefault()},stopPropagation:()=>{n=!0,t.stopPropagation()}})}s?.current&&s.current(e)}}))}function m(e){return o.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let y="u"<typeof window?o.useEffect:o.useLayoutEffect,w=(0,o.forwardRef)(({src:e,srcSet:t,sizes:i,height:s,width:n,decoding:a,className:l,style:c,fetchPriority:u,placeholder:d,loading:h,unoptimized:p,fill:g,onLoadRef:w,onLoadingCompleteRef:S,setBlurComplete:O,setShowAltText:C,sizesInput:v,onLoad:P,onError:R,...j},E)=>{let I=(0,o.useRef)(!1),T=(0,o.useRef)(null);y(()=>{let{current:e}=I,{current:t}=T;e||null===t||(R&&(t.src=t.src),t.complete&&b(t,d,w,S,O,p,v),I.current=!0)},[e,d,w,S,R,p,v]);let _=(0,f.useMergedRef)(E,T);return(0,r.jsx)("img",{...j,...m(u),loading:h,width:n,height:s,decoding:a,"data-nimg":g?"fill":"1",className:l,style:c,sizes:i,srcSet:t,src:e,ref:_,onLoad:e=>{b(e.currentTarget,d,w,S,O,p,v)},onError:e=>{C(!0),"empty"!==d&&O(!0),R&&R(e)}})});function S({isAppRouter:e,imgAttributes:t}){let i={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...m(t.fetchPriority)};return e&&a.default.preload?(a.default.preload(t.src,i),null):(0,r.jsx)(l.default,{children:(0,r.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...i},"__nimg-"+t.src+t.srcSet+t.sizes)})}let O=(0,o.forwardRef)((e,t)=>{let i=(0,o.useContext)(h.RouterContext),s=(0,o.useContext)(d.ImageConfigContext),n=(0,o.useMemo)(()=>{let e=g||s||u.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),i=e.deviceSizes.sort((e,t)=>e-t),n=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:i,qualities:n,localPatterns:"u"<typeof window?s?.localPatterns:e.localPatterns}},[s]),{onLoad:a,onLoadingComplete:l}=e,f=(0,o.useRef)(a);(0,o.useEffect)(()=>{f.current=a},[a]);let b=(0,o.useRef)(l);(0,o.useEffect)(()=>{b.current=l},[l]);let[m,y]=(0,o.useState)(!1),[O,C]=(0,o.useState)(!1),{props:v,meta:P}=(0,c.getImgProps)(e,{defaultLoader:p.default,imgConf:n,blurComplete:m,showAltText:O});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w,{...v,unoptimized:P.unoptimized,placeholder:P.placeholder,fill:P.fill,onLoadRef:f,onLoadingCompleteRef:b,setBlurComplete:y,setShowAltText:C,sizesInput:e.sizes,ref:t}),P.preload?(0,r.jsx)(S,{isAppRouter:!i,imgAttributes:v}):null]})});("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},86260,(e,t,i)=>{"use strict";function s(e,t){let i=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-i)<Math.abs(e-i)?t:e,t.qualities[0]):i}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"findClosestQuality",{enumerable:!0,get:function(){return s}})},40991,(e,t,i)=>{"use strict";e.i(22287),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getImgProps",{enumerable:!0,get:function(){return c}});let s=e.r(91370),n=e.r(43581),r=e.r(10892),o=["-moz-initial","fill","none","scale-down",void 0];function a(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function c({src:e,sizes:t,unoptimized:i=!1,priority:u=!1,preload:d=!1,loading:h,className:p,quality:f,width:g,height:b,fill:m=!1,style:y,overrideSrc:w,onLoad:S,onLoadingComplete:O,placeholder:C="empty",blurDataURL:v,fetchPriority:P,decoding:R="async",layout:j,objectFit:E,objectPosition:I,lazyBoundary:T,lazyRoot:_,...k},A){var x;let q,L,U,{imgConf:N,showAltText:D,blurComplete:M,defaultLoader:F}=A,$=N||r.imageConfigDefault;if("allSizes"in $)q=$;else{let e=[...$.deviceSizes,...$.imageSizes].sort((e,t)=>
1e-t),t=$.deviceSizes.sort((e,t)=>e-t),i=$.qualities?.sort((e,t)=>e-t);q={...$,allSizes:e,deviceSizes:t,qualities:i}}if(void 0===F)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let z=k.loader||F;delete k.loader,delete k.srcSet;let W="__next_img_default"in z;if(W){if("custom"===q.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
2Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=z;z=t=>{let{config:i,...s}=t;return e(s)}}if(j){"fill"===j&&(m=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[j];e&&(y={...y,...e});let i={responsive:"100vw",fill:"100vw"}[j];i&&!t&&(t=i)}let K="",B=l(g),G=l(b);if((x=e)&&"object"==typeof x&&(a(x)||void 0!==x.src)){let t=a(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(L=t.blurWidth,U=t.blurHeight,v=v||t.blurDataURL,K=t.src,!m)if(B||G){if(B&&!G){let e=B/t.width;G=Math.round(t.height*e)}else if(!B&&G){let e=G/t.height;B=Math.round(t.width*e)}}else B=t.width,G=t.height}let H=!u&&!d&&("lazy"===h||void 0===h);(!(e="string"==typeof e?e:K)||e.startsWith("data:")||e.startsWith("blob:"))&&(i=!0,H=!1),q.unoptimized&&(i=!0),W&&!q.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(i=!0);let J=l(f),V=Object.assign(m?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:E,objectPosition:I}:{},D?{}:{color:"transparent"},y),X=M||"empty"===C?null:"blur"===C?`url("data:image/svg+xml;charset=utf-8,${(0,n.getImageBlurSvg)({widthInt:B,heightInt:G,blurWidth:L,blurHeight:U,blurDataURL:v||"",objectFit:V.objectFit})}")`:`url("${C}")`,Q=o.includes(V.objectFit)?"fill"===V.objectFit?"100% 100%":"cover":V.objectFit,Y=X?{backgroundSize:Q,backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},Z=function({config:e,src:t,unoptimized:i,width:n,quality:r,sizes:o,loader:a}){if(i){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,s.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,s.getAssetToken)())e=void 0;else if(e){let i=t.indexOf("?");if(-1!==i){let s=new URLSearchParams(t.slice(i+1));s.get("dpl")||(s.append("dpl",e),t=t.slice(0,i)+"?"+s.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:c}=function({deviceSizes:e,allSizes:t},i,s){if(s){let i=/(^|\s)(1?\d?\d)vw/g,n=[];for(let e;e=i.exec(s);)n.push(parseInt(e[2]));if(n.length){let i=.01*Math.min(...n);return{widths:t.filter(t=>t>=e[0]*i),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof i?{widths:e,kind:"w"}:{widths:[...new Set([i,2*i].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,n,o),u=l.length-1;return{sizes:o||"w"!==c?o:"100vw",srcSet:l.map((i,s)=>`${a({config:e,src:t,quality:r,width:i})} ${"w"===c?i:s+1}${c}`).join(", "),src:a({config:e,src:t,quality:r,width:l[u]})}}({config:q,src:e,unoptimized:i,width:B,quality:J,sizes:t,loader:z}),ee=H?"lazy":h;return{props:{...k,loading:ee,fetchPriority:P,width:B,height:G,decoding:R,className:p,style:{...V,...Y},sizes:Z.sizes,srcSet:Z.srcSet,src:w||Z.src},meta:{unoptimized:i,preload:d||u,placeholder:C,fill:m}}}},7251,(e,t,i)=>{"use strict";e.i(22287),Object.defineProperty(i,"__esModule",{value:!0});var s={default:function(){return g},defaultHead:function(){return d}};for(var n in s)Object.defineProperty(i,n,{enumerable:!0,get:s[n]});let r=e.r(36437),o=e.r(56421),a=e.r(26755),l=o._(e.r(29539)),c=r._(e.r(33095)),u=e.r(4721);function d(){return[(0,a.jsx)("meta",{charSet:"utf-8"},"charset"),(0,a.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>
2"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let p=["name","httpEquiv","charSet","itemProp"];function f(e){let t,i,s,n;return e.reduce(h,[]).reverse().concat(d().reverse()).filter((t=new Set,i=new Set,s=new Set,n={},e=>{let r=!0,o=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){o=!0;let i=e.key.slice(e.key.indexOf("$")+1);t.has(i)?r=!1:t.add(i)}switch(e.type){case"title":case"base":i.has(e.type)?r=!1:i.add(e.type);break;case"meta":for(let t=0,i=p.length;t<i;t++){let i=p[t];if(e.props.hasOwnProperty(i))if("charSet"===i)s.has(i)?r=!1:s.add(i);else{let t=e.props[i],s=n[i]||new Set;("name"!==i||!o)&&s.has(t)?r=!1:(s.add(t),n[i]=s)}}}return r})).reverse().map((e,t)=>{let i=e.key||t;return l.default.cloneElement(e,{key:i})})}let g=function({children:e}){let t=(0,l.useContext)(u.HeadManagerContext);return(0,a.jsx)(c.default,{reduceComponentsToState:f,headManager:t,children:e})};("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},43581,(e,t,i)=>{"use strict";function s({widthInt:e,heightInt:t,blurWidth:i,blurHeight:n,blurDataURL:r,objectFit:o}){let a=i?40*i:e,l=n?40*n:t,c=a&&l?`viewBox='0 0 ${a} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${c}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${c?"none":"contain"===o?"xMidYMid":"cover"===o?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${r}'/%3E%3C/svg%3E`}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getImageBlurSvg",{enumerable:!0,get:function(){return s}})},90981,(e,t,i)=>{"use strict";e.i(22287),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ImageConfigContext",{enumerable:!0,get:function(){return r}});let s=e.r(36437)._(e.r(29539)),n=e.r(10892),r=s.default.createContext(n.imageConfigDefault)},57737,(e,t,i)=>{"use strict";e.i(22287),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"RouterContext",{enumerable:!0,get:function(){return s}});let s=e.r(36437)._(e.r(29539)).default.createContext(null)},10892,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s={VALID_LOADERS:function(){return r},imageConfigDefault:function(){return o}};for(var n in s)Object.defineProperty(i,n,{enumerable:!0,get:s[n]});let r=["default","imgix","cloudinary","akamai","custom"],o={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},42423,(e,t,i)=>{"use strict";e.i(22287),Object.defineProperty(i,"__esModule",{value:!0});var s={default:function(){return u},getImageProps:function(){return c}};for(var n in s)Object.defineProperty(i,n,{enumerable:!0,get:s[n]});let r=e.r(36437),o=e.r(40991),a=e.r(1191),l=r._(e.r(3997));function c(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,i]of Object.entries(t))void 0===i&&delete t[e];return{props:t}}let u=a.Image},96404,(e,t,i)=>{t.exports=e.r(42423)},3997,(e,t,i)=>{"use strict";e.i(22287),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return o}});let s=e.r(86260),n=e.r(91370);function r({config:e,src:t,width:i,quality:o}){let a=(0,n.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,n.getAssetToken)())a=void 0;else{let e=t.indexOf("?");if(-1!==e){let i=new URLSearchParams(t.slice(e+1)),s=i.get("dpl");if(s){a=s,i.delete("dpl");let n=i.toString();t=t.slice(0,e)+(n?"?"+n:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
3Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,
3configurable:!0});let l=(0,s.findClosestQuality)(o,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${i}&q=${l}${t.startsWith("/")&&a?`&dpl=${a}`:""}`}r.__next_img_default=!0;let o=r},33095,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return a}});let s=e.r(29539),n="u"<typeof window,r=n?()=>{}:s.useLayoutEffect,o=n?()=>{}:s.useEffect;function a(e){let{headManager:t,reduceComponentsToState:i}=e;function a(){if(t&&t.mountedInstances){let e=s.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(i(e))}}return n&&(t?.mountedInstances?.add(e.children),a()),r(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),r(()=>(t&&(t._pendingUpdate=a),()=>{t&&(t._pendingUpdate=a)})),o(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},88625,e=>{"use strict";let t;class i extends Error{constructor(e){super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,i.prototype),null!==e&&"object"==typeof e&&(this.originalError=e.originalError,this.url="string"==typeof e.url?e.url:"",this.status="number"==typeof e.status?e.status:0,this.isAbort=!!e.isAbort||"AbortError"===e.name||"Aborted"===e.message,null!==e.response&&"object"==typeof e.response?this.response=e.response:null!==e.data&&"object"==typeof e.data?this.response=e.data:this.response={}),this.originalError||e instanceof i||(this.originalError=e),this.name="ClientResponseError "+this.status,this.message=this.response?.message,this.message||(this.isAbort?this.message="The request was aborted (most likely autocancelled; you can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation).":this.originalError?.cause?.message?.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."),this.cause=this.originalError}get data(){return this.response}toJSON(){return{...this}}}let s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function n(e,t,i){let n=Object.assign({},i||{}),r=n.encode||o;if(!s.test(e))throw TypeError("argument name is invalid");let a=r(t);if(a&&!s.test(a))throw TypeError("argument val is invalid");let l=e+"="+a;if(null!=n.maxAge){let e=n.maxAge-0;if(isNaN(e)||!isFinite(e))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(e)}if(n.domain){if(!s.test(n.domain))throw TypeError("option domain is invalid");l+="; Domain="+n.domain}if(n.path){if(!s.test(n.path))throw TypeError("option path is invalid");l+="; Path="+n.path}if(n.expires){var c;if(c=n.expires,"[object Date]"!==Object.prototype.toString.call(c)&&!(c instanceof Date)||isNaN(n.expires.valueOf()))throw TypeError("option expires is invali
3d");l+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():n.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l}function r(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function o(e){return encodeURIComponent(e)}let a="u">typeof navigator&&"ReactNative"===navigator.product||e.g.HermesInternal;function l(e){if(e)try{let i=decodeURIComponent(t(e.split(".")[1]).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)||{}}catch(e){}return{}}function c(e,t=0){let i=l(e);return!(Object.keys(i).length>0&&(!i.exp||i.exp-t>Date.now()/1e3))}t="function"!=typeof atob||a?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var i,s,n=0,r=0,o="";s=t.charAt(r++);~s&&(i=n%4?64*i+s:s,n++%4)&&(o+=String.fromCharCode(255&i>>(-2*n&6))))s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return o}:atob;let u="pb_auth";class d{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!c(this.token)}get isSuperuser(){let e=l(this.token);return"auth"==e.type&&("_superusers"==this.record?.collectionName||!this.record?.collectionName&&"pbc_3142635823"==e.collectionId)}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"),"auth"==l(this.token).type&&!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=u){let i=function(e){let t={};if("string"!=typeof e)return t;let i=Object.assign({},{}).decode||r,s=0;for(;s<e.length;){let n=e.indexOf("=",s);if(-1===n)break;let r=e.indexOf(";",s);if(-1===r)r=e.length;else if(r<n){s=e.lastIndexOf(";",n-1)+1;continue}let o=e.slice(s,n).trim();if(void 0===t[o]){let s=e.slice(n+1,r).trim();34===s.charCodeAt(0)&&(s=s.slice(1,-1));try{t[o]=i(s)}catch(e){t[o]=s}}s=r+1}return t}(e||"")[t]||"",s={};try{s=JSON.parse(i),("object"!=typeof s||Array.isArray(s))&&(s={})}catch(e){}this.save(s.token||"",s.record||s.model||null)}exportToCookie(e,t=u){let i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=l(this.token);i.expires=new Date(s?.exp?1e3*s.exp:"1970-01-01"),e=Object.assign({},i,e);let r={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null},o=n(t,JSON.stringify(r),e),a="u">typeof Blob?new Blob([o]).size:o.length;if(r.record&&a>4096){r.record={id:r.record?.id,email:r.record?.email};let i=["collectionId","collectionName","verified"];for(let e in this.record)i.includes(e)&&(r.record[e]=this.record[e]);o=n(t,JSON.stringify(r),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{for(let t=this._onChangeCallbacks.length-1;t>=0;t--)if(this._onChangeCallbacks[t]==e)return delete this._onChangeCallbacks[t],void this._onChangeCallbacks.splice(t,1)}}triggerChange(){for(let e of this._onChangeCallbacks)e&&e(this.token,this.record)}}class h extends d{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){let 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("u">typeof window&&window?.localStorage){let t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch(e){return t}}return this.storageFallback[e]}_storageSet(e,t){if("u">typeof window&&window?.localStorage){let i=t;"string"!=typeof t&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){"u">typeof window&&window?.localStorage&&window.localStorage?.removeItem(e),delete this.storageFallback[e]}_bindStorageEvent(){"u">typeof window&&window?.localStorage&&window.addEventListener&&window.addEventListener("storage",e=>
3{if(e.key!=this.storageKey)return;let t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class p{constructor(e){this.client=e}}class f extends p{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,s){return s=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},s),this.client.send("/api/settings/test/email",s).then(()=>!0)}async generateAppleClientSecret(e,t,i,s,n,r){return r=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:n}},r),this.client.send("/api/settings/apple/generate-client-secret",r)}}let g=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function b(e){if(e)for(let t in e.query=e.query||{},e)g.includes(t)||(e.query[t]=e[t],delete e[t])}function m(e){let t=[];for(let s in e){let n=encodeURIComponent(s);for(let r of Array.isArray(e[s])?e[s]:[e[s]]){var i;null!==(r=null==(i=r)?null:i instanceof Date?encodeURIComponent(i.toISOString().replace("T"," ")):"object"==typeof i?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i))&&t.push(n+"="+r)}}return t.join("&")}class y extends p{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=[],this.pendingSubmits=[],this.isProcessingPendingSubmits=!1}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){if(!e)throw Error("topic must be set.");let s=e;if(i){b(i=Object.assign({},i));let e="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));s+=(s.includes("?")?"&":"?")+e}let n=function(e){let i;try{i=JSON.parse(e?.data)}catch{}t(i||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(n),this.isConnected?1===this.subscriptions[s].length?await this.submitSubscriptions():this.eventSource?.addEventListener(s,n):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,n)}async unsubscribe(e){if(e){let t=this.getSubscriptionsByTopic(e);for(let e in t)if(this.hasSubscriptionListeners(e)){for(let t of this.subscriptions[e])this.eventSource?.removeEventListener(e,t);delete this.subscriptions[e]}}else this.subscriptions={};await this.submitSubscriptions()}async unsubscribeByPrefix(e){let t=!1;for(let i in this.subscriptions)if((i+"?").startsWith(e)){for(let e of(t=!0,this.subscriptions[i]))this.eventSource?.removeEventListener(i,e);delete this.subscriptions[i]}t&&await this.submitSubscriptions()}async unsubscribeByTopicAndListener(e,t){let i=this.getSubscriptionsByTopic(e);for(let e in i){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)continue;let i=!1;for(let s=this.subscriptions[e].length-1;s>=0;s--)this.subscriptions[e][s]===t&&(i=!0,delete this.subscriptions[e][s],this.subscriptions[e].splice(s,1),this.eventSource?.removeEventListener(e,t));i&&(this.subscriptions[e].length||delete this.subscriptions[e])}await this.submitSubscriptions()}hasSubscriptionListeners(e){if(this.subscriptions=this.subscriptions||{},e)return!!this.subscriptions[e]?.length;for(let e in this.subscriptions)if(this.subscriptions[e]?.length)return!0;return!1}async submitSubscriptions(){return new Promise((e,t)=>{this.pendingSubmits.push({resolve:e,reject:t}),1==this.pendingSubmits.length&&queueMicrotask(()=>this.finalizePendingSubscriptions())})}async finalizePendingSubscriptions(){if(this.isProcessingPendingSubmits||!this.pendingSubmits.length)return;let e=this.pendingSubmits.slice();this.pendingSubmits=[],this.isProcessingPendingSubmits=!0;try{for(let t of(await this.sendSubscriptions(),e))t.resolve()}catch(t){for(let i of e)t?i.reject(t):i.resolve()}finally{this.isProcessingPendingSubmits=!1,this.pendingSubmits.length>0&&await this.finalizePendingSubscriptions()}}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){let t={};for(let i in e=e.includes("?")?e:e+"?",this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){let e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}hasUnsentSubscriptions(){let e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(let t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}
3async sendSubscriptions(){if(this.clientId){if(!this.hasSubscriptionListeners())return this.disconnect();if(this.hasUnsentSubscriptions())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?.isAbort)throw e})}}addAllSubscriptionListeners(){if(this.eventSource)for(let e in this.removeAllSubscriptionListeners(),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}),1==this.pendingConnects.length&&queueMicrotask(()=>this.initConnect())})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{this.clientId=e?.lastEventId,this.lastSentSubscriptions=[],this.submitSubscriptions().then(async()=>{let t=3;for(;this.hasUnsentSubscriptions()&&t>0;)t--,await this.submitSubscriptions();for(let e of this.pendingConnects)e.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);let i=this.getSubscriptionsByTopic("PB_CONNECT");for(let t in i)for(let s of i[t])s(e);this.hasUnsentSubscriptions()&&await this.submitSubscriptions()}).catch(e=>{this.clientId="",this.lastSentSubscriptions=[],this.connectErrorHandler(e)})})}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let t of this.pendingConnects)t.reject(new i(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);let t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),this.eventSource?.close(),this.eventSource=null,this.clientId="",this.lastSentSubscriptions=[],!e){for(let e of(this.reconnectAttempts=0,this.pendingConnects))e.resolve();this.pendingConnects=[]}}}class w extends p{decode(e){return e}async getFullList(e,t){if("number"==typeof e)return this._getFullList(e,t);let i=1e3;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(e=>(e.items=e.items?.map(e=>this.decode(e))||[],e))}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(e=>{if(!e?.items?.length)throw new i({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return e.items[0]})}async getOne(e,t){if(!e)throw new i({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(e=>this.decode(e))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(e=>this.decode(e))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(e=>this.decode(e))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=1e3,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],s=async n=>this.getList(n,e||1e3,t).then(e=>{let t=e.items;return i=i.concat(t),t.length==e.perPage?s(n+1):i});return s(1)}}function S(e,t,i,s){let n=void 0!==s;return n||void 0!==i?n?(console.warn(e),t.body=Object.assign({},t.body,i),t.query=Object.assign({},t.query,s),t):Object.assign(t,i):t}function O(e){e._resetAutoRefresh?.()}class C extends w{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"_superusers"==this.collectionIdOrName||"_pbc_2773867675"==this.collectionIdOrName}async subscribe(e,t,i){if(!e)throw Error("Missing topic.");
3if(!t)throw 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("number"==typeof e)return super.getFullList(e,t);let 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(e=>{if(this.client.authStore.record?.id===e?.id&&(this.client.authStore.record?.collectionId===this.collectionIdOrName||this.client.authStore.record?.collectionName===this.collectionIdOrName)){let t=Object.assign({},this.client.authStore.record.expand),i=Object.assign({},this.client.authStore.record,e);t&&(i.expand=Object.assign(t,e.expand)),this.client.authStore.save(this.client.authStore.token,i)}return e})}async delete(e,t){return super.delete(e,t).then(t=>(t&&this.client.authStore.record?.id===e&&(this.client.authStore.record?.collectionId===this.collectionIdOrName||this.client.authStore.record?.collectionName===this.collectionIdOrName)&&this.client.authStore.clear(),t))}authResponse(e){let t=this.decode(e?.record||{});return this.client.authStore.save(e?.token,t),Object.assign({},e,{token: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){var s,n,r,o;let a,l,u,d;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(a=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||O(this.client));let h=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return h=this.authResponse(h),a&&this.isSuperusers&&(s=this.client,n=a,r=()=>this.authRefresh({autoRefresh:!0}),o=()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i)),O(s),l=s.beforeSend,u=s.authStore.record,d=s.authStore.onChange((e,t)=>{(!e||t?.id!=u?.id||(t?.collectionId||u?.collectionId)&&t?.collectionId!=u?.collectionId)&&O(s)}),s._resetAutoRefresh=function(){d(),s.beforeSend=l,delete s._resetAutoRefresh},s.beforeSend=async(e,t)=>{let i=s.authStore.token;if(t.query?.autoRefresh)return l?l(e,t):{url:e,sendOptions:t};let a=s.authStore.isValid;if(a&&c(s.authStore.token,n))try{await r()}catch(e){a=!1}a||await o();let u=t.headers||{};for(let e in u)if("authorization"==e.toLowerCase()&&i==u[e]&&s.authStore.token){u[e]=s.authStore.token;break}return t.headers=u,l?l(e,t):{url:e,sendOptions:t}}),h}async authWithOAuth2Code(e,t,i,s,n,r,o){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:s,createData:n}};return a=S("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,r,o),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(e=>this.authResponse(e))}authWithOAuth2(...e){if(e.length>1||"string"==typeof e?.[0])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?.[0]||"",e?.[1]||"",e?.[2]||"",e?.[3]||"",e?.[4]||{},e?.[5]||{},e?.[6]||{});let t=e?.[0]||{},s=null;t.urlCallback||(s=v(void 0));let n=new y(this.client);function r(){s?.close(),n.unsubscribe()}let o={},a=t.requestKey;return a&&(o.requestKey=a),this.listAuthMethods(o).then(e=>{let o=e.oauth2.providers.find(e=>e.name===t.provider);if(!o)throw new i(Error(`Missing or invalid provider "${t.provider}".`));let l=this.client.buildURL("/api/oauth2-redirect");return new Promise(async(e,c)=>{let u=a?this.client.cancelControllers?.[a]:void 0;u&&(u.signal.onabort=()=>{r(),c(new i({isAbort:!0,message:"manually cancelled"}))}),n.onDisconnect=e=>{e.length&&c&&(r(),c(new i(Error("realtime connection interrupted"))))};try{await n.subscribe("@oauth2",async s=>{let a=n.clientId;try{if(!s.state||a!==s.state)throw Error("State parameters don't match.");if(s.error||!s.code)throw Error("OAuth2 redirect error or missing code: "+s.error);let i=Object.assign({},t);delete i.provider,delete i.scopes,delete i.createData,delete i.urlCallback,u?.signal?.onabort&&(u.signal.onabort=null);let n=await this.authWithOAuth2Code(o.name,s.code,o.codeVerifier,l,t.createData,i);e(n)}catch(e){c(new i(e))}r()});let a={state:n.clientId};t.scopes?.length&&(a.scope=t.scopes.join(" "));let d=this._replaceQueryParams(o.authURL+l,a),h=t.urlCallback||function(e){s?s.location.href=e:s=v(e)};await h(d)}catch(e){u?.signal?.onabort&&(u.signal.onabort=null),r(),c(new i(e))}})}).catch(e=>{throw r(),e})}async authRefresh(e,t){let i={method:"POST"};return i=S("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(e=>this.authResponse(e))}async requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=S("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(e,t,i,s,n){let r={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return r=S("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",r,s,n),this.client.send(this.baseCollectionPath+"/confirm-password-reset",r).then(()=>!0)}async requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=S("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=S("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{let t=l(e),i=this.client.authStore.record;return i&&!i.verified&&i.id===t.id&&i.collectionId===t.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=S("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(e,t,i,s){let n={method:"POST",body:{token:e,password:t}};return n=S("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",n,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",n).then(()=>{let t=l(e),i=this.client.authStore.record;return i&&i.id===t.id&&i.collectionId===t.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){let s=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(s.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(e=>this.authResponse(e))}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);let s=new D(this.client.baseURL,new d,this.client.lang),n=await s.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return s.authStore.save(n?.token,this.decode(n?.record||{})),s}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));let n={};for(let e of s.split("&")){if(""==e)continue;let t=e.split("=");n[decodeURIComponent(t[0].replace(/\+/g," "))]=decodeURIComponent((t[1]||"").replace(/\+/g," "))}for(let e in t)t.hasOwnProperty(e)&&(null==t[e]?delete n[e]:n[e]=t[e]);for(let e in s="",n)n.hasOwnProperty(e)&&(""!=s&&(s+="&"),s+=encodeURIComponent(e.replace(/%20/g,"+"))+"="+encodeURIComponent(n[e].replace(/%20/g,"+")));return""!=s?i+"?"+s:i}}function v(e){if("u"<typeof window||!window?.open)throw new i(Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,s=768,n=window.innerWidth,r=window.innerHeight;t=t>n?n:t,s=s>r?r:s;let o=n/2-t/2,a=r/2-s/2;return window.open(e,"popup_window","width="+t+",height="+s+",top="+a+",left="+o+",resizable,menubar=no")}class P extends w{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 truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async getAllOAuth2Providers(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/oauth2-providers",e)}async dryRunViewQuery(e,t){return t=Object.assign({method:"POST",body:{query:e}},t),this.client.send(this.baseCrudPath+"/meta/dry-run-view",t)}}class R extends p{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 i({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 j extends p{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class E extends p{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?.id||!e?.collectionId&&!e?.collectionName)return"";let s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let n=this.client.buildURL(s.join("/"));!1===i.download&&delete i.download;let r=m(i);return r&&(n+=(n.includes("?")?"&":"?")+r),n}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(e=>e?.token||"")}}class I extends p{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(
3) with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class T extends p{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/crons",e)}async run(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/crons/${encodeURIComponent(e)}`,t).then(()=>!0)}}class _ extends p{async run(e,t){return t=Object.assign({method:"POST",body:{query:e}},t),this.client.send("/api/sql",t)}}function k(t){return"u">typeof Blob&&t instanceof Blob||"u">typeof File&&t instanceof File||null!==t&&"object"==typeof t&&t.uri&&("u">typeof navigator&&"ReactNative"===navigator.product||e.g.HermesInternal)}function A(e){return e&&("FormData"===e.constructor?.name||"u">typeof FormData&&e instanceof FormData)}function x(e){for(let t in e)for(let i of Array.isArray(e[t])?e[t]:[e[t]])if(k(i))return!0;return!1}let q=/^[\-\.\d]+$/;function L(e){if("string"!=typeof e)return e;if("true"==e)return!0;if("false"==e)return!1;if(("-"===e[0]||e[0]>="0"&&e[0]<="9")&&q.test(e)){let t=+e;if(""+t===e)return t}return e}class U extends p{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new N(this.requests,e)),this.subs[e]}async send(e){let t=new FormData,i=[];for(let e=0;e<this.requests.length;e++){let s=this.requests[e];if(i.push({method:s.method,url:s.url,headers:s.headers,body:s.json}),s.files)for(let i in s.files)for(let n of s.files[i]||[])t.append("requests."+e+"."+i,n)}return t.append("@jsonPayload",JSON.stringify({requests:i})),e=Object.assign({method:"POST",body:t},e),this.client.send("/api/batch",e)}}class N{constructor(e,t){this.requests=[],this.requests=e,this.collectionIdOrName=t}upsert(e,t){t=Object.assign({body:e||{}},t);let i={method:"PUT",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(i,t),this.requests.push(i)}create(e,t){t=Object.assign({body:e||{}},t);let i={method:"POST",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(i,t),this.requests.push(i)}update(e,t,i){i=Object.assign({body:t||{}},i);let s={method:"PATCH",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(s,i),this.requests.push(s)}delete(e,t){t=Object.assign({},t);let i={method:"DELETE",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(i,t),this.requests.push(i)}prepareRequest(e,t){let i;if(b(t),e.headers=t.headers,e.json={},e.files={},void 0!==t.query){let i=m(t.query);i&&(e.url+=(e.url.includes("?")?"&":"?")+i)}let s=t.body;for(let t in A(s)&&(i={},s.forEach((e,t)=>{if("@jsonPayload"===t&&"string"==typeof e)try{let t=JSON.parse(e);Object.assign(i,t)}catch(e){console.warn("@jsonPayload error:",e)}else void 0!==i[t]?(Array.isArray(i[t])||(i[t]=[i[t]]),i[t].push(L(e))):i[t]=L(e)}),s=i),s){let i=s[t];if(k(i))e.files[t]=e.files[t]||[],e.files[t].push(i);else if(Array.isArray(i)){let s=[],n=[];for(let e of i)k(e)?s.push(e):n.push(e);if(s.length>0&&s.length==i.length)for(let i of(e.files[t]=e.files[t]||[],s))e.files[t].push(i);else if(e.json[t]=n,s.length>0){let i=t;for(let n of(t.startsWith("+")||t.endsWith("+")||(i+="+"),e.files[i]=e.files[i]||[],s))e.files[i].push(n)}}else e.json[t]=i}}}class D{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:"u">typeof window&&window.Deno?this.authStore=new d:this.authStore=new h,this.collections=new P(this),this.files=new E(this),this.logs=new R(this),this.settings=new f(this),this.realtime=new y(this),this.health=new j(this),this.backups=new I(this),this.crons=new T(this),this.sql=new _(this)}get admins(){return this.collection("_superusers")}createBatch(){return new U(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new C(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)e=e.replaceAll("{:"+i+"}",function(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return JSON.stringify(e);default:if(null==e)return"null";if(e instanceof Date)return JSON.stringify(e.toISOString().replace("T"," "));{let t=JSON.stringify(e);return t.startsWith("[")||t.startsWith("{")?JSON.stringify(t):t}}}(t[i]));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){let t=this.baseURL;return"u"<typeof window||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=window.location.origin?.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}
3async send(e,t){t=this.initSendOptions(e,t);let s=this.buildURL(e);if(this.beforeSend){let e=Object.assign({},await this.beforeSend(s,t));void 0!==e.url||void 0!==e.options?(s=e.url||s,t=e.options||t):Object.keys(e).length&&(t=e,console?.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(void 0!==t.query){let e=m(t.query);e&&(s+=(s.includes("?")?"&":"?")+e),delete t.query}return"application/json"==this.getHeader(t.headers,"Content-Type")&&t.body&&"string"!=typeof t.body&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(s,t).then(async e=>{let s={};try{s=await e.json()}catch(e){if(t.signal?.aborted||"AbortError"==e?.name||"Aborted"==e?.message)throw e}if(this.afterSend&&(s=await this.afterSend(e,s,t)),e.status>=400)throw new i({url:e.url,status:e.status,data:s});return s}).catch(e=>{throw new i(e)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(e){if("u"<typeof FormData||void 0===e||"object"!=typeof e||null===e||A(e)||!x(e))return e;let t=new FormData;for(let i in e){let s=e[i];if(void 0!==s)if("object"!=typeof s||x({data:s}))for(let e of Array.isArray(s)?s:[s])t.append(i,e);else{let e={};e[i]=s,t.append("@jsonPayload",JSON.stringify(e))}}return t}(t.body),b(t),t.query=Object.assign({},t.params,t.query),void 0===t.requestKey&&(!1===t.$autoCancel||!1===t.query.$autoCancel?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,null!==this.getHeader(t.headers,"Content-Type")||A(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),null===this.getHeader(t.headers,"Accept-Language")&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&null===this.getHeader(t.headers,"Authorization")&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&null!==t.requestKey){let i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);let s=new AbortController;this.cancelControllers[i]=s,t.signal=s.signal}return t}getHeader(e,t){for(let i in e=e||{},t=t.toLowerCase(),e)if(i.toLowerCase()==t)return e[i];return null}}var M=e.i(22287);M.default.env.RESEND_API_KEY,M.default.env.FROM_EMAIL,M.default.env.TO_EMAIL;let F=new D("https://pb.thirdfactor.ai");e.s(["getFileUrl",0,function(e,t){return F.files.getURL(e,t)},"pb",0,F],88625)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.