prismic 0.0.0-canary.169f5fa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ import{createRequire as e}from"node:module";import{access as t,mkdir as n,readFile as r,rename as i,rm as a,writeFile as o}from"node:fs/promises";import{relative as s}from"node:path";import{fileURLToPath as c,pathToFileURL as l}from"node:url";import*as u from"fs";import d from"fs";import f,{basename as p,dirname as m,normalize as h,posix as g,relative as ee,resolve as _,sep as v}from"path";import{fileURLToPath as y}from"url";import{createRequire as b}from"module";import{createServer as x}from"node:http";import{homedir as S}from"node:os";var C=Object.create,w=Object.defineProperty,T=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,D=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty,k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),te=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=E(t),a=0,o=i.length,s;a<o;a++)s=i[a],!O.call(e,s)&&s!==n&&w(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=T(t,s))||r.enumerable});return e},A=(e,t,n)=>(n=e==null?{}:C(D(e)),te(t||!e||!e.__esModule?w(n,`default`,{value:e,enumerable:!0}):n,e)),j=e(import.meta.url);function M(e){return{lang:e?.lang??void 0,message:e?.message,abortEarly:e?.abortEarly??void 0,abortPipeEarly:e?.abortPipeEarly??void 0}}function N(e){return(void 0)?.get(e)}function P(e){return(void 0)?.get(e)}function F(e,t){return(void 0)?.get(e)?.get(t)}function I(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function L(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??I(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??F(e.reference,c.lang)??(l?P(c.lang):null)??r.message??N(c.lang);u!==void 0&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}function R(e){return{version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},M())}}}function z(e,t){return Object.hasOwn(e,t)&&t!==`__proto__`&&t!==`prototype`&&t!==`constructor`}function B(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}var V=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function H(e){return{kind:`validation`,type:`non_empty`,reference:H,async:!1,expects:`!0`,message:e,"~run"(e,t){return e.typed&&e.value.length===0&&L(this,`length`,e,t,{received:`0`}),e}}}function U(e){return{kind:`transformation`,type:`transform`,reference:U,async:!1,operation:e,"~run"(e){return e.value=this.operation(e.value),e}}}function W(e){return{kind:`validation`,type:`url`,reference:W,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&L(this,`URL`,e,t),e}}}function G(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function K(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function q(e,t){return{kind:`schema`,type:`array`,reference:q,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return R(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else L(this,`type`,e,t);return e}}}function J(e){return{kind:`schema`,type:`boolean`,reference:J,expects:`boolean`,async:!1,message:e,get"~standard"(){return R(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:L(this,`type`,e,t),e}}}function Y(e,t){return{kind:`schema`,type:`object`,reference:Y,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return R(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`)for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:K(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=G(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(L(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}else L(this,`type`,e,t);return e}}}function X(e,t){return{kind:`schema`,type:`optional`,reference:X,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return R(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=K(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function ne(e,t){return{kind:`schema`,type:`picklist`,reference:ne,expects:B(e.map(I),`|`),async:!1,options:e,message:t,get"~standard"(){return R(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:L(this,`type`,e,t),e}}}function re(e,t,n){return{kind:`schema`,type:`record`,reference:re,expects:`Object`,async:!1,key:e,value:t,message:n,get"~standard"(){return R(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){for(let r in e.typed=!0,e.value={},n)if(z(n,r)){let i=n[r],a=this.key[`~run`]({value:r},t);if(a.issues){let o={type:`object`,origin:`key`,input:n,key:r,value:i};for(let t of a.issues)t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}let o=this.value[`~run`]({value:i},t);if(o.issues){let a={type:`object`,origin:`value`,input:n,key:r,value:i};for(let t of o.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}(!a.typed||!o.typed)&&(e.typed=!1),a.typed&&(e.value[a.value]=o.value)}}else L(this,`type`,e,t);return e}}}function Z(e){return{kind:`schema`,type:`string`,reference:Z,expects:`string`,async:!1,message:e,get"~standard"(){return R(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:L(this,`type`,e,t),e}}}function ie(e,t,n){let r=e[`~run`]({value:t},M(n));if(r.issues)throw new V(r.issues);return r.value}function ae(...e){return{...e[0],pipe:e,get"~standard"(){return R(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}function oe(e,t,n){let r=e[`~run`]({value:t},M(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}const se=ie(Y({MODE:Z(),DEV:J(),PROD:J(),PRISMIC_SENTRY_DSN:X(Z()),PRISMIC_SENTRY_ENVIRONMENT:X(Z()),PRISMIC_SENTRY_ENABLED:X(ae(ne([`true`,`false`]),U(e=>e===`true`))),PRISMIC_HOST:X(Z(),`prismic.io`)}),{MODE:`production`,DEV:!1,PROD:!0,...process.env});async function ce(e,t={}){let{credentials:n,...r}=t,i=new Headers(t.headers);if(i.has(`Accept`)||i.set(`Accept`,`application/json`),i.has(`User-Agent`)||i.set(`User-Agent`,`prismic-cli`),n){let e=[];for(let t in n)e.push(`${t}=${n[t]??``}`);i.set(`Cookie`,e.join(`; `))}!i.has(`Content-Type`)&&t.body&&i.set(`Content-Type`,`application/json`),t.body instanceof FormData&&i.delete(`Content-Type`);let a=i.get(`Content-Type`)===`application/json`?JSON.stringify(t.body):t.body,o=await fetch(e,{...r,body:a,headers:i}),s=await o.clone().json().catch(()=>o.clone().text());if(o.ok)return t.schema?ie(t.schema,s):s;throw o.status===401?new pe(o):o.status===403?new fe(o):o.status===404?new de(o):new ue(o)}var le=class extends Error{name=`RequestError`;response;constructor(e){super(`fetch failed: ${e.url}`),this.response=e}async text(){return this.response.clone().text()}async json(){return this.response.clone().json()}get status(){return this.response.status}get statusText(){return this.response.statusText}},ue=class extends le{name=`UnknownRequestError`},de=class extends le{name=`NotFoundRequestError`},fe=class extends le{name=`ForbiddenRequestError`},pe=class extends le{name=`UnauthorizedRequestError`};const me=/([\p{Ll}\d])(\p{Lu})/gu,he=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ge=/(\d)\p{Ll}|(\p{L})\d/u,_e=/[^\p{L}\d]+/giu,ve=`$1\0$2`;function ye(e){let t=e.trim();t=t.replace(me,ve).replace(he,ve),t=t.replace(_e,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function be(e){let t=ye(e);for(let e=0;e<t.length;e++){let n=t[e],r=ge.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function xe(e,t){let[n,r,i]=Ee(e,t),a=Se(t?.locale),o=Ce(t?.locale),s=t?.mergeAmbiguousCharacters?we(a,o):Te(a,o);return n+r.map(s).join(t?.delimiter??``)+i}function Se(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function Ce(e){return e===!1?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function we(e,t){return n=>`${t(n[0])}${e(n.slice(1))}`}function Te(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function Ee(e,t={}){let n=t.split??(t.separateNumbers?be:ye),r=t.prefixCharacters??``,i=t.suffixCharacters??``,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var De=b(import.meta.url);function Oe(e){let t=h(e);return t.length>1&&t[t.length-1]===v&&(t=t.substring(0,t.length-1)),t}const ke=/[\\/]/g;function Ae(e,t){return e.replace(ke,t)}const je=/^[a-z]:[\\/]$/i;function Me(e){return e===`/`||je.test(e)}function Ne(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=_(e)),(r||a)&&(e=Oe(e)),e===`.`?``:Ae(e[e.length-1]===i?e:e+i,i)}function Pe(e,t){return t+e}function Fe(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:Ae(ee(e,r),t.pathSeparator)+t.pathSeparator+n}}function Ie(e){return e}function Le(e,t,n){return t+e+n}function Re(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?Fe(e,t):r?Pe:Ie}function ze(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function Be(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const Ve=(e,t)=>{t.push(e||`.`)},He=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},Ue=()=>{};function We(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?Be(e):ze(e):r&&r.length?He:Ve:Ue}const Ge=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},Ke=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},qe=(e,t,n,r)=>{n.files++},Je=(e,t)=>{t.push(e)},Ye=()=>{};function Xe(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?Ye:n&&n.length?r?Ge:Ke:r?qe:Je}const Ze=e=>e,Qe=()=>[``].slice(0,0);function $e(e){return e.group?Qe:Ze}const et=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},tt=()=>{};function nt(e){return e.group?et:tt}const rt=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue(),i.realpath(e,(o,s)=>{if(o)return r.dequeue(a?null:o,t);i.stat(s,(i,o)=>{if(i)return r.dequeue(a?null:i,t);if(o.isDirectory()&&ot(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},it=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue();try{let r=i.realpathSync(e),a=i.statSync(r);if(a.isDirectory()&&ot(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function at(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?it:rt}function ot(e,t,n){if(n.options.useRealPaths)return st(t,n);let r=m(e),i=1;for(;r!==n.root&&i<2;){let e=n.symlinks.get(r);e&&(e===t||e.startsWith(t)||t.startsWith(e))?i++:r=m(r)}return n.symlinks.set(e,t),i>1}function st(e,t){return t.visited.includes(e+t.options.pathSeparator)}const ct=e=>e.counts,lt=e=>e.groups,ut=e=>e.paths,dt=e=>e.paths.slice(0,e.options.maxFiles),ft=(e,t,n)=>(gt(t,n,e.counts,e.options.suppressErrors),null),pt=(e,t,n)=>(gt(t,n,e.paths,e.options.suppressErrors),null),mt=(e,t,n)=>(gt(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),ht=(e,t,n)=>(gt(t,n,e.groups,e.options.suppressErrors),null);function gt(e,t,n,r){t(e&&!r?e:null,n)}function _t(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?ct:ft:r?t?lt:ht:i?t?dt:mt:t?ut:pt}const vt={withFileTypes:!0},yt=(e,t,n,r,i)=>{if(e.queue.enqueue(),r<0)return e.queue.dequeue(null,e);let{fs:a}=e;e.visited.push(t),e.counts.directories++,a.readdir(t||`.`,vt,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},bt=(e,t,n,r,i)=>{let{fs:a}=e;if(r<0)return;e.visited.push(t),e.counts.directories++;let o=[];try{o=a.readdirSync(t||`.`,vt)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function xt(e){return e?bt:yt}var St=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},Ct=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}},wt=class{aborted=!1;abort(){this.aborted=!0}},Tt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=_t(t,this.isSynchronous),this.root=Ne(e,t),this.state={root:Me(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new Ct,options:t,queue:new St((e,t)=>this.callbackInvoker(t,e,n)),symlinks:new Map,visited:[``].slice(0,0),controller:new wt,fs:t.fs||u},this.joinPath=Re(this.root,t),this.pushDirectory=We(this.root,t),this.pushFile=Xe(t),this.getArray=$e(t),this.groupFiles=nt(t),this.resolveSymlink=at(t,this.isSynchronous),this.walkDirectory=xt(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,n)=>{let{paths:r,options:{filters:i,resolveSymlinks:a,excludeSymlinks:o,exclude:s,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&r.length>c)return;let h=this.getArray(this.state.paths);for(let c=0;c<e.length;++c){let l=e[c];if(l.isFile()||l.isSymbolicLink()&&!a&&!o){let e=this.joinPath(l.name,t);this.pushFile(e,h,this.state.counts,i)}else if(l.isDirectory()){let e=Le(l.name,t,this.state.options.pathSeparator);if(s&&s(l.name,e))continue;this.pushDirectory(e,r,i),this.walkDirectory(this.state,e,e,n-1,this.walk)}else if(this.resolveSymlink&&l.isSymbolicLink()){let e=Pe(l.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=Ne(r,this.state.options),s&&s(l.name,u?r:e+d))return;this.walkDirectory(this.state,r,u?r:e+d,n-1,this.walk)}else{r=u?r:e;let t=p(r),n=Ne(m(r),this.state.options);r=this.joinPath(t,n),this.pushFile(r,h,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,h)}};function Et(e,t){return new Promise((n,r)=>{Dt(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function Dt(e,t,n){new Tt(e,t,n).start()}function Ot(e,t){return new Tt(e,t).start()}var kt=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return Et(this.root,this.options)}withCallback(e){Dt(this.root,this.options,e)}sync(){return Ot(this.root,this.options)}};let At=null;try{De.resolve(`picomatch`),At=De(`picomatch`)}catch{}var jt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:v,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new kt(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new kt(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||At;if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}},Mt=k(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),Nt=k((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=Mt();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),Pt=k(((e,t)=>{let n=Nt(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:ee}=Mt(),_=e=>e===l||e===a,v=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let y=t||{},b=e.length-1,x=y.parts===!0||y.scanToEnd===!0,S=[],C=[],w=[],T=e,E=-1,D=0,O=0,k=!1,te=!1,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=0,z,B,V={value:``,depth:0,isGlob:!1},H=()=>E>=b,U=()=>T.charCodeAt(E+1),W=()=>(z=B,T.charCodeAt(++E));for(;E<b;){B=W();let e;if(B===a){P=V.backslashes=!0,B=W(),B===u&&(N=!0);continue}if(N===!0||B===u){for(R++;H()!==!0&&(B=W());){if(B===a){P=V.backslashes=!0,W();continue}if(B===u){R++;continue}if(N!==!0&&B===s&&(B=W())===s){if(k=V.isBrace=!0,A=V.isGlob=!0,L=!0,x===!0)continue;break}if(N!==!0&&B===o){if(k=V.isBrace=!0,A=V.isGlob=!0,L=!0,x===!0)continue;break}if(B===h&&(R--,R===0)){N=!1,k=V.isBrace=!0,L=!0;break}}if(x===!0)continue;break}if(B===l){if(S.push(E),C.push(V),V={value:``,depth:0,isGlob:!1},L===!0)continue;if(z===s&&E===D+1){D+=2;continue}O=E+1;continue}if(y.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&U()===d){if(A=V.isGlob=!0,j=V.isExtglob=!0,L=!0,B===c&&E===D&&(I=!0),x===!0){for(;H()!==!0&&(B=W());){if(B===a){P=V.backslashes=!0,B=W();continue}if(B===g){A=V.isGlob=!0,L=!0;break}}continue}break}if(B===r){if(z===r&&(M=V.isGlobstar=!0),A=V.isGlob=!0,L=!0,x===!0)continue;break}if(B===m){if(A=V.isGlob=!0,L=!0,x===!0)continue;break}if(B===f){for(;H()!==!0&&(e=W());){if(e===a){P=V.backslashes=!0,W();continue}if(e===ee){te=V.isBracket=!0,A=V.isGlob=!0,L=!0;break}}if(x===!0)continue;break}if(y.nonegate!==!0&&B===c&&E===D){F=V.negated=!0,D++;continue}if(y.noparen!==!0&&B===d){if(A=V.isGlob=!0,x===!0){for(;H()!==!0&&(B=W());){if(B===d){P=V.backslashes=!0,B=W();continue}if(B===g){L=!0;break}}continue}break}if(A===!0){if(L=!0,x===!0)continue;break}}y.noext===!0&&(j=!1,A=!1);let G=T,K=``,q=``;D>0&&(K=T.slice(0,D),T=T.slice(D),O-=D),G&&A===!0&&O>0?(G=T.slice(0,O),q=T.slice(O)):A===!0?(G=``,q=T):G=T,G&&G!==``&&G!==`/`&&G!==T&&_(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),y.unescape===!0&&(q&&=n.removeBackslashes(q),G&&P===!0&&(G=n.removeBackslashes(G)));let J={prefix:K,input:e,start:D,base:G,glob:q,isBrace:k,isBracket:te,isGlob:A,isExtglob:j,isGlobstar:M,negated:F,negatedExtglob:I};if(y.tokens===!0&&(J.maxDepth=0,_(B)||C.push(V),J.tokens=C),y.parts===!0||y.tokens===!0){let t;for(let n=0;n<S.length;n++){let r=t?t+1:D,i=S[n],a=e.slice(r,i);y.tokens&&(n===0&&D!==0?(C[n].isPrefix=!0,C[n].value=K):C[n].value=a,v(C[n]),J.maxDepth+=C[n].depth),(n!==0||a!==``)&&w.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);w.push(n),y.tokens&&(C[C.length-1].value=n,v(C[C.length-1]),J.maxDepth+=C[C.length-1].depth)}J.slashes=S,J.parts=w}return J}})),Ft=k(((e,t)=>{let n=Mt(),r=Nt(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let f={...t},p=typeof f.maxLength==`number`?Math.min(i,f.maxLength):i,m=e.length;if(m>p)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`);let h={type:`bos`,value:``,output:f.prepend||``},g=[h],ee=f.capture?``:`?:`,_=n.globChars(f.windows),v=n.extglobChars(_),{DOT_LITERAL:y,PLUS_LITERAL:b,SLASH_LITERAL:x,ONE_CHAR:S,DOTS_SLASH:C,NO_DOT:w,NO_DOT_SLASH:T,NO_DOTS_SLASH:E,QMARK:D,QMARK_NO_DOT:O,STAR:k,START_ANCHOR:te}=_,A=e=>`(${ee}(?:(?!${te}${e.dot?C:y}).)*?)`,j=f.dot?``:w,M=f.dot?D:O,N=f.bash===!0?A(f):k;f.capture&&(N=`(${N})`),typeof f.noext==`boolean`&&(f.noextglob=f.noext);let P={input:e,index:-1,start:0,dot:f.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};e=r.removePrefix(e,P),m=e.length;let F=[],I=[],L=[],R=h,z,B=()=>P.index===m-1,V=P.peek=(t=1)=>e[P.index+t],H=P.advance=()=>e[++P.index]||``,U=()=>e.slice(P.index+1),W=(e=``,t=0)=>{P.consumed+=e,P.index+=t},G=e=>{P.output+=e.output==null?e.value:e.output,W(e.value)},K=()=>{let e=1;for(;V()===`!`&&(V(2)!==`(`||V(3)===`?`);)H(),P.start++,e++;return e%2==0?!1:(P.negated=!0,P.start++,!0)},q=e=>{P[e]++,L.push(e)},J=e=>{P[e]--,L.pop()},Y=e=>{if(R.type===`globstar`){let t=P.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||F.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(P.output=P.output.slice(0,-R.output.length),R.type=`star`,R.value=`*`,R.output=N,P.output+=R.output)}if(F.length&&e.type!==`paren`&&(F[F.length-1].inner+=e.value),(e.value||e.output)&&G(e),R&&R.type===`text`&&e.type===`text`){R.output=(R.output||R.value)+e.value,R.value+=e.value;return}e.prev=R,g.push(e),R=e},X=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=R,n.parens=P.parens,n.output=P.output;let r=(f.capture?`(`:``)+n.open;q(`parens`),Y({type:e,value:t,output:P.output?``:S}),Y({type:`paren`,extglob:!0,value:H(),output:r}),F.push(n)},ne=e=>{let n=e.close+(f.capture?`)`:``),r;if(e.type===`negate`){let i=N;e.inner&&e.inner.length>1&&e.inner.includes(`/`)&&(i=A(f)),(i!==N||B()||/^\)+$/.test(U()))&&(n=e.close=`)$))${i}`),e.inner.includes(`*`)&&(r=U())&&/^\.[^\\/.]+$/.test(r)&&(n=e.close=`)${d(r,{...t,fastpaths:!1}).output})${i})`),e.prev.type===`bos`&&(P.negatedExtglob=!0)}Y({type:`paren`,extglob:!0,value:z,output:n}),J(`parens`)};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?D.repeat(a.length):``):o===0?M+(a?D.repeat(a.length):``):D.repeat(r.length):i===`.`?y.repeat(r.length):i===`*`?t?t+i+(a?N:``):N:t?e:`\\${e}`);return n===!0&&(i=f.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&f.contains===!0?(P.output=e,P):(P.output=r.wrapOutput(i,P,t),P)}for(;!B();){if(z=H(),z===`\0`)continue;if(z===`\\`){let e=V();if(e===`/`&&f.bash!==!0||e===`.`||e===`;`)continue;if(!e){z+=`\\`,Y({type:`text`,value:z});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,P.index+=n,n%2!=0&&(z+=`\\`)),f.unescape===!0?z=H():z+=H(),P.brackets===0){Y({type:`text`,value:z});continue}}if(P.brackets>0&&(z!==`]`||R.value===`[`||R.value===`[^`)){if(f.posix!==!1&&z===`:`){let e=R.value.slice(1);if(e.includes(`[`)&&(R.posix=!0,e.includes(`:`))){let e=R.value.lastIndexOf(`[`),t=R.value.slice(0,e),n=a[R.value.slice(e+2)];if(n){R.value=t+n,P.backtrack=!0,H(),!h.output&&g.indexOf(R)===1&&(h.output=S);continue}}}(z===`[`&&V()!==`:`||z===`-`&&V()===`]`)&&(z=`\\${z}`),z===`]`&&(R.value===`[`||R.value===`[^`)&&(z=`\\${z}`),f.posix===!0&&z===`!`&&R.value===`[`&&(z=`^`),R.value+=z,G({value:z});continue}if(P.quotes===1&&z!==`"`){z=r.escapeRegex(z),R.value+=z,G({value:z});continue}if(z===`"`){P.quotes=P.quotes===1?0:1,f.keepQuotes===!0&&Y({type:`text`,value:z});continue}if(z===`(`){q(`parens`),Y({type:`paren`,value:z});continue}if(z===`)`){if(P.parens===0&&f.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=F[F.length-1];if(e&&P.parens===e.parens+1){ne(F.pop());continue}Y({type:`paren`,value:z,output:P.parens?`)`:`\\)`}),J(`parens`);continue}if(z===`[`){if(f.nobracket===!0||!U().includes(`]`)){if(f.nobracket!==!0&&f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));z=`\\${z}`}else q(`brackets`);Y({type:`bracket`,value:z});continue}if(z===`]`){if(f.nobracket===!0||R&&R.type===`bracket`&&R.value.length===1){Y({type:`text`,value:z,output:`\\${z}`});continue}if(P.brackets===0){if(f.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));Y({type:`text`,value:z,output:`\\${z}`});continue}J(`brackets`);let e=R.value.slice(1);if(R.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(z=`/${z}`),R.value+=z,G({value:z}),f.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(R.value);if(P.output=P.output.slice(0,-R.value.length),f.literalBrackets===!0){P.output+=t,R.value=t;continue}R.value=`(${ee}${t}|${R.value})`,P.output+=R.value;continue}if(z===`{`&&f.nobrace!==!0){q(`braces`);let e={type:`brace`,value:z,output:`(`,outputIndex:P.output.length,tokensIndex:P.tokens.length};I.push(e),Y(e);continue}if(z===`}`){let e=I[I.length-1];if(f.nobrace===!0||!e){Y({type:`text`,value:z,output:z});continue}let t=`)`;if(e.dots===!0){let e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,f),P.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=P.output.slice(0,e.outputIndex),r=P.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,z=t=`\\}`,P.output=n;for(let e of r)P.output+=e.output||e.value}Y({type:`brace`,value:z,output:t}),J(`braces`),I.pop();continue}if(z===`|`){F.length>0&&F[F.length-1].conditions++,Y({type:`text`,value:z});continue}if(z===`,`){let e=z,t=I[I.length-1];t&&L[L.length-1]===`braces`&&(t.comma=!0,e=`|`),Y({type:`comma`,value:z,output:e});continue}if(z===`/`){if(R.type===`dot`&&P.index===P.start+1){P.start=P.index+1,P.consumed=``,P.output=``,g.pop(),R=h;continue}Y({type:`slash`,value:z,output:x});continue}if(z===`.`){if(P.braces>0&&R.type===`dot`){R.value===`.`&&(R.output=y);let e=I[I.length-1];R.type=`dots`,R.output+=z,R.value+=z,e.dots=!0;continue}if(P.braces+P.parens===0&&R.type!==`bos`&&R.type!==`slash`){Y({type:`text`,value:z,output:y});continue}Y({type:`dot`,value:z,output:y});continue}if(z===`?`){if(!(R&&R.value===`(`)&&f.noextglob!==!0&&V()===`(`&&V(2)!==`?`){X(`qmark`,z);continue}if(R&&R.type===`paren`){let e=V(),t=z;(R.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(U()))&&(t=`\\${z}`),Y({type:`text`,value:z,output:t});continue}if(f.dot!==!0&&(R.type===`slash`||R.type===`bos`)){Y({type:`qmark`,value:z,output:O});continue}Y({type:`qmark`,value:z,output:D});continue}if(z===`!`){if(f.noextglob!==!0&&V()===`(`&&(V(2)!==`?`||!/[!=<:]/.test(V(3)))){X(`negate`,z);continue}if(f.nonegate!==!0&&P.index===0){K();continue}}if(z===`+`){if(f.noextglob!==!0&&V()===`(`&&V(2)!==`?`){X(`plus`,z);continue}if(R&&R.value===`(`||f.regex===!1){Y({type:`plus`,value:z,output:b});continue}if(R&&(R.type===`bracket`||R.type===`paren`||R.type===`brace`)||P.parens>0){Y({type:`plus`,value:z});continue}Y({type:`plus`,value:b});continue}if(z===`@`){if(f.noextglob!==!0&&V()===`(`&&V(2)!==`?`){Y({type:`at`,extglob:!0,value:z,output:``});continue}Y({type:`text`,value:z});continue}if(z!==`*`){(z===`$`||z===`^`)&&(z=`\\${z}`);let e=o.exec(U());e&&(z+=e[0],P.index+=e[0].length),Y({type:`text`,value:z});continue}if(R&&(R.type===`globstar`||R.star===!0)){R.type=`star`,R.star=!0,R.value+=z,R.output=N,P.backtrack=!0,P.globstar=!0,W(z);continue}let t=U();if(f.noextglob!==!0&&/^\([^?]/.test(t)){X(`star`,z);continue}if(R.type===`star`){if(f.noglobstar===!0){W(z);continue}let n=R.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(f.bash===!0&&(!i||t[0]&&t[0]!==`/`)){Y({type:`star`,value:z,output:``});continue}let o=P.braces>0&&(n.type===`comma`||n.type===`brace`),s=F.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){Y({type:`star`,value:z,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[P.index+4];if(n&&n!==`/`)break;t=t.slice(3),W(`/**`,3)}if(n.type===`bos`&&B()){R.type=`globstar`,R.value+=z,R.output=A(f),P.output=R.output,P.globstar=!0,W(z);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&B()){P.output=P.output.slice(0,-(n.output+R.output).length),n.output=`(?:${n.output}`,R.type=`globstar`,R.output=A(f)+(f.strictSlashes?`)`:`|$)`),R.value+=z,P.globstar=!0,P.output+=n.output+R.output,W(z);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;P.output=P.output.slice(0,-(n.output+R.output).length),n.output=`(?:${n.output}`,R.type=`globstar`,R.output=`${A(f)}${x}|${x}${e})`,R.value+=z,P.output+=n.output+R.output,P.globstar=!0,W(z+H()),Y({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){R.type=`globstar`,R.value+=z,R.output=`(?:^|${x}|${A(f)}${x})`,P.output=R.output,P.globstar=!0,W(z+H()),Y({type:`slash`,value:`/`,output:``});continue}P.output=P.output.slice(0,-R.output.length),R.type=`globstar`,R.output=A(f),R.value+=z,P.output+=R.output,P.globstar=!0,W(z);continue}let n={type:`star`,value:z,output:N};if(f.bash===!0){n.output=`.*?`,(R.type===`bos`||R.type===`slash`)&&(n.output=j+n.output),Y(n);continue}if(R&&(R.type===`bracket`||R.type===`paren`)&&f.regex===!0){n.output=z,Y(n);continue}(P.index===P.start||R.type===`slash`||R.type===`dot`)&&(R.type===`dot`?(P.output+=T,R.output+=T):f.dot===!0?(P.output+=E,R.output+=E):(P.output+=j,R.output+=j),V()!==`*`&&(P.output+=S,R.output+=S)),Y(n)}for(;P.brackets>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));P.output=r.escapeLast(P.output,`[`),J(`brackets`)}for(;P.parens>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));P.output=r.escapeLast(P.output,`(`),J(`parens`)}for(;P.braces>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));P.output=r.escapeLast(P.output,`{`),J(`braces`)}if(f.strictSlashes!==!0&&(R.type===`star`||R.type===`bracket`)&&Y({type:`maybe_slash`,value:``,output:`${x}?`}),P.backtrack===!0){P.output=``;for(let e of P.tokens)P.output+=e.output==null?e.value:e.output,e.suffix&&(P.output+=e.suffix)}return P};d.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:ee}=n.globChars(a.windows),_=a.dot?m:p,v=a.dot?h:p,y=a.capture?``:`?:`,b={negated:!1,prefix:``},x=a.bash===!0?`.*?`:g;a.capture&&(x=`(${x})`);let S=e=>e.noglobstar===!0?x:`(${y}(?:(?!${ee}${e.dot?f:l}).)*?)`,C=e=>{switch(e){case`*`:return`${_}${d}${x}`;case`.*`:return`${l}${d}${x}`;case`*.*`:return`${_}${x}${l}${d}${x}`;case`*/*`:return`${_}${x}${u}${d}${v}${x}`;case`**`:return _+S(a);case`**/*`:return`(?:${_}${S(a)}${u})?${v}${d}${x}`;case`**/*.*`:return`(?:${_}${S(a)}${u})?${v}${x}${l}${d}${x}`;case`**/.*`:return`(?:${_}${S(a)}${u})?${l}${d}${x}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=C(t[1]);return n?n+l+t[2]:void 0}}},w=C(r.removePrefix(e,b));return w&&a.strictSlashes!==!0&&(w+=`${u}?`),w},t.exports=d})),It=k(((e,t)=>{let n=Pt(),r=Ft(),i=Nt(),a=Mt(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),Lt=A(k(((e,t)=>{let n=It(),r=Nt();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);const Rt=Array.isArray,zt=process.platform===`win32`,Bt=/^(\/?\.\.)+$/;function Vt(e,t={}){let n=e.length,r=Array(n),i=Array(n),a=!t.noglobstar;for(let a=0;a<n;a++){let n=qt(e[a]);r[a]=n;let o=n.length,s=Array(o);for(let e=0;e<o;e++)s[e]=(0,Lt.default)(n[e],t);i[a]=s}return t=>{let n=t.split(`/`);if(n[0]===`..`&&Bt.test(t))return!0;for(let t=0;t<e.length;t++){let e=r[t],o=i[t],s=n.length,c=Math.min(s,e.length),l=0;for(;l<c;){let t=e[l];if(t.includes(`/`))return!0;if(!o[l](n[l]))break;if(a&&t===`**`)return!0;l++}if(l===s)return!0}return!1}}const Ht=/^[A-Z]:\/$/i,Ut=zt?e=>Ht.test(e):e=>e===`/`;function Wt(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=Ut(e)?e.length:e.length+1;return(e,n)=>e.slice(t,n?-1:void 0)||`.`}let r=t.slice(e.length+1);return r?(e,t)=>{if(e===`.`)return r;let n=`${r}/${e}`;return t?n.slice(0,-1):n}:(e,t)=>t&&e!==`.`?e.slice(0,-1):e}return n?t=>g.relative(e,t)||`.`:n=>g.relative(e,`${t}/${n}`)||`.`}function Gt(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=g.relative(e,`${t}/${n}`);return n.endsWith(`/`)&&r!==``?`${r}/`:r||`.`}}const Kt={parts:!0};function qt(e){let t=Lt.default.scan(e,Kt);return t.parts?.length?t.parts:[e]}const Jt=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Yt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Xt=zt?e=>e.replace(Yt,`\\$&`):e=>e.replace(Jt,`\\$&`);function Zt(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=Lt.default.scan(e);return n.isGlob||n.negated}function Qt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString(`es`)}]`,...e)}const $t=/^(\/?\.\.)+/,en=/\\(?=[()[\]{}!*+?@|])/g,tn=/\\/g;function nn(e,t,n,r,i){let a=e;e.endsWith(`/`)&&(a=e.slice(0,-1)),!a.endsWith(`*`)&&t&&(a+=`/**`);let o=Xt(n);a=f.isAbsolute(a.replace(en,``))?g.relative(o,a):g.normalize(a);let s=$t.exec(a),c=qt(a);if(s?.[0]){let e=(s[0].length+1)/3,t=0,i=o.split(`/`);for(;t<e&&c[t+e]===i[i.length+t-e];)a=a.slice(0,(e-t-1)*3)+a.slice((e-t)*3+c[t+e].length+1)||`.`,t++;let l=g.join(n,s[0].slice(t*3));!l.startsWith(`.`)&&r.root.length>l.length&&(r.root=l,r.depthOffset=-e+t)}if(!i&&r.depthOffset>=0){r.commonPath??=c;let e=[],t=Math.min(r.commonPath.length,c.length);for(let n=0;n<t;n++){let t=c[n];if(t===`**`&&!c[n+1]){e.pop();break}if(t!==r.commonPath[n]||Zt(t)||n===c.length-1)break;e.push(t)}r.depthOffset=e.length,r.commonPath=e,r.root=e.length>0?g.join(n,...e):n}return a}function rn({patterns:e=[`**/*`],ignore:t=[],expandDirectories:n=!0},r,i){typeof e==`string`&&(e=[e]),typeof t==`string`&&(t=[t]);let a=[],o=[];for(let e of t)e&&(e[0]!==`!`||e[1]===`(`)&&o.push(nn(e,n,r,i,!0));for(let t of e)t&&(t[0]!==`!`||t[1]===`(`?a.push(nn(t,n,r,i,!1)):(t[1]!==`!`||t[2]===`(`)&&o.push(nn(t.slice(1),n,r,i,!0)));return{match:a,ignore:o}}function an(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];e[n]=t(r)}return e}function on(e){return e?e instanceof URL?y(e).replace(tn,`/`):f.resolve(e).replace(tn,`/`):process.cwd().replace(tn,`/`)}function sn(e,t={}){let n=process.env.TINYGLOBBY_DEBUG?{...t,debug:!0}:t,r=on(n.cwd);if(n.debug&&Qt(`globbing with:`,{patterns:e,options:n,cwd:r}),Array.isArray(e)&&e.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let i={root:r,commonPath:null,depthOffset:0},a=rn({...n,patterns:e},r,i);n.debug&&Qt(`internal processing patterns:`,a);let o={dot:n.dot,nobrace:n.braceExpansion===!1,nocase:n.caseSensitiveMatch===!1,noextglob:n.extglob===!1,noglobstar:n.globstar===!1,posix:!0},s=(0,Lt.default)(a.match,{...o,ignore:a.ignore}),c=(0,Lt.default)(a.ignore,o),l=Vt(a.match,o),u=Wt(r,i.root,n.absolute),f=n.absolute?u:Wt(r,i.root,!0),p={filters:[n.debug?(e,t)=>{let n=u(e,t),r=s(n);return r&&Qt(`matched ${n}`),r}:(e,t)=>s(u(e,t))],exclude:n.debug?(e,t)=>{let n=f(t,!0),r=n!==`.`&&!l(n)||c(n);return Qt(r?`skipped ${t}`:`crawling ${t}`),r}:(e,t)=>{let n=f(t,!0);return n!==`.`&&!l(n)||c(n)},fs:n.fs?{readdir:n.fs.readdir||d.readdir,readdirSync:n.fs.readdirSync||d.readdirSync,realpath:n.fs.realpath||d.realpath,realpathSync:n.fs.realpathSync||d.realpathSync,stat:n.fs.stat||d.stat,statSync:n.fs.statSync||d.statSync}:void 0,pathSeparator:`/`,relativePaths:!0,resolveSymlinks:!0,signal:n.signal};n.deep!==void 0&&(p.maxDepth=Math.round(n.deep-i.depthOffset)),n.absolute&&(p.relativePaths=!1,p.resolvePaths=!0,p.includeBasePath=!0),n.followSymbolicLinks===!1&&(p.resolveSymlinks=!1,p.excludeSymlinks=!0),n.onlyDirectories?(p.excludeFiles=!0,p.includeDirs=!0):n.onlyFiles===!1&&(p.includeDirs=!0),i.root=i.root.replace(tn,``);let m=i.root;n.debug&&Qt(`internal properties:`,i);let h=r!==m&&!n.absolute&&Gt(r,i.root);return[new jt(p).crawl(m),h]}async function cn(e,t){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=Rt(e)||typeof e==`string`,r=n?t:e,[i,a]=sn(n?e:e.patterns,r);return a?an(await i.withPromise(),a):i.withPromise()}async function ln(e,t){let{host:n}=t,r=un(n),i=new URL(`refreshtoken`,r);return i.searchParams.set(`token`,e),await ce(i,{schema:Z()})}function un(e=se.PRISMIC_HOST){return new URL(`https://auth.${e}/`)}function dn(e){return JSON.stringify(e,null,2)}const fn=new URL(`.prismic`,Sn(l(S()))),pn=Y({token:X(ae(Z(),H())),host:X(ae(Z(),H()))});async function mn(){return(await vn())?.token}async function hn(){return(await vn())?.host}async function gn(){let e=await vn(),t=e?.token,n=e?.host;if(!t)return;let r=await ln(t,{host:n});return await yn({token:r,host:n}),r}async function _n(){if(!await Cn(fn))return!0;try{return await a(fn,{force:!0}),!0}catch{return!1}}async function vn(){try{let e=await r(fn,`utf-8`);return ie(pn,JSON.parse(e))}catch{return}}async function yn(e){await o(fn,dn(e))}async function bn(e){let t=se.PRISMIC_HOST,n=`https://${t}`;return new Promise((r,i)=>{let a=x((e,i)=>{if(e.method===`OPTIONS`){i.writeHead(204,{"Access-Control-Allow-Origin":n,"Access-Control-Allow-Methods":`POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`}),i.end();return}if(e.method===`POST`){let s=``;e.on(`data`,e=>{s+=e.toString()}),e.on(`end`,async()=>{try{let{cookies:e,email:c}=JSON.parse(s),l=e.find(e=>e.startsWith(`prismic-auth=`))?.split(`;`)[0]?.replace(/^prismic-auth=/,``);if(!l){i.writeHead(400,{"Access-Control-Allow-Origin":n,"Content-Type":`application/json`}),i.end(JSON.stringify({error:`Invalid request`}));return}await yn({token:l,host:t}),i.writeHead(200,{"Access-Control-Allow-Origin":n,"Content-Type":`application/json`}),i.end(JSON.stringify({success:!0})),clearTimeout(o),a.close(),r({email:c})}catch{i.writeHead(400,{"Access-Control-Allow-Origin":n,"Content-Type":`application/json`}),i.end(JSON.stringify({error:`Invalid request`}))}});return}i.writeHead(404),i.end()}),o=setTimeout(()=>{a.close(),i(Error(`Login timed out. Please try again.`))},18e4),s=async()=>{let n=a.address();if(!n||typeof n==`string`){clearTimeout(o),a.close(),i(Error(`Failed to start login server`));return}let r=await xn(t,n.port);e?.onReady?.(r)};a.on(`error`,e=>{e.code===`EADDRINUSE`&&a.listening===!1?a.listen(0,`0.0.0.0`,s):(clearTimeout(o),i(e))}),a.listen(5555,`0.0.0.0`,s)})}async function xn(e,t){let n=new URL(`dashboard/cli/login`,`https://${e}/`);return n.searchParams.set(`source`,`prismic-cli`),n.searchParams.set(`port`,t.toString()),n}function Sn(e){let t=new URL(e);return t.pathname.endsWith(`/`)||(t.pathname+=`/`),t}async function Q(e,n={}){let{start:r=l(process.cwd()),stop:i}=n,a=Sn(r);for(;;){let n=new URL(e,a);try{return await t(n),n}catch{}if(typeof i==`string`){let e=new URL(i,a);try{await t(e);return}catch{}}else if(i instanceof URL&&i.href===a.href)return;let r=new URL(`..`,a);if(r.href===a.href)return;a=r}}async function Cn(e){try{return await t(e),!0}catch{return!1}}const wn=`prismic.config.json`,Tn=Y({repositoryName:Z(),apiEndpoint:X(ae(Z(),W())),localSliceMachineSimulatorURL:X(ae(Z(),W())),libraries:X(q(Z())),adapter:X(Z()),labs:X(Y({legacySliceUpgrader:X(J())}))});async function En(e,t=l(process.cwd())){let n=await Mn(t);return n.ok?(await o(n.path,dn(e)),{ok:!0,config:e}):n}async function Dn(e=l(process.cwd())){let t=await On(e);if(t.ok)return t.config.repositoryName}async function On(e=l(process.cwd())){let t=await jn(e);if(!t.ok)return t;try{let e=await r(t.path,`utf8`),n=oe(Tn,JSON.parse(e));return n.success?{ok:!0,config:n.output}:{ok:!1,error:new kn(n.issues)}}catch{return{ok:!1,error:new kn}}}var kn=class extends Error{issues;constructor(e=[]){super(`prismic.config.json is invalid.`),this.issues=e}};async function An(e,t=l(process.cwd())){let n=await jn(t);if(!n.ok)return n;let r=await On(t);if(!r.ok)return r;let i={...r.config,...e};return await o(n.path,dn(i)),{ok:!0,config:i}}async function jn(e=l(process.cwd())){let t=await Q(wn,{start:e,stop:`package.json`});return t?{ok:!0,path:t}:{ok:!1,error:new Nn}}async function Mn(e=l(process.cwd())){let t=await Q(`package.json`,{start:e});return t?{ok:!0,path:new URL(wn,t)}:{ok:!1,error:new Pn}}var Nn=class extends Error{message=`Could not find a prismic.config.json file.`},Pn=class extends Error{message=`Could not find a package.json file.`};const Fn=/^(?:( )+|\t+)/,$=`space`;function In(e,t,n){return e&&t===$&&n===1}function Ln(e,t){let n=new Map,r=0,i,a;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(Fn);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?$:`tab`;if(In(t,s,o))continue;s!==i&&(r=0),i=s;let c=1,l=0,u=o-r;if(r=o,u===0)c=0,l=1;else{let e=Math.abs(u);if(In(t,s,e))continue;a=Rn(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function Rn(e,t){return(e===$?`s`:`t`)+String(t)}function zn(e){return{type:e[0]===`s`?$:`tab`,amount:Number(e.slice(1))}}function Bn(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function Vn(e,t){return(e===$?` `:` `).repeat(t)}function Hn(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=Ln(e,!0);t.size===0&&(t=Ln(e,!1));let n=Bn(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=zn(n),a=Vn(r,i)),{amount:i,type:r,indent:a}}async function Un(e){let t=await Q(`package.json`);if(!t)throw Error(`No package.json found`);let n=await r(t,`utf8`),i=Hn(n).indent||` `,a=JSON.parse(n);a.dependencies=Object.fromEntries(Object.entries({...a.dependencies,...e}).sort(([e],[t])=>e.localeCompare(t))),await o(t,JSON.stringify(a,null,i)+`
2
+ `)}async function Wn(e,t=`latest`){let n=new URL(`${e}/${t}`,`https://registry.npmjs.org/`),{version:r}=await(await fetch(n)).json();return r}function Gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gn(Object(n),!0).forEach(function(t){qn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qn(e,t,n){return t=Jn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jn(e){var t=Yn(e,`string`);return typeof t==`symbol`?t:String(t)}function Yn(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Xn=Zn({});function Zn(e){return t.withOptions=t=>Zn(Kn(Kn({},e),t)),t;function t(t,...n){let r=typeof t==`string`?[t]:t.raw,{alignValues:i=!1,escapeSpecialCharacters:a=Array.isArray(t),trimWhitespace:o=!0}=e,s=``;for(let e=0;e<r.length;e++){let t=r[e];if(a&&(t=t.replace(/\\\n[ \t]*/g,``).replace(/\\`/g,"`").replace(/\\\$/g,`$`).replace(/\\\{/g,`{`)),s+=t,e<n.length){let t=i?Qn(n[e],s):n[e];s+=t}}let c=s.split(`
3
+ `),l=null;for(let e of c){let t=e.match(/^(\s+)\S+/);if(t){let e=t[1].length;l=l?Math.min(l,e):e}}if(l!==null){let e=l;s=c.map(t=>t[0]===` `||t[0]===` `?t.slice(e):t).join(`
4
+ `)}return o&&(s=s.trim()),a&&(s=s.replace(/\\n/g,`
5
+ `).replace(/\\t/g,` `).replace(/\\r/g,`\r`).replace(/\\v/g,`\v`).replace(/\\b/g,`\b`).replace(/\\f/g,`\f`).replace(/\\0/g,`\0`).replace(/\\x([\da-fA-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g,(e,t)=>String.fromCodePoint(parseInt(t,16))).replace(/\\u([\da-fA-F]{4})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))),typeof Bun<`u`&&(s=s.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,(e,t,n)=>{let r=t??n??``;return String.fromCodePoint(parseInt(r,16))})),s}}function Qn(e,t){if(typeof e!=`string`||!e.includes(`
6
+ `))return e;let n=t.slice(t.lastIndexOf(`
7
+ `)+1).match(/^(\s+)/);if(n){let t=n[1];return e.replace(/\n/g,`\n${t}`)}return e}const $n=Xn.withOptions({alignValues:!0});var er=class{async initProject(){await Un(await this.getDependencies());let e=await this.#r();for(let t of e)await this.#i(t)}async createSlice(e,t){let{modelPath:n}=await this.#t(e,t),r=await this.#n(e.name,t),{componentPath:i}=await this.createSliceComponent(e,r),{indexPath:a}=await this.#i(t);return{modelPath:n,componentPath:i,indexPath:a}}async readSlice(e){return(await this.#e(e)).model}async updateSlice(e){let t=await this.#e(e.id),{modelPath:n}=await this.#t(e,t.library),{indexPath:r}=await this.#i(t.library);return{modelPath:n,indexPath:r}}async renameSlice(e){let t=await this.#e(e.id),n=await this.#n(e.name,t.library);await i(t.directory,n);let{modelPath:r}=await this.#t(e,t.library),{indexPath:a}=await this.#i(t.library);return{modelPath:r,indexPath:a}}async deleteSlice(e){let t=await this.#e(e);await a(t.directory,{recursive:!0});let{indexPath:n}=await this.#i(t.library);return{sliceDirectory:t.directory,indexPath:n}}async getSlices(e){let t=e?[e]:await this.#r(),n=[];for(let e of t){let t=new URL(`*/model.json`,e),i=Array.from(await cn(c(t),{absolute:!0}),e=>l(e)),a=await Promise.all(i.map(async t=>{let n=new URL(`.`,t),i=await r(t,`utf8`);return{library:e,directory:n,model:JSON.parse(i)}}));n.push(...a)}return n.sort((e,t)=>e.model.id.toLowerCase().localeCompare(t.model.id.toLowerCase()))}async getDefaultSliceLibrary(){return(await this.#r())[0]}async createCustomType(e){let{modelPath:t}=await this.#a(e);return{modelPath:t}}async readCustomType(e){let t=await this.#o(e),n=await r(new URL(`index.json`,t),`utf8`);return JSON.parse(n)}async updateCustomType(e){let{modelPath:t}=await this.#a(e);return{modelPath:t}}async renameCustomType(e){await i(await this.#o(e.id),await this.#o(e.id));let{modelPath:t}=await this.#a(e);return{modelPath:t}}async deleteCustomType(e){let t=await this.#o(e);return await a(t,{recursive:!0}),{customTypeDirectory:t}}async getCustomTypes(){let e=await this.#s(),t=new URL(`*/index.json`,e),n=Array.from(await cn(c(t),{absolute:!0}),e=>l(e));return(await Promise.all(n.map(async e=>{let t=new URL(`.`,e),n=await r(e,`utf8`);return{directory:t,model:JSON.parse(n)}}))).sort((e,t)=>e.model.id.toLowerCase().localeCompare(t.model.id.toLowerCase()))}async getProjectRoot(){let e=await Q(`package.json`);if(!e)throw Error(`No package.json found`);return new URL(`./`,e)}async checkIsTypeScriptProject(){let e=await this.getProjectRoot();return await Cn(new URL(`tsconfig.json`,e))}async getJsFileExtension(){return await this.checkIsTypeScriptProject()?`ts`:`js`}async#e(e){let t=(await this.getSlices()).find(t=>t.model.id===e);if(!t)throw Error(`No slice found with ID: ${e}`);return t}async#t(e,t){let r=await this.#n(e.name,t);await n(r,{recursive:!0});let i=new URL(`model.json`,r);return await o(i,this.#c(e)),{modelPath:i}}async#n(e,t){let n=xe(e);return Sn(new URL(n,t))}async#r(){let e=await this.getProjectRoot(),t=await On(),n=t.ok?t.config.libraries:void 0;return n?.length?n.map(t=>{let n=t.replace(/^\//,``);return Sn(new URL(n,e))}):[await this.getDefaultSliceLibraryPath(e)]}async#i(e){let t=await this.getSlices(e),n=await this.generateSliceLibraryIndexContents(t),r=`index.${await this.getJsFileExtension()}`,i=new URL(r,e);return await o(i,n),{indexPath:i}}async generateSliceLibraryIndexContents(e){let t=e.map(e=>{let t=xe(e.model.name),n=s(c(e.library),c(e.directory));return`import ${t} from "${this.getSliceImportPath(n)}";`}),n=e.map(e=>{let t=xe(e.model.name);return`${e.model.id}: ${t}`});return $n`
8
+ // Code generated by Prismic. DO NOT EDIT.
9
+
10
+ ${t.join(`
11
+ `)}
12
+
13
+ export const components = {
14
+ ${n.join(`,
15
+ `)}
16
+ };
17
+ `}async#a(e){let t=await this.#o(e.id);await n(t,{recursive:!0});let r=new URL(`index.json`,t);return await o(r,this.#c(e)),{modelPath:r}}async#o(e){let t=await this.#s(),n=e;return Sn(new URL(n,t))}async#s(){let e=await this.getProjectRoot();return new URL(`customtypes/`,e)}#c(e){return dn(e)}};const tr=Y({dependencies:X(re(Z(),Z())),devDependencies:X(re(Z(),Z()))});async function nr(){let e=await ir();if(!e)throw new rr;return e}var rr=class extends Error{message=`No supported framework found (Next.js, Nuxt, or SvelteKit required)`};async function ir(){switch(await ar()){case`next`:{let{NextJsFramework:e}=await import(`./nextjs-CkWxsKc9.mjs`);return new e}case`nuxt`:{let{NuxtFramework:e}=await import(`./nuxt-B4ZFmGzN.mjs`);return new e}case`sveltekit`:{let{SvelteKitFramework:e}=await import(`./sveltekit-DQPylEC2.mjs`);return new e}default:return}}async function ar(){let e=await Q(`package.json`);if(e)try{let t=await r(e,`utf8`),{dependencies:n={},devDependencies:i={}}=ie(tr,JSON.parse(t)),a={...n,...i};if(`next`in a)return`next`;if(`nuxt`in a)return`nuxt`;if(`@sveltejs/kit`in a)return`sveltekit`}catch{}}export{A,se as C,Z as D,X as E,k as O,ce as S,Y as T,_n as _,$n as a,fe as b,En as c,An as d,Cn as f,mn as g,hn as h,nr as i,j as k,On as l,bn as m,rr as n,Wn as o,Q as p,ir as r,Pn as s,er as t,Dn as u,gn as v,q as w,pe as x,xe as y};
package/dist/index.mjs ADDED
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ import{C as e,D as t,E as n,S as r,T as i,_ as a,a as o,b as s,c,g as l,h as u,i as d,k as f,l as p,m,n as h,p as ee,r as te,s as ne,u as re,v as ie,w as ae,x as oe}from"./frameworks-CrDiIk_N.mjs";import*as se from"node:util";import{parseArgs as g,promisify as ce}from"node:util";import{readFile as le,rm as ue}from"node:fs/promises";import{dirname as de,join as fe,posix as pe,sep as me}from"node:path";import*as he from"node:http";import*as _ from"node:os";import{homedir as ge}from"node:os";import{exec as _e,execFile as ve,spawn as ye}from"node:child_process";import{createHash as be,randomUUID as xe}from"node:crypto";import{setTimeout as Se}from"node:timers/promises";import{isMainThread as Ce,threadId as we}from"worker_threads";import*as Te from"node:diagnostics_channel";import{subscribe as v}from"node:diagnostics_channel";import{createReadStream as Ee,existsSync as De,readFile as Oe,readFileSync as ke,readdir as Ae}from"node:fs";import{createInterface as je}from"node:readline";import{Worker as Me}from"node:worker_threads";import*as Ne from"node:https";import{Readable as Pe}from"node:stream";import{createGzip as Fe}from"node:zlib";import*as Ie from"node:net";import*as Le from"node:tls";import{AsyncLocalStorage as Re}from"node:async_hooks";var ze=`prismic`,Be=`0.0.0-canary.169f5fa`;const Ve=i({email:t(),shortId:t(),intercomHash:t(),repositories:ae(i({domain:t(),name:n(t())}))});async function He(e){let{token:t,host:n}=e,i=Ue(n);return await r(new URL(`profile`,i),{credentials:{"prismic-auth":t},schema:Ve})}function Ue(t=e.PRISMIC_HOST){return new URL(`https://user-service.${t}/`)}function We(e){_e(`${process.platform===`darwin`?`open`:process.platform===`win32`?`start`:`xdg-open`} "${e.toString()}"`)}async function Ge(e){let{repo:t,token:n,host:i}=e,a=qe(i);return await r(new URL(`customtypes`,a),{headers:{repository:t,Authorization:`Bearer ${n}`}})}async function Ke(e){let{repo:t,token:n,host:i}=e,a=qe(i);return await r(new URL(`slices`,a),{headers:{repository:t,Authorization:`Bearer ${n}`}})}function qe(t=e.PRISMIC_HOST){return new URL(`https://customtypes.${t}/`)}const Je=process.env.PRISMIC_ENV&&process.env.PRISMIC_ENV!==`production`?`Ng5oKJHCGpSWplZ9ymB7Pu7rm0sTDeiG`:`cGjidifKefYb6EPaGaqpt8rQXkv5TD6P`;let y=!1,Ye=``,Xe=``,Ze,Qe;const $e={app:{name:ze,version:Be}},et=[],tt=[];async function nt(){try{if(y=await ut(),!y)return;Ye=xe(),Xe=`Basic ${btoa(Je+`:`)}`,process.on(`exit`,ct)}catch{y=!1}}function rt(e,t){if(!y)return;let n=t?.repository??Qe,r={commandType:e,fullCommand:process.argv.join(` `)};n&&(r.repository=n),et.push({event:`Prismic CLI Start`,properties:r,context:st(n)})}function it(e,t,n,r){if(!y)return;let i=r?.repository??Qe,a={commandType:e,fullCommand:process.argv.join(` `),success:t};i&&(a.repository=i),r?.watch!==void 0&&(a.watch=r.watch),n!==void 0&&(a.error=(n instanceof Error?n.message:String(n)).slice(0,512)),et.push({event:`Prismic CLI End`,properties:a,context:st(i)})}function at(e){y&&(Ze=e.shortId,tt.push({userId:Ze,anonymousId:Ye,integrations:{Intercom:{user_hash:e.intercomHash}},context:$e,timestamp:new Date().toISOString()}))}function ot(e){Qe=e}function st(e){let t={...$e};return e&&(t.groupId={Repository:e}),t}function ct(){if(!(et.length===0&&tt.length===0)){try{let e=Buffer.from(JSON.stringify({trackUrl:`https://api.segment.io/v1/track`,identifyUrl:`https://api.segment.io/v1/identify`,authorization:Xe,trackEvents:et.map(e=>({...Ze?{userId:Ze}:{},anonymousId:Ye,event:e.event,properties:{nodeVersion:process.versions.node,...e.properties},context:e.context,timestamp:new Date().toISOString()})),identifyEvents:tt})).toString(`base64`);ye(process.execPath,[`--input-type=module`,`-e`,lt,e],{detached:!0,stdio:`ignore`}).unref()}catch{}et.length=0,tt.length=0}}const lt=`
3
+ const {trackUrl, identifyUrl, authorization, trackEvents, identifyEvents} = JSON.parse(Buffer.from(process.argv[1], "base64"));
4
+ const h = {"Content-Type": "application/json", Authorization: authorization};
5
+ await Promise.allSettled([
6
+ ...trackEvents.map(e => fetch(trackUrl, {method: "POST", headers: h, body: JSON.stringify(e)}).catch(() => {})),
7
+ ...identifyEvents.map(e => fetch(identifyUrl, {method: "POST", headers: h, body: JSON.stringify(e)}).catch(() => {})),
8
+ ]);
9
+ `;async function ut(){try{return!((await dt(fe(ge(),`.prismicrc`)))?.telemetry===!1||(await dt(fe(process.cwd(),`.prismicrc`)))?.telemetry===!1)}catch{return!0}}async function dt(e){try{let t=await le(e,`utf8`);return JSON.parse(t)}catch{return}}const b=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,x=globalThis,S=`10.42.0`;function C(){return ft(x),x}function ft(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||S,t[S]=t[S]||{}}function w(e,t,n=x){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[S]=r[S]||{};return i[e]||(i[e]=t())}const pt=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],mt={};function T(e){if(!(`console`in x))return e();let t=x.console,n={},r=Object.keys(mt);r.forEach(e=>{let r=mt[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function ht(){St().enabled=!0}function gt(){St().enabled=!1}function _t(){return St().enabled}function vt(...e){xt(`log`,...e)}function yt(...e){xt(`warn`,...e)}function bt(...e){xt(`error`,...e)}function xt(e,...t){b&&_t()&&T(()=>{x.console[e](`Sentry Logger [${e}]:`,...t)})}function St(){return b?w(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}const E={enable:ht,disable:gt,isEnabled:_t,log:vt,warn:yt,error:bt},Ct=/\(error: (.*)\)/,wt=/captureMessage|captureException/;function Tt(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
10
+ `);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=Ct.test(n)?n.replace(Ct,`$1`):n;if(!o.match(/\S*Error: /)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=50+r)break}}return Dt(i.slice(r))}}function Et(e){return Array.isArray(e)?Tt(...e):e}function Dt(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Ot(t).function||``)&&t.pop(),t.reverse(),wt.test(Ot(t).function||``)&&(t.pop(),wt.test(Ot(t).function||``)&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||Ot(t).filename,function:e.function||`?`}))}function Ot(e){return e[e.length-1]||{}}const kt=`<anonymous>`;function At(e){try{return!e||typeof e!=`function`?kt:e.name||kt}catch{return kt}}function jt(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}function Mt(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}const Nt={},Pt={};function Ft(e,t){Nt[e]=Nt[e]||[],Nt[e].push(t)}function It(e,t){if(!Pt[e]){Pt[e]=!0;try{t()}catch(t){b&&E.error(`Error while instrumenting ${e}`,t)}}}function Lt(e,t){let n=e&&Nt[e];if(n)for(let r of n)try{r(t)}catch(t){b&&E.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${At(r)}\nError:`,t)}}let Rt=null;function zt(e){let t=`error`;Ft(t,e),It(t,Bt)}function Bt(){Rt=x.onerror,x.onerror=function(e,t,n,r,i){return Lt(`error`,{column:r,error:i,line:n,msg:e,url:t}),Rt?Rt.apply(this,arguments):!1},x.onerror.__SENTRY_INSTRUMENTED__=!0}let Vt=null;function Ht(e){let t=`unhandledrejection`;Ft(t,e),It(t,Ut)}function Ut(){Vt=x.onunhandledrejection,x.onunhandledrejection=function(e){return Lt(`unhandledrejection`,e),Vt?Vt.apply(this,arguments):!0},x.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Wt=Object.prototype.toString;function D(e){switch(Wt.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return O(e,Error)}}function Gt(e,t){return Wt.call(e)===`[object ${t}]`}function Kt(e){return Gt(e,`ErrorEvent`)}function qt(e){return Gt(e,`String`)}function Jt(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function Yt(e){return e===null||Jt(e)||typeof e!=`object`&&typeof e!=`function`}function Xt(e){return Gt(e,`Object`)}function Zt(e){return typeof Event<`u`&&O(e,Event)}function Qt(e){return typeof Element<`u`&&O(e,Element)}function $t(e){return Gt(e,`RegExp`)}function en(e){return!!(e?.then&&typeof e.then==`function`)}function tn(e){return Xt(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function O(e,t){try{return e instanceof t}catch{return!1}}function nn(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}const rn=x;function an(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<5&&(o=on(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function on(e,t){let n=e,r=[];if(!n?.tagName)return``;if(rn.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&qt(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function sn(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&ln(i,r);try{e[t]=i}catch{b&&E.log(`Failed to replace method "${t}" in object`,e)}}function cn(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{b&&E.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function ln(e,t){try{e.prototype=t.prototype=t.prototype||{},cn(e,`__sentry_original__`,t)}catch{}}function un(e){return e.__sentry_original__}function dn(e){if(D(e))return{message:e.message,name:e.name,stack:e.stack,...pn(e)};if(Zt(e)){let t={type:e.type,target:fn(e.target),currentTarget:fn(e.currentTarget),...pn(e)};return typeof CustomEvent<`u`&&O(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function fn(e){try{return Qt(e)?an(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function pn(e){if(typeof e==`object`&&e){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function mn(e){let t=Object.keys(dn(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}let k;function hn(e){if(k!==void 0)return k?k(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=x;return t in n&&typeof n[t]==`function`?(k=n[t],k(e)):(k=null,e())}function A(){return hn(()=>Math.random())}function gn(){return hn(()=>Date.now())}function _n(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function vn(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function yn(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{nn(r)?n.push(jt(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function j(e,t,n=!1){return qt(e)?$t(t)?t.test(e):qt(t)?n?e===t:e.includes(t):!1:!1}function bn(e,t=[],n=!1){return t.some(t=>j(e,t,n))}function xn(){let e=x;return e.crypto||e.msCrypto}let Sn;function Cn(){return A()*16}function M(e=xn()){try{if(e?.randomUUID)return hn(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Sn||=`10000000100040008000100000000000`,Sn.replace(/[018]/g,e=>(e^(Cn()&15)>>e/4).toString(16))}function wn(e){return e.exception?.values?.[0]}function N(e){let{message:t,event_id:n}=e;if(t)return t;let r=wn(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Tn(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function En(e,t){let n=wn(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}const Dn=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function On(e){return parseInt(e||``,10)}function kn(e){let t=e.match(Dn)||[],n=On(t[1]),r=On(t[2]),i=On(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:t[4]}}function An(e){if(jn(e))return!0;try{cn(e,`__sentry_captured__`,!0)}catch{}return!1}function jn(e){try{return e.__sentry_captured__}catch{}}const Mn=1e3;function P(){return gn()/Mn}function Nn(){let{performance:e}=x;if(!e?.now||!e.timeOrigin)return P;let t=e.timeOrigin;return()=>(t+hn(()=>e.now()))/Mn}let Pn;function Fn(){return(Pn??=Nn())()}function In(e){let t=Fn(),n={sid:M(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>Rn(n)};return e&&F(n,e),n}function F(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Fn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:M()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Ln(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),F(e,n)}function Rn(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function zn(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=zn(r[e],t[e],n-1));return r}function I(){return M()}function Bn(){return M().substring(16)}const Vn=`_sentrySpan`;function Hn(e,t){t?cn(e,Vn,t):delete e[Vn]}function Un(e){return e[Vn]}var L=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:I(),sampleRand:A()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Hn(t,Un(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&F(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():Xt(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Hn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:I(),sampleRand:A()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:100;if(n<=0)return this;let r={timestamp:P(),...e,message:e.message?_n(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Un(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=zn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||M();if(!this._client)return b&&E.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||M();if(!this._client)return b&&E.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||M();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(b&&E.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function Wn(){return w(`defaultCurrentScope`,()=>new L)}function Gn(){return w(`defaultIsolationScope`,()=>new L)}var Kn=class{constructor(e,t){let n;n=e||new L;let r;r=t||new L,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return en(n)?n.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function R(){let e=ft(C());return e.stack=e.stack||new Kn(Wn(),Gn())}function qn(e){return R().withScope(e)}function Jn(e,t){let n=R();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Yn(e){return R().withScope(()=>e(R().getIsolationScope()))}function Xn(){return{withIsolationScope:Yn,withScope:qn,withSetScope:Jn,withSetIsolationScope:(e,t)=>Yn(t),getCurrentScope:()=>R().getScope(),getIsolationScope:()=>R().getIsolationScope()}}function Zn(e){let t=ft(C());t.acs=e}function z(e){let t=ft(e);return t.acs?t.acs:Xn()}function B(){return z(C()).getCurrentScope()}function V(){return z(C()).getIsolationScope()}function Qn(){return w(`globalScope`,()=>new L)}function $n(...e){let t=z(C());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function er(...e){let t=z(C());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function H(){return B().getClient()}function tr(e){let{traceId:t,parentSpanId:n,propagationSpanId:r}=e.getPropagationContext(),i={trace_id:t,span_id:r||Bn()};return n&&(i.parent_span_id=n),i}const nr=`sentry.profile_id`,rr=`sentry.exclusive_time`;function ir(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}function ar(e){let t=e;return{scope:t._sentryScope,isolationScope:ir(t._sentryIsolationScope)}}const or=/^sentry-/;function sr(e){let t=lr(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.match(or)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function cr(e){if(e)return dr(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`sentry-${t}`]=n),e),{}))}function lr(e){if(!(!e||!qt(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=ur(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):ur(e)}function ur(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function dr(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(b&&E.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}const fr=/^o(\d+)\./,pr=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function mr(e){return e===`http`||e===`https`}function U(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function hr(e){let t=pr.exec(e);if(!t){T(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return gr({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function gr(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function _r(e){if(!b)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(E.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?mr(r)?t&&isNaN(parseInt(t,10))?(E.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(E.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(E.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function vr(e){return e.match(fr)?.[1]}function yr(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=vr(n)),r}function br(e){let t=typeof e==`string`?hr(e):gr(e);if(!(!t||!_r(t)))return t}function xr(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}const Sr=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function Cr(e){if(!e)return;let t=e.match(Sr);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function wr(e,t){let n=Cr(e),r=sr(t);if(!n?.traceId)return{traceId:I(),sampleRand:A()};let i=Dr(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function Tr(e=I(),t=Bn(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function Er(e=I(),t=Bn(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function Dr(e,t){let n=xr(t?.sample_rand);if(n!==void 0)return n;let r=xr(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?A()*r:r+A()*(1-r):A()}function Or(e,t){let n=yr(e);return t&&n&&t!==n?(E.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):e.getOptions().strictTraceContinuation&&(t&&!n||!t&&n)?(E.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}let kr=!1;function Ar(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:Ir(e).parent_span_id,a=ar(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||Bn():t,trace_id:n}}function jr(e){let{traceId:t,spanId:n}=e.spanContext();return Tr(t,n,zr(e))}function Mr(e){let{traceId:t,spanId:n}=e.spanContext();return Er(t,n,zr(e))}function Nr(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function Pr(e){return typeof e==`number`?Fr(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Fr(e.getTime()):Fn()}function Fr(e){return e>9999999999?e/1e3:e}function Ir(e){if(Rr(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Lr(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0,start_timestamp:Pr(i),timestamp:Pr(o)||void 0,status:Br(s),op:r[`sentry.op`],origin:r[`sentry.origin`],links:Nr(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Lr(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Rr(e){return typeof e.getSpanJSON==`function`}function zr(e){let{traceFlags:t}=e.spanContext();return t===1}function Br(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function Vr(e){return e._sentryRootSpan||e}function Hr(){let e=z(C());return e.getActiveSpan?e.getActiveSpan():Un(B())}function Ur(){kr||=(T(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}let Wr=!1;function Gr(){if(Wr)return;function e(){let e=Hr(),t=e&&Vr(e);if(t){let e=`internal_error`;b&&E.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}e.tag=`sentry_tracingErrorCallback`,Wr=!0,zt(e),Ht(e)}function Kr(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||H()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function qr(e){E.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Jr(e,t){if(!t?.length||!e.description)return!1;for(let n of t){if(Xr(n)){if(j(e.description,n))return b&&qr(e),!0;continue}if(!n.name&&!n.op)continue;let t=n.name?j(e.description,n.name):!0,r=n.op?e.op&&j(e.op,n.op):!0;if(t&&r)return b&&qr(e),!0}return!1}function Yr(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function Xr(e){return typeof e==`string`||e instanceof RegExp}const Zr=`production`;function Qr(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||Zr,release:n.release,public_key:r,trace_id:e,org_id:yr(t)};return t.emit(`createDsc`,i),i}function $r(e,t){let n=t.getPropagationContext();return n.dsc||Qr(n.traceId,e)}function ei(e){let t=H();if(!t)return{};let n=Vr(e),r=Ir(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n._frozenDsc;if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&sr(l);if(u)return s(u);let d=Qr(e.spanContext().traceId,t),f=i[`sentry.source`],p=r.description;return f!==`url`&&p&&(d.transaction=p),Kr()&&(d.sampled=String(zr(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??ar(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}function W(e,t=100,n=1/0){try{return ni(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function ti(e,t=3,n=100*1024){let r=W(e,t);return oi(r)>n?ti(e,t-1,n):r}function ni(e,t,n=1/0,r=1/0,i=si()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=ri(e,t);if(!s.startsWith(`[object `))return s;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__==`number`?t.__sentry_override_normalization_depth__:n;if(c===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let l=t;if(l&&typeof l.toJSON==`function`)try{return ni(``,l.toJSON(),c-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,f=dn(t);for(let e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(d>=r){u[e]=`[MaxProperties ~]`;break}let t=f[e];u[e]=ni(e,t,c-1,r,i),d++}return o(t),u}function ri(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(nn(t))return jt(t);if(tn(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${At(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=ii(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function ii(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function ai(e){return~-encodeURI(e).split(/%..|./).length}function oi(e){return ai(JSON.stringify(e))}function si(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function G(e,t=[]){return[e,t]}function ci(e,t){let[n,r]=e;return[n,[...r,t]]}function li(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function ui(e,t){return li(e,(e,n)=>t.includes(n))}function di(e){let t=ft(x);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function fi(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[di(r),e]:r.push(typeof e==`string`?di(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(W(n))}i(e)}}return typeof r==`string`?r:pi(r)}function pi(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function mi(e){let t=typeof e.data==`string`?di(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const hi={session:`session`,sessions:`session`,attachment:`attachment`,transaction:`transaction`,event:`error`,client_report:`internal`,user_report:`default`,profile:`profile`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,feedback:`feedback`,span:`span`,raw_security:`security`,log:`log_item`,metric:`metric`,trace_metric:`metric`};function gi(e){return hi[e]}function _i(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function vi(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:U(r)},...i&&{trace:i}}}function yi(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function bi(e,t,n,r){let i=_i(n);return G({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:U(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function xi(e,t,n,r){let i=_i(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;yi(e,n?.sdk);let o=vi(e,i,r,t);return delete e.sdkProcessingMetadata,G(o,[[{type:a},e]])}const Si=`__SENTRY_SUPPRESS_TRACING__`,Ci=(e,t)=>{let n=z(C());if(n.continueTrace)return n.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,a=H(),o=sr(i);return a&&!Or(a,o?.org_id)?Ei(t):$n(e=>{let n=wr(r,i);return e.setPropagationContext(n),Hn(e,void 0),t()})};function wi(e,t){let n=Di();return n.withActiveSpan?n.withActiveSpan(e,t):$n(n=>(Hn(n,e||void 0),t(n)))}function Ti(e){let t=Di();return t.suppressTracing?t.suppressTracing(e):$n(t=>{t.setSDKProcessingMetadata({[Si]:!0});let n=e();return t.setSDKProcessingMetadata({[Si]:void 0}),n})}function Ei(e){return $n(t=>(t.setPropagationContext({traceId:I(),sampleRand:A()}),b&&E.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),wi(null,e)))}function Di(){return z(C())}function Oi(e){return new Ai(t=>{t(e)})}function ki(e){return new Ai((t,n)=>{n(e)})}var Ai=class e{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===0)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===1&&e[1](this._value),this._state===2&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===0){if(en(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(e){r(e)}}};function ji(e,t,n,r=0){try{let i=Mi(t,n,e,r);return en(i)?i:Oi(i)}catch(e){return ki(e)}}function Mi(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return b&&a===null&&E.log(`Event processor "${i.id||`?`}" dropped event`),en(a)?a.then(e=>Mi(e,t,n,r+1)):Mi(a,t,n,r+1)}let K,Ni,Pi,q;function Fi(e){let t=x._sentryDebugIds,n=x._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(q&&r.length===Ni&&i.length===Pi)return q;Ni=r.length,Pi=i.length,q={},K||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=K?.[r];if(i&&q&&t)q[i[0]]=t,K&&(K[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&q&&K){q[i]=t,K[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),q}function Ii(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Bi(e,t),r&&Ui(e,r),Wi(e,n),Vi(e,i),Hi(e,a)}function Li(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Ri(e,`extra`,n),Ri(e,`tags`,r),Ri(e,`attributes`,i),Ri(e,`user`,a),Ri(e,`contexts`,o),e.sdkProcessingMetadata=zn(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Ri(e,t,n){e[t]=zn(e[t],n,1)}function zi(e,t){let n=Qn().getScopeData();return e&&Li(n,e.getScopeData()),t&&Li(n,t.getScopeData()),n}function Bi(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Vi(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Hi(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Ui(e,t){e.contexts={trace:Ar(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ei(t),...e.sdkProcessingMetadata};let n=Ir(Vr(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function Wi(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Gi(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||M(),timestamp:t.timestamp||P()},l=n.integrations||e.integrations.map(e=>e.name);Ki(c,e),Yi(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&qi(c,e.stackParser);let u=Zi(r,n.captureContext);n.mechanism&&En(c,n.mechanism);let d=i?i.getEventProcessors():[],f=zi(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Ii(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Oi(c):ji(m,c,n)).then(e=>(e&&Ji(e),typeof o==`number`&&o>0?Xi(e,o,s):e))}function Ki(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||Zr,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=_n(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=_n(e.value,a)})}function qi(e,t){let n=Fi(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Ji(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Yi(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Xi(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:W(e.data,t,n)}}))},...e.user&&{user:W(e.user,t,n)},...e.contexts&&{contexts:W(e.contexts,t,n)},...e.extra&&{extra:W(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=W(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:W(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=W(e.contexts.flags,3,n)),r}function Zi(e,t){if(!t)return e;let n=e?e.clone():new L;return n.update(t),n}function Qi(e){if(e)return $i(e)||ta(e)?{captureContext:e}:e}function $i(e){return e instanceof L||typeof e==`function`}const ea=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function ta(e){return Object.keys(e).some(e=>ea.includes(e))}function na(e,t){return B().captureException(e,Qi(t))}function ra(e,t){V().setContext(e,t)}function ia(e,t){V().setTag(e,t)}function aa(e){V().setUser(e)}async function oa(e){let t=H();return t?t.flush(e):(b&&E.warn(`Cannot flush events. No client defined.`),Promise.resolve(!1))}function sa(){let e=H();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function ca(e){let t=V(),{user:n}=zi(t,B()),{userAgent:r}=x.navigator||{},i=In({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&F(a,{status:`exited`}),la(),t.setSession(i),i}function la(){let e=V(),t=B().getSession()||e.getSession();t&&Ln(t),ua(),e.setSession()}function ua(){let e=V(),t=H(),n=e.getSession();n&&t&&t.captureSession(n)}function da(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function fa(e){return`${da(e)}${e.projectId}/envelope/`}function pa(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function ma(e,t,n){return t||`${fa(e)}?${pa(e,n)}`}const ha=[];function ga(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function _a(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return ga(r)}function va(e,t){let n={};return t.forEach(t=>{t&&ba(e,t,n)}),n}function ya(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function ba(e,t,n){if(n[t.name]){b&&E.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!ha.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),ha.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}b&&E.log(`Integration installed: ${t.name}`)}function J(e){return e}function xa(e,t){return t?$n(t,()=>{let n=Hr(),r=n?Ar(n):tr(t);return[n?ei(n):$r(e,t),r]}):[void 0,void 0]}function Sa(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function Ca(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=U(r)),G(i,[Sa(e)])}function wa(e,t){let n=t??Ta(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Ca(n,r._metadata,r.tunnel,e.getDsn());Ea().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function Ta(e){return Ea().get(e)}function Ea(){return w(`clientToLogBufferMap`,()=>new WeakMap)}function Da(e){return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{items:e}]}function Oa(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=U(r)),G(i,[Da(e)])}function ka(e,t){let n=t??Aa(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Oa(n,r._metadata,r.tunnel,e.getDsn());ja().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function Aa(e){return ja().get(e)}function ja(){return w(`clientToMetricBufferMap`,()=>new WeakMap)}function Ma(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}const Na=Symbol.for(`SentryBufferFullError`);function Pa(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return ki(Na);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Oi(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>Ma(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}function Fa(e,t=gn()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function Ia(e,t){return e[t]||e.all||0}function La(e,t,n=gn()){return Ia(e,t)>n}function Ra(e,{statusCode:t,headers:n},r=gn()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+Fa(o,r):t===429&&(i.all=r+60*1e3);return i}function za(e,t,n=Pa(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(li(i,(t,n)=>{let i=gi(n);La(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=G(i[0],a),s=t=>{if(ui(o,[`client_report`])){b&&E.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}li(o,(n,r)=>{e.recordDroppedEvent(t,gi(r))})};return n.add(()=>t({body:fi(o)}).then(e=>e.statusCode===413?(b&&E.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(b&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&E.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Ra(r,e),e),e=>{throw s(`network_error`),b&&E.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===Na)return b&&E.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function Ba(e,t,n){let r=[{type:`client_report`},{timestamp:n||P(),discarded_events:e}];return G(t?{dsn:t}:{},[r])}function Va(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Ha(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[nr],exclusive_time:o?.[rr],measurements:e.measurements,is_segment:!0}}function Ua(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[nr]:e.profile_id},...e.exclusive_time&&{[rr]:e.exclusive_time}}}},measurements:e.measurements}}const Wa=`Not capturing exception because it's already been captured.`,Ga=`Discarded session because of missing or non-string release`,Ka=Symbol.for(`SentryInternalError`),qa=Symbol.for(`SentryDoNotSendEventError`);function Ja(e){return{message:e,[Ka]:!0}}function Ya(e){return{message:e,[qa]:!0}}function Xa(e){return!!e&&typeof e==`object`&&Ka in e}function Za(e){return!!e&&typeof e==`object`&&qa in e}function Qa(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{a+=r(t),a>=8e5?i(e):s||(s=!0,o=Ma(setTimeout(()=>{i(e)},5e3)))}),e.on(`flush`,()=>{i(e)})}var $a=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Pa(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=br(e.dsn):b&&E.warn(`No DSN provided, client will not send events.`),this._dsn){let t=ma(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Qa(this,`afterCaptureLog`,`flushLogs`,oo,wa),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Qa(this,`afterCaptureMetric`,`flushMetrics`,ao,ka)}captureException(e,t,n){let r=M();if(An(e))return b&&E.log(Wa),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:M(),...n},a=Jt(e)?e:String(e),o=Yt(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=M();if(t?.originalException&&An(t.originalException))return b&&E.log(Wa),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=eo(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),F(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(!t)return!0;this.emit(`flush`);let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){wa(this);let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];ba(this,e,this._integrations),t||ya(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=xi(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=ci(n,mi(e));this.sendEnvelope(n).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=Zr}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){b&&E.warn(Ga);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){b&&E.warn(Ga);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=bi(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;b&&E.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return b&&E.error(`Error while sending envelope:`,e),{}}return b&&E.error(`Transport disabled`),{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=va(this,e),ya(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(F(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Gi(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:tr(n),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:$r(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=B(),r=V()){return b&&ro(e)&&E.log(`Captured error event \`${Va(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{b&&(Za(e)?E.log(e.message):Xa(e)?E.warn(e.message):E.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=io(e),s=ro(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:xr(a);if(s&&typeof l==`number`&&A()>l)return this.recordDroppedEvent(`sample_rate`,`error`),ki(Ya(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=eo(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),Ya("An event processor returned `null`, will not send event.");return t.data&&t.data.__sentry__===!0?e:to(no(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw Ya(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw Za(e)||Xa(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),Ja(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===Na&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){b&&E.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){b&&E.log(`No outcomes to send`);return}if(!this._dsn){b&&E.log(`No dsn provided, will not send outcomes`);return}b&&E.log(`Sending outcomes:`,e);let t=Ba(e,this._options.tunnel&&U(this._dsn));this.sendEnvelope(t)}};function eo(e){return e===`replay_event`?`replay`:e||`error`}function to(e,t){let n=`${t} must return \`null\` or a valid event.`;if(en(e))return e.then(e=>{if(!Xt(e)&&e!==null)throw Ja(n);return e},e=>{throw Ja(`${t} rejected with ${e}`)});if(!Xt(e)&&e!==null)throw Ja(n);return e}function no(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:s}=t,c=n;if(ro(c)&&i)return i(c,r);if(io(c)){if(o||s){let t=Ha(c);if(s?.length&&Jr(t,s))return null;if(o){let e=o(t);e?c=zn(n,Ua(e)):Ur()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(s?.length&&Jr(e,s)){Yr(n,e);continue}if(o){let n=o(e);n?t.push(n):(Ur(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function ro(e){return e.type===void 0}function io(e){return e.type===`transaction`}function ao(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+so(e.attributes)}function oo(e){let t=0;return e.message&&(t+=e.message.length*2),t+so(e.attributes)}function so(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*co(e[0]):Yt(e)?t+=co(e):t+=100}),t}function co(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function lo(e,t,n,r,i){let a={sent_at:new Date().toISOString()};return n?.sdk&&(a.sdk={name:n.sdk.name,version:n.sdk.version}),r&&i&&(a.dsn=U(i)),t&&(a.trace=t),G(a,[uo(e)])}function uo(e){return[{type:`check_in`},e]}function fo(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}function po(e,t){return e(t.stack||``,1)}function mo(e){return D(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function ho(e){return mo(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function go(e,t){let n={type:t.name||t.constructor.name,value:ho(t)},r=po(e,t);return r.length&&(n.stacktrace={frames:r}),n}function _o(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function vo(e){if(`name`in e&&typeof e.name==`string`){let t=`'${e.name}' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message '${e.message}'`),t}else if(`message`in e&&typeof e.message==`string`)return e.message;let t=mn(e);if(Kt(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=yo(e);return`${n&&n!==`Object`?`'${n}'`:`Object`} captured as exception with keys: ${t}`}function yo(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function bo(e,t,n,r){if(D(n))return[n,void 0];if(t.synthetic=!0,Xt(n)){let t=e?.getOptions().normalizeDepth,i={__serialized__:ti(n,t)},a=_o(n);if(a)return[a,i];let o=vo(n),s=r?.syntheticException||Error(o);return s.message=o,[s,i]}let i=r?.syntheticException||Error(n);return i.message=`${n}`,[i,void 0]}function xo(e,t,n,r){let i=r?.data&&r.data.mechanism||{handled:!0,type:`generic`},[a,o]=bo(e,i,n,r),s={exception:{values:[go(t,a)]}};return o&&(s.extra=o),Tn(s,void 0,void 0),En(s,i),{...s,event_id:r?.event_id}}function So(e,t,n=`info`,r,i){let a={event_id:r?.event_id,level:n};if(i&&r?.syntheticException){let n=po(e,r.syntheticException);n.length&&(a.exception={values:[{value:t,stacktrace:{frames:n}}]},En(a,{synthetic:!0}))}if(Jt(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return a.logentry={message:e,params:n},a}return a.message=t,a}var Co=class extends $a{constructor(e){Gr(),fo(e),super(e),this._setUpMetricsProcessing()}eventFromException(e,t){let n=xo(this,this._options.stackParser,e,t);return n.level=`error`,Oi(n)}eventFromMessage(e,t=`info`,n){return Oi(So(this._options.stackParser,e,t,n,this._options.attachStacktrace))}captureException(e,t,n){return wo(t),super.captureException(e,t,n)}captureEvent(e,t,n){return!e.type&&e.exception?.values&&e.exception.values.length>0&&wo(t),super.captureEvent(e,t,n)}captureCheckIn(e,t,n){let r=`checkInId`in e&&e.checkInId?e.checkInId:M();if(!this._isEnabled())return b&&E.warn(`SDK not enabled, will not capture check-in.`),r;let{release:i,environment:a,tunnel:o}=this.getOptions(),s={check_in_id:r,monitor_slug:e.monitorSlug,status:e.status,release:i,environment:a};`duration`in e&&(s.duration=e.duration),t&&(s.monitor_config={schedule:t.schedule,checkin_margin:t.checkinMargin,max_runtime:t.maxRuntime,timezone:t.timezone,failure_issue_threshold:t.failureIssueThreshold,recovery_threshold:t.recoveryThreshold});let[c,l]=xa(this,n);l&&(s.contexts={trace:l});let u=lo(s,c,this.getSdkMetadata(),o,this.getDsn());return b&&E.log(`Sending checkin:`,e.monitorSlug,e.status),this.sendEnvelope(u),r}dispose(){b&&E.log(`Disposing client...`);for(let e of Object.keys(this._hooks))this._hooks[e]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=Pa(64)}_prepareEvent(e,t,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:e.contexts?.runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,t,n,r)}_setUpMetricsProcessing(){this.on(`processMetric`,e=>{this._options.serverName&&(e.attributes={"server.address":this._options.serverName,...e.attributes})})}};function wo(e){let t=V().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!==`crashed`?t.status=`errored`:n||(t.status=`crashed`)}}const To=new Set([`false`,`f`,`n`,`no`,`off`,`0`]),Eo=new Set([`true`,`t`,`y`,`yes`,`on`,`1`]);function Do(e,t){let n=String(e).toLowerCase();return To.has(n)?!1:Eo.has(n)?!0:t?.strict?null:!!e}function Oo(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function ko(e){return e.split(/[?#]/,1)[0]}function Ao(e){let{protocol:t,host:n,path:r}=e,i=n?.replace(/^.*@/,`[filtered]:[filtered]@`).replace(/(:80)$/,``).replace(/(:443)$/,``)||``;return`${t?`${t}://`:``}${i}${r}`}function jo(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:S})),i.version=S)}function Mo(e={}){let t=e.client||H();if(!sa()||!t)return{};let n=z(C());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||B(),i=e.span||Hr(),a=i?jr(i):No(r),o=cr(i?ei(i):$r(t,r));if(!Sr.test(a))return E.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let s={"sentry-trace":a,baggage:o};return e.propagateTraceparent&&(s.traceparent=i?Mr(i):Po(r)),s}function No(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Tr(t,r,n)}function Po(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Er(t,r,n)}const Fo=`[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:`;function Io(e,t,n){if(typeof e!=`string`||!t)return!0;let r=n?.get(e);if(r!==void 0)return b&&!r&&E.log(Fo,e),r;let i=bn(e,t);return n?.set(e,i),b&&!i&&E.log(Fo,e),i}function Lo(e){let t=Object.create(null);try{Object.entries(e).forEach(([e,n])=>{typeof n==`string`&&(t[e]=n)})}catch{}return t}function Ro(e){let t=e.headers||{},n=(typeof t[`x-forwarded-host`]==`string`?t[`x-forwarded-host`]:void 0)||(typeof t.host==`string`?t.host:void 0),r=(typeof t[`x-forwarded-proto`]==`string`?t[`x-forwarded-proto`]:void 0)||e.protocol||(e.socket?.encrypted?`https`:`http`),i=e.url||``,a=zo({url:i,host:n,protocol:r}),o=e.body||void 0,s=e.cookies;return{url:a,method:e.method,query_string:Bo(i),headers:Lo(t),cookies:s,data:o}}function zo({url:e,protocol:t,host:n}){if(e?.startsWith(`http`))return e;if(e&&n)return`${t}://${n}${e}`}function Bo(e){if(e)try{let t=new URL(e,`http://s.io`).search.slice(1);return t.length?t:void 0}catch{return}}function Y(e,t){let n=H(),r=V();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=100}=n.getOptions();if(a<=0)return;let o={timestamp:P(),...e},s=i?T(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}let Vo;const Ho=new WeakMap,Uo=J((()=>({name:`FunctionToString`,setupOnce(){Vo=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=un(this),n=Ho.has(H())&&t!==void 0?t:this;return Vo.apply(n,e)}}catch{}},setup(e){Ho.set(e,!0)}}))),Wo=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,`vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)`,`Can't find variable: _AutofillCallbackHandler`,/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],Go=J((e={})=>{let t;return{name:`EventFilters`,setup(n){t=Ko(e,n.getOptions())},processEvent(n,r,i){return t||=Ko(e,i.getOptions()),qo(n,t)?null:n}}});function Ko(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Wo],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function qo(e,t){if(e.type){if(e.type===`transaction`&&Yo(e,t.ignoreTransactions))return b&&E.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${N(e)}`),!0}else{if(Jo(e,t.ignoreErrors))return b&&E.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${N(e)}`),!0;if(es(e))return b&&E.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${N(e)}`),!0;if(Xo(e,t.denyUrls))return b&&E.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${N(e)}.\nUrl: ${$o(e)}`),!0;if(!Zo(e,t.allowUrls))return b&&E.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${N(e)}.\nUrl: ${$o(e)}`),!0}return!1}function Jo(e,t){return t?.length?Va(e).some(e=>bn(e,t)):!1}function Yo(e,t){if(!t?.length)return!1;let n=e.transaction;return n?bn(n,t):!1}function Xo(e,t){if(!t?.length)return!1;let n=$o(e);return n?bn(n,t):!1}function Zo(e,t){if(!t?.length)return!0;let n=$o(e);return n?bn(n,t):!0}function Qo(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function $o(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?Qo(t):null}catch{return b&&E.error(`Cannot extract url for event ${N(e)}`),null}}function es(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function ts(e,t,n,r,i,a){if(!i.exception?.values||!a||!O(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=ns(e,t,r,a.originalException,n,i.exception.values,o,0))}function ns(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(O(r[i],Error)){is(o,s,r);let a=e(t,r[i]),l=c.length;as(a,i,l,s),c=ns(e,t,n,r[i],i,[a,...c],a,l)}return rs(r)&&r.errors.forEach((a,l)=>{if(O(a,Error)){is(o,s,r);let u=e(t,a),d=c.length;as(u,`errors[${l}]`,d,s),c=ns(e,t,n,a,i,[u,...c],u,d)}}),c}function rs(e){return Array.isArray(e.errors)}function is(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...rs(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function as(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}const os=J(((e={})=>{let t=e.limit||5,n=e.key||`cause`;return{name:`LinkedErrors`,preprocessEvent(e,r,i){ts(go,i.getOptions().stackParser,n,t,e,r)}}}));function ss(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}const cs=[`X-Client-IP`,`X-Forwarded-For`,`Fly-Client-IP`,`CF-Connecting-IP`,`Fastly-Client-Ip`,`True-Client-Ip`,`X-Real-IP`,`X-Cluster-Client-IP`,`X-Forwarded`,`Forwarded-For`,`Forwarded`,`X-Vercel-Forwarded-For`];function ls(e){let t={};for(let n of Object.keys(e))t[n.toLowerCase()]=e[n];return cs.map(e=>{let n=t[e.toLowerCase()],r=Array.isArray(n)?n.join(`;`):n;return e===`Forwarded`?us(r):r?.split(`,`).map(e=>e.trim())}).reduce((e,t)=>t?e.concat(t):e,[]).find(e=>e!==null&&ds(e))||null}function us(e){if(!e)return null;for(let t of e.split(`;`))if(t.startsWith(`for=`))return t.slice(4);return null}function ds(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}const fs={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},ps=J(((e={})=>{let t={...fs,...e.include};return{name:`RequestData`,processEvent(e,n,r){let{sdkProcessingMetadata:i={}}=e,{normalizedRequest:a,ipAddress:o}=i,s={...t,ip:t.ip??r.getOptions().sendDefaultPii};return a&&ms(e,a,{ipAddress:o},s),e}}}));function ms(e,t,n,r){if(e.request={...e.request,...hs(t,r)},r.ip){let r=t.headers&&ls(t.headers)||n.ipAddress;r&&(e.user={...e.user,ip_address:r})}}function hs(e,t){let n={},r={...e.headers};return t.headers&&(n.headers=r,t.cookies||delete r.cookie,t.ip||cs.forEach(e=>{delete r[e]})),n.method=e.method,t.url&&(n.url=e.url),t.cookies&&(n.cookies=e.cookies||(r?.cookie?ss(r.cookie):void 0)||{}),t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function gs(e){let t=`console`;Ft(t,e),It(t,_s)}function _s(){`console`in x&&pt.forEach(function(e){e in x.console&&sn(x.console,e,function(t){return mt[e]=t,function(...t){Lt(`console`,{args:t,level:e}),mt[e]?.apply(x.console,t)}})})}function vs(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}const ys=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function bs(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=ys.exec(t);return n?n.slice(1):[]}function xs(e){let t=bs(e),n=t[0]||``,r=t[1];return!n&&!r?`.`:(r&&=r.slice(0,r.length-1),n+r)}const Ss=J((e={})=>{let t=new Set(e.levels||pt);return{name:`Console`,setup(e){gs(({args:n,level:r})=>{H()!==e||!t.has(r)||Cs(r,n)})}}});function Cs(e,t){let n={category:`console`,data:{arguments:t,logger:`console`},level:vs(e),message:ws(t)};if(e===`assert`)if(t[0]===!1){let e=t.slice(1);n.message=e.length>0?`Assertion failed: ${ws(e)}`:`Assertion failed`,n.data.arguments=e}else return;Y(n,{input:t,level:e})}function ws(e){return`util`in x&&typeof x.util.format==`function`?x.util.format(...e):yn(e,` `)}function Ts(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}function Es(e,t=!1){return!(t||e&&!e.startsWith(`/`)&&!e.match(/^[A-Z]:/)&&!e.startsWith(`.`)&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes(`node_modules/`)}function Ds(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return i=>{let a=i.match(r);if(a)return{filename:`<data:${a[2]}>`,function:a[1]};let o=i.match(n);if(o){let t,n,r,i,a;if(o[1]){r=o[1];let e=r.lastIndexOf(`.`);if(r[e-1]===`.`&&e--,e>0){t=r.slice(0,e),n=r.slice(e+1);let i=t.indexOf(`.Module`);i>0&&(r=r.slice(i+1),t=t.slice(0,i))}i=void 0}n&&(i=t,a=n),n===`<anonymous>`&&(a=void 0,r=void 0),r===void 0&&(a||=`?`,r=i?`${i}.${a}`:a);let s=Mt(o[2]),c=o[5]===`native`;!s&&o[5]&&!c&&(s=o[5]);let l=s?As(s):void 0;return{filename:l??s,module:l&&e?.(l),function:r,lineno:ks(o[3]),colno:ks(o[4]),in_app:Es(s||``,c)}}if(i.match(t))return{filename:i}}}function Os(e){return[90,Ds(e)]}function ks(e){return parseInt(e||``,10)||void 0}function As(e){try{return decodeURI(e)}catch{return}}var js=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let t=this._cache.get(e);if(t!==void 0)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){if(this._cache.size>=this._maxSize){let e=this._cache.keys().next().value;this._cache.delete(e)}this._cache.set(e,t)}remove(e){let t=this._cache.get(e);return t&&this._cache.delete(e),t}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(t=>e.push(t)),e}};const X=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;var Ms=class extends Co{constructor(e){let t=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||_.hostname(),n={...e,platform:`node`,runtime:{name:`node`,version:global.process.version},serverName:t};jo(n,`node-light`,[`node-core`]),E.log(`Initializing Sentry: process: ${process.pid}, thread: ${Ce?`main`:`worker-${we}`}.`),super(n),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{wa(this)},t&&this.on(`beforeCaptureLog`,e=>{e.attributes={...e.attributes,"server.address":t}}),process.on(`beforeExit`,this._logOnExitFlushListener))}async flush(e){return this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}async close(e){return this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off(`beforeExit`,this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off(`beforeExit`,this._logOnExitFlushListener),super.close(e)}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{X&&E.log(`Flushing client reports based on interval.`),this._flushOutcomes()},e.clientReportFlushInterval??6e4).unref(),process.on(`beforeExit`,this._clientReportOnExitFlushListener))}};const Ns=J((e={})=>({name:`ChildProcess`,setup(){Te.channel(`child_process`).subscribe(t=>{t&&typeof t==`object`&&`process`in t&&Ps(t.process,e)}),Te.channel(`worker_threads`).subscribe(t=>{t&&typeof t==`object`&&`worker`in t&&Fs(t.worker,e)})}}));function Ps(e,t){let n=!1,r;e.on(`spawn`,()=>{if(e.spawnfile===`/usr/bin/sw_vers`){n=!0;return}r={spawnfile:e.spawnfile},t.includeChildProcessArgs&&(r.spawnargs=e.spawnargs)}).on(`exit`,e=>{n||(n=!0,e!==null&&e!==0&&Y({category:`child_process`,message:`Child process exited with code '${e}'`,level:e===0?`info`:`warning`,data:r}))}).on(`error`,e=>{n||(n=!0,Y({category:`child_process`,message:`Child process errored with '${e.message}'`,level:`error`,data:r}))})}function Fs(e,t){let n;e.on(`online`,()=>{n=e.threadId}).on(`error`,e=>{t.captureWorkerErrors===!1?Y({category:`worker_thread`,message:`Worker thread errored with '${e.message}'`,level:`error`,data:{threadId:n}}):na(e,{mechanism:{type:`auto.child_process.worker_thread`,handled:!1,data:{threadId:String(n)}}})})}const Is=ce(Oe),Ls=ce(Ae),Rs=J(((e={})=>{let t,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e};async function r(e){t===void 0&&(t=i());let n=zs(await t);return e.contexts={...e.contexts,app:{...n.app,...e.contexts?.app},os:{...n.os,...e.contexts?.os},device:{...n.device,...e.contexts?.device},culture:{...n.culture,...e.contexts?.culture},cloud_resource:{...n.cloud_resource,...e.contexts?.cloud_resource}},e}async function i(){let e={};if(n.os&&(e.os=await Bs()),n.app&&(e.app=Hs()),n.device&&(e.device=Us(n.device)),n.culture){let t=Vs();t&&(e.culture=t)}return n.cloudResource&&(e.cloud_resource=Xs()),e}return{name:`Context`,processEvent(e){return r(e)}}}));function zs(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory==`function`){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=_.freemem()),e}async function Bs(){let e=_.platform();switch(e){case`darwin`:return qs();case`linux`:return Ys();default:return{name:Ws[e]||e,version:_.release()}}}function Vs(){try{if(typeof process.versions.icu!=`string`)return;let e=new Date(9e8);if(new Intl.DateTimeFormat(`es`,{month:`long`}).format(e)===`enero`){let e=Intl.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone}}}catch{}}function Hs(){let e=process.memoryUsage().rss,t={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory==`function`){let e=process.availableMemory?.();e!=null&&(t.free_memory=e)}return t}function Us(e){let t={},n;try{n=_.uptime()}catch{}if(typeof n==`number`&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=_.arch(),(e===!0||e.memory)&&(t.memory_size=_.totalmem(),t.free_memory=_.freemem()),e===!0||e.cpu){let e=_.cpus(),n=e?.[0];n&&(t.processor_count=e.length,t.cpu_description=n.model,t.processor_frequency=n.speed)}return t}const Ws={aix:`IBM AIX`,freebsd:`FreeBSD`,openbsd:`OpenBSD`,sunos:`SunOS`,win32:`Windows`,ohos:`OpenHarmony`,android:`Android`},Gs=[{name:`fedora-release`,distros:[`Fedora`]},{name:`redhat-release`,distros:[`Red Hat Linux`,`Centos`]},{name:`redhat_version`,distros:[`Red Hat Linux`]},{name:`SuSE-release`,distros:[`SUSE Linux`]},{name:`lsb-release`,distros:[`Ubuntu Linux`,`Arch Linux`]},{name:`debian_version`,distros:[`Debian`]},{name:`debian_release`,distros:[`Debian`]},{name:`arch-release`,distros:[`Arch Linux`]},{name:`gentoo-release`,distros:[`Gentoo Linux`]},{name:`novell-release`,distros:[`SUSE Linux`]},{name:`alpine-release`,distros:[`Alpine Linux`]}],Ks={alpine:e=>e,arch:e=>Z(/distrib_release=(.*)/,e),centos:e=>Z(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>Z(/release (..)/,e),mint:e=>Z(/distrib_release=(.*)/,e),red:e=>Z(/release ([^ ]+)/,e),suse:e=>Z(/VERSION = (.*)\n/,e),ubuntu:e=>Z(/distrib_release=(.*)/,e)};function Z(e,t){let n=e.exec(t);return n?n[1]:void 0}async function qs(){let e={kernel_version:_.release(),name:`Mac OS X`,version:`10.${Number(_.release().split(`.`)[0])-4}`};try{let t=await new Promise((e,t)=>{ve(`/usr/bin/sw_vers`,(n,r)=>{if(n){t(n);return}e(r)})});e.name=Z(/^ProductName:\s+(.*)$/m,t),e.version=Z(/^ProductVersion:\s+(.*)$/m,t),e.build=Z(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function Js(e){return e.split(` `)[0].toLowerCase()}async function Ys(){let e={kernel_version:_.release(),name:`Linux`};try{let t=await Ls(`/etc`),n=Gs.find(e=>t.includes(e.name));if(!n)return e;let r=(await Is(fe(`/etc`,n.name),{encoding:`utf-8`})).toLowerCase(),{distros:i}=n;e.name=i.find(e=>r.indexOf(Js(e))>=0)||i[0],e.version=Ks[Js(e.name)]?.(r)}catch{}return e}function Xs(){if(process.env.VERCEL)return{"cloud.provider":`vercel`,"cloud.region":process.env.VERCEL_REGION};if(process.env.AWS_REGION)return{"cloud.provider":`aws`,"cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV};if(process.env.GCP_PROJECT)return{"cloud.provider":`gcp`};if(process.env.ALIYUN_REGION_ID)return{"cloud.provider":`alibaba_cloud`,"cloud.region":process.env.ALIYUN_REGION_ID};if(process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME)return{"cloud.provider":`azure`,"cloud.region":process.env.REGION_NAME};if(process.env.IBM_CLOUD_REGION)return{"cloud.provider":`ibm_cloud`,"cloud.region":process.env.IBM_CLOUD_REGION};if(process.env.TENCENTCLOUD_REGION)return{"cloud.provider":`tencent_cloud`,"cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE};if(process.env.NETLIFY)return{"cloud.provider":`netlify`};if(process.env.FLY_REGION)return{"cloud.provider":`fly.io`,"cloud.region":process.env.FLY_REGION};if(process.env.DYNO)return{"cloud.provider":`heroku`}}const Zs=new js(10),Qs=new js(20);function $s(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function ec(e){return!!(e.startsWith(`node:`)||e.endsWith(`.min.js`)||e.endsWith(`.min.cjs`)||e.endsWith(`.min.mjs`)||e.startsWith(`data:`))}function tc(e){return e.lineno!==void 0&&e.lineno>1e4||e.colno!==void 0&&e.colno>1e3}function nc(e,t){let n=Zs.get(e);if(n===void 0)return!1;for(let e=t[0];e<=t[1];e++)if(n[e]===void 0)return!1;return!0}function rc(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!=`number`)return[];let i=dc(r,t),a=[];for(;;){if(n===e.length-1){a.push(i);break}let r=e[n+1];if(typeof r!=`number`)break;r<=i[1]?i[1]=r+t:(a.push(i),i=dc(r,t)),n++}return a}function ic(e,t,n){return new Promise((r,i)=>{let a=Ee(e),o=je({input:a});function s(){a.destroy(),r()}let c=0,l=0,u=t[l];if(u===void 0){s();return}let d=u[0],f=u[1];function p(t){Qs.set(e,1),X&&E.error(`Failed to read file: ${e}. Error: ${t}`),o.close(),o.removeAllListeners(),s()}a.on(`error`,p),o.on(`error`,p),o.on(`close`,s),o.on(`line`,e=>{if(c++,!(c<d)&&(n[c]=vn(e,0),c>=f)){if(l===t.length-1){o.close(),o.removeAllListeners();return}l++;let e=t[l];if(e===void 0){o.close(),o.removeAllListeners();return}d=e[0],f=e[1]}})})}async function ac(e,t){let n={};if(t>0&&e.exception?.values){for(let t of e.exception.values)if(t.stacktrace?.frames?.length)for(let e=t.stacktrace.frames.length-1;e>=0;e--){let r=t.stacktrace.frames[e],i=r?.filename;!r||typeof i!=`string`||typeof r.lineno!=`number`||ec(i)||tc(r)||(n[i]||(n[i]=[]),n[i].push(r.lineno))}}let r=Object.keys(n);if(r.length==0)return e;let i=[];for(let e of r){if(Qs.get(e))continue;let r=n[e];if(!r)continue;r.sort((e,t)=>e-t);let a=rc(r,t);if(a.every(t=>nc(e,t)))continue;let o=$s(Zs,e,{});i.push(ic(e,a,o))}if(await Promise.all(i).catch(()=>{X&&E.log(`Failed to read one or more source files and resolve context lines`)}),t>0&&e.exception?.values)for(let n of e.exception.values)n.stacktrace?.frames&&n.stacktrace.frames.length>0&&oc(n.stacktrace.frames,t,Zs);return e}function oc(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno==`number`){let e=n.get(r.filename);if(e===void 0)continue;cc(r.lineno,r,t,e)}}function sc(e){delete e.pre_context,delete e.context_line,delete e.post_context}function cc(e,t,n,r){if(t.lineno===void 0||r===void 0){X&&E.error(`Cannot resolve context for frame with no lineno or file contents`);return}t.pre_context=[];for(let i=lc(e,n);i<e;i++){let e=r[i];if(e===void 0){sc(t),X&&E.error(`Could not find line ${i} in file ${t.filename}`);return}t.pre_context.push(e)}if(r[e]===void 0){sc(t),X&&E.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let i=uc(e,n);t.post_context=[];for(let n=e+1;n<=i;n++){let e=r[n];if(e===void 0)break;t.post_context.push(e)}}function lc(e,t){return Math.max(1,e-t)}function uc(e,t){return e+t}function dc(e,t){return[lc(e,t),uc(e,t)]}const fc=J(((e={})=>{let t=e.frameContextLines===void 0?7:e.frameContextLines;return{name:`ContextLines`,processEvent(e){return ac(e,t)}}})),pc=kn(process.versions.node),mc=pc.major;pc.minor;let hc;async function gc(){if(hc===void 0)try{hc=!!(await import(`node:inspector`)).url()}catch{hc=!1}return hc}const _c=`__SENTRY_ERROR_LOCAL_VARIABLES__`;function vc(e,t,n){let r=0,i=5,a=0;return setInterval(()=>{a===0?r>e&&(i*=2,n(i),i>86400&&(i=86400),a=i):(--a,a===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function yc(e){return e!==void 0&&(e.length===0||e===`?`||e===`<anonymous>`)}function bc(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||yc(e)&&yc(t)}function xc(...e){E.log(`[LocalVariables]`,...e)}const Sc=J(((e={})=>{function t(t,n){let r=(t.stacktrace?.frames||[]).filter(e=>e.function!==`new Promise`);for(let t=0;t<r.length;t++){let i=r.length-t-1,a=n[t],o=r[i];if(!o||!a)break;a.vars===void 0||o.in_app===!1&&e.includeOutOfAppFrames!==!0||!bc(o.function,a.function)||(o.vars=a.vars)}}function n(e,n){if(n.originalException&&typeof n.originalException==`object`&&_c in n.originalException&&Array.isArray(n.originalException[_c])){for(let r of e.exception?.values||[])t(r,n.originalException[_c]);n.originalException[_c]=void 0}return e}async function r(){let e=await import(`node:inspector`);e.url()||e.open(0)}function i(e){let t=new Me(new URL(`data:application/javascript;base64,LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjQyLjAgKDA3YzkxOTApIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=`),{workerData:e,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on(`exit`,()=>{t.terminate()}),t.once(`error`,e=>{xc(`Worker error`,e)}),t.once(`exit`,e=>{xc(`Worker exit`,e)}),t.unref()}return{name:`LocalVariablesAsync`,async setup(t){if(!t.getOptions().includeLocalVariables)return;if(await gc()){E.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}let n={...e,debug:E.isEnabled()};r().then(()=>{try{i(n)}catch(e){E.error(`Failed to start worker`,e)}},e=>{E.error(`Failed to start inspector`,e)})},processEvent(e,t){return n(e,t)}}}));function Cc(e){if(e!==void 0)return e.slice(-10).reduce((e,t)=>`${e},${t.function},${t.lineno},${t.colno}`,``)}function wc(e,t){if(t!==void 0)return Cc(e(t,1))}function Tc(e){let t=[],n=!1;function r(r){t=[],!n&&(n=!0,e(r))}t.push(r);function i(e){t.push(e)}function a(e){let n=t.pop()||r;try{n(e)}catch{r(e)}}return{add:i,next:a}}var Ec=class e{constructor(e){this._session=e}static async create(t){return t||new e(new(await(import(`node:inspector`))).Session)}configureAndConnect(e,t){this._session.connect(),this._session.on(`Debugger.paused`,t=>{e(t,()=>{this._session.post(`Debugger.resume`)})}),this._session.post(`Debugger.enable`),this._session.post(`Debugger.setPauseOnExceptions`,{state:t?`all`:`uncaught`})}setPauseOnExceptions(e){this._session.post(`Debugger.setPauseOnExceptions`,{state:e?`all`:`uncaught`})}getLocalVariables(e,t){this._getProperties(e,e=>{let{add:n,next:r}=Tc(t);for(let t of e)if(t.value?.objectId&&t.value.className===`Array`){let e=t.value.objectId;n(n=>this._unrollArray(e,t.name,n,r))}else if(t.value?.objectId&&t.value.className===`Object`){let e=t.value.objectId;n(n=>this._unrollObject(e,t.name,n,r))}else t.value&&n(e=>this._unrollOther(t,e,r));r({})})}_getProperties(e,t){this._session.post(`Runtime.getProperties`,{objectId:e,ownProperties:!0},(e,n)=>{t(e?[]:n.result)})}_unrollArray(e,t,n,r){this._getProperties(e,e=>{n[t]=e.filter(e=>e.name!==`length`&&!isNaN(parseInt(e.name,10))).sort((e,t)=>parseInt(e.name,10)-parseInt(t.name,10)).map(e=>e.value?.value),r(n)})}_unrollObject(e,t,n,r){this._getProperties(e,e=>{n[t]=e.map(e=>[e.name,e.value?.value]).reduce((e,[t,n])=>(e[t]=n,e),{}),r(n)})}_unrollOther(e,t,n){e.value&&(`value`in e.value?e.value.value===void 0||e.value.value===null?t[e.name]=`<${e.value.value}>`:t[e.name]=e.value.value:`description`in e.value&&e.value.type!==`function`?t[e.name]=`<${e.value.description}>`:e.value.type===`undefined`&&(t[e.name]=`<undefined>`)),n(t)}};const Dc=J(((e={},t)=>{let n=new js(20),r,i=!1;function a(t){let r=Cc(t.stacktrace?.frames);if(r===void 0)return;let i=n.remove(r);if(i===void 0)return;let a=(t.stacktrace?.frames||[]).filter(e=>e.function!==`new Promise`);for(let t=0;t<a.length;t++){let n=a.length-t-1,r=i[t],o=a[n];if(!o||!r)break;r.vars===void 0||o.in_app===!1&&e.includeOutOfAppFrames!==!0||!bc(o.function,r.function)||(o.vars=r.vars)}}function o(e){for(let t of e.exception?.values||[])a(t);return e}let s;async function c(){let a=H()?.getOptions();if(a?.includeLocalVariables){if(mc<18){E.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await gc()){E.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}try{let o=await Ec.create(t),s=(e,{params:{reason:t,data:i,callFrames:a}},s)=>{if(t!==`exception`&&t!==`promiseRejection`){s();return}r?.();let c=wc(e,i.description);if(c==null){s();return}let{add:l,next:u}=Tc(e=>{n.set(c,e),s()});for(let e=0;e<Math.min(a.length,5);e++){let{scopeChain:t,functionName:n,this:r}=a[e],i=t.find(e=>e.type===`local`),s=r.className===`global`||!r.className?n:`${r.className}.${n}`;if(i?.object.objectId===void 0)l(t=>{t[e]={function:s},u(t)});else{let t=i.object.objectId;l(n=>o.getLocalVariables(t,t=>{n[e]={function:s,vars:t},u(n)}))}}u([])},c=e.captureAllExceptions!==!1;o.configureAndConnect((e,t)=>s(a.stackParser,e,t),c),c&&(r=vc(e.maxExceptionsPerSecond||50,()=>{E.log(`Local variables rate-limit lifted.`),o.setPauseOnExceptions(!0)},e=>{E.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${e} seconds.`),o.setPauseOnExceptions(!1)})),i=!0}catch(e){E.log("The `LocalVariables` integration failed to start.",e)}}}return{name:`LocalVariables`,setupOnce(){s=c()},async processEvent(e){return await s,i?o(e):e},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}})),Oc=(e={})=>pc.major<19?Dc(e):Sc(e);function kc(){try{return typeof module<`u`&&module.exports!==void 0}catch{return!1}}let Ac;const jc=typeof __SENTRY_SERVER_MODULES__>`u`?{}:__SENTRY_SERVER_MODULES__,Mc=(()=>({name:`Modules`,processEvent(e){return e.modules={...e.modules,...Ic()},e},getModules:Ic}));function Nc(){try{return f.cache?Object.keys(f.cache):[]}catch{return[]}}function Pc(){return{...jc,...Rc(),...kc()?Fc():{}}}function Fc(){let e=f.main?.paths||[],t=Nc(),n={},r=new Set;return t.forEach(t=>{let i=t,a=()=>{let t=i;if(i=de(t),!i||t===i||r.has(t))return;if(e.indexOf(i)<0)return a();let o=fe(t,`package.json`);if(r.add(t),!De(o))return a();try{let e=JSON.parse(ke(o,`utf8`));n[e.name]=e.version}catch{}};a()}),n}function Ic(){return Ac||=Pc(),Ac}function Lc(){try{let e=fe(process.cwd(),`package.json`);return JSON.parse(ke(e,`utf8`))}catch{return{}}}function Rc(){let e=Lc();return{...e.dependencies,...e.devDependencies}}function zc(e){T(()=>{console.error(e)});let t=H();if(t===void 0){X&&E.warn(`No NodeClient was defined, we are exiting the process now.`),global.process.exit(1);return}let n=t.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:2e3;t.close(r).then(e=>{e||X&&E.warn(`We reached the timeout for emptying the request buffer, still exiting now!`),global.process.exit(1)},e=>{X&&E.error(e)})}const Bc=J((e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:`OnUncaughtException`,setup(e){Ce&&global.process.on(`uncaughtException`,Vc(e,t))}}});function Vc(e,t){let n=!1,r=!1,i=!1,a,o=e.getOptions();return Object.assign(s=>{let c=zc;t.onFatalError?c=t.onFatalError:o.onFatalError&&(c=o.onFatalError);let l=global.process.listeners(`uncaughtException`).filter(e=>e.name!==`domainUncaughtExceptionClear`&&e.tag!==`sentry_tracingErrorCallback`&&e._errorHandler!==!0).length===0,u=t.exitEvenIfOtherHandlersAreRegistered||l;n?u&&(i?(X&&E.warn(`uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown`),zc(s)):r||(r=!0,setTimeout(()=>{i||(i=!0,c(a,s))},2e3))):(a=s,n=!0,H()===e&&na(s,{originalException:s,captureContext:{level:`fatal`},mechanism:{handled:!1,type:`auto.node.onuncaughtexception`}}),!i&&u&&(i=!0,c(s)))},{_errorHandler:!0})}const Hc=[{name:`AI_NoOutputGeneratedError`},{name:`AbortError`}],Uc=J(((e={})=>{let t={mode:e.mode??`warn`,ignore:[...Hc,...e.ignore??[]]};return{name:`OnUnhandledRejection`,setup(e){global.process.on(`unhandledRejection`,qc(e,t))}}}));function Wc(e){if(typeof e!=`object`||!e)return{name:``,message:String(e??``)};let t=e;return{name:typeof t.name==`string`?t.name:``,message:typeof t.message==`string`?t.message:String(e)}}function Gc(e,t){let n=e.name===void 0||j(t.name,e.name,!0),r=e.message===void 0||j(t.message,e.message);return n&&r}function Kc(e,t){let n=Wc(t);return e.some(e=>Gc(e,n))}function qc(e,t){return function(n,r){if(H()!==e||Kc(t.ignore??[],n))return;let i=t.mode===`strict`?`fatal`:`error`,a=n&&typeof n==`object`?n._sentry_active_span:void 0;(a?e=>wi(a,e):e=>e())(()=>{na(n,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:i},mechanism:{handled:!1,type:`auto.node.onunhandledrejection`}})}),Jc(n,t.mode)}}function Jc(e,t){let n=`This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:`;t===`warn`?T(()=>{console.warn(n),console.error(e&&typeof e==`object`&&`stack`in e?e.stack:e)}):t===`strict`&&(T(()=>{console.warn(n)}),zc(e))}const Yc=J(()=>({name:`ProcessSession`,setupOnce(){ca(),process.on(`beforeExit`,()=>{V().getSession()?.status!==`ok`&&la()})}})),Xc=`Spotlight`,Zc=J(((e={})=>{let t={sidecarUrl:e.sidecarUrl||`http://localhost:8969/stream`};return{name:Xc,setup(e){try{process.env.NODE_ENV&&process.env.NODE_ENV!==`development`&&E.warn(`[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?`)}catch{}Qc(e,t)}}}));function Qc(e,t){let n=$c(t.sidecarUrl);if(!n)return;let r=0;e.on(`beforeEnvelope`,e=>{if(r>3){E.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests`);return}let t=fi(e);Ti(()=>{let e=he.request({method:`POST`,path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":`application/x-sentry-envelope`}},e=>{e.statusCode&&e.statusCode>=200&&e.statusCode<400&&(r=0),e.on(`data`,()=>{}),e.on(`end`,()=>{}),e.setEncoding(`utf8`)});e.on(`error`,()=>{r++,E.warn(`[Spotlight] Failed to send envelope to Spotlight Sidecar`)}),e.write(t),e.end()})})}function $c(e){try{return new URL(`${e}`)}catch{E.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}function el(e){return!(e instanceof Error)||!(`errno`in e)||typeof e.errno!=`number`?!1:se.getSystemErrorMap().has(e.errno)}const tl=J((e={})=>({name:`NodeSystemError`,processEvent:(t,n,r)=>{if(!el(n.originalException))return t;let i=n.originalException,a={...i};!r.getOptions().sendDefaultPii&&e.includePaths!==!0&&(delete a.path,delete a.dest),t.contexts={...t.contexts,node_system_error:a};for(let e of t.exception?.values||[])e.value&&(i.path&&e.value.includes(i.path)&&(e.value=e.value.replace(`'${i.path}'`,``).trim()),i.dest&&e.value.includes(i.dest)&&(e.value=e.value.replace(`'${i.dest}'`,``).trim()));return t}}));function nl(e){return e.replace(/^[A-Z]:/,``).replace(/\\/g,`/`)}function rl(e=process.argv[1]?xs(process.argv[1]):process.cwd(),t=me===`\\`){let n=t?nl(e):e;return e=>{if(!e)return;let r=t?nl(e):e,{dir:i,base:a,ext:o}=pe.parse(r);(o===`.js`||o===`.mjs`||o===`.cjs`)&&(a=a.slice(0,o.length*-1));let s=decodeURIComponent(a);i||=`.`;let c=i.lastIndexOf(`/node_modules`);if(c>-1)return`${i.slice(c+14).replace(/\//g,`.`)}:${s}`;if(i.startsWith(n)){let e=i.slice(n.length+1).replace(/\//g,`.`);return e?`${e}:${s}`:s}return s}}function il(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(x.SENTRY_RELEASE?.id)return x.SENTRY_RELEASE.id;let t=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return t||n||r||e}const al=Tt(Os(rl())),Q=Symbol(`AgentBaseInternalState`);var ol=class extends he.Agent{constructor(e){super(e),this[Q]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint==`boolean`)return e.secureEndpoint;if(typeof e.protocol==`string`)return e.protocol===`https:`}let{stack:t}=Error();return typeof t==`string`?t.split(`
11
+ `).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1):!1}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)};Promise.resolve().then(()=>this.connect(e,r)).then(i=>{if(i instanceof he.Agent)return i.addRequest(e,r);this[Q].currentSocket=i,super.createSocket(e,t,n)},n)}createConnection(){let e=this[Q].currentSocket;if(this[Q].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Q].defaultPort??(this.protocol===`https:`?443:80)}set defaultPort(e){this[Q]&&(this[Q].defaultPort=e)}get protocol(){return this[Q].protocol??(this.isSecureEndpoint()?`https:`:`http:`)}set protocol(e){this[Q]&&(this[Q].protocol=e)}};function sl(...e){E.log(`[https-proxy-agent:parse-proxy-response]`,...e)}function cl(e){return new Promise((t,n)=>{let r=0,i=[];function a(){let t=e.read();t?l(t):e.once(`readable`,a)}function o(){e.removeListener(`end`,s),e.removeListener(`error`,c),e.removeListener(`readable`,a)}function s(){o(),sl(`onend`),n(Error(`Proxy connection ended before receiving CONNECT response`))}function c(e){o(),sl(`onerror %o`,e),n(e)}function l(s){i.push(s),r+=s.length;let c=Buffer.concat(i,r),l=c.indexOf(`\r
12
+ \r
13
+ `);if(l===-1){sl(`have not received end of HTTP headers yet...`),a();return}let u=c.subarray(0,l).toString(`ascii`).split(`\r
14
+ `),d=u.shift();if(!d)return e.destroy(),n(Error(`No header received from proxy CONNECT response`));let f=d.split(` `),p=+(f[1]||0),m=f.slice(2).join(` `),h={};for(let t of u){if(!t)continue;let r=t.indexOf(`:`);if(r===-1)return e.destroy(),n(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,r).toLowerCase(),a=t.slice(r+1).trimStart(),o=h[i];typeof o==`string`?h[i]=[o,a]:Array.isArray(o)?o.push(a):h[i]=a}sl(`got proxy server response: %o %o`,d,h),o(),t({connect:{statusCode:p,statusText:m,headers:h},buffered:c})}e.on(`error`,c),e.on(`end`,s),a()})}function ll(...e){E.log(`[https-proxy-agent]`,...e)}var ul=class extends ol{static __initStatic(){this.protocols=[`http`,`https`]}constructor(e,t){super(t),this.options={},this.proxy=typeof e==`string`?new URL(e):e,this.proxyHeaders=t?.headers??{},ll(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?fl(t,`headers`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;if(n.protocol===`https:`){ll("Creating `tls.Socket`: %o",this.connectOpts);let e=this.connectOpts.servername||this.connectOpts.host;r=Le.connect({...this.connectOpts,servername:e&&Ie.isIP(e)?void 0:e})}else ll("Creating `net.Socket`: %o",this.connectOpts),r=Ie.connect(this.connectOpts);let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},a=Ie.isIPv6(t.host)?`[${t.host}]`:t.host,o=`CONNECT ${a}:${t.port} HTTP/1.1\r\n`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${a}:${t.port}`,i[`Proxy-Connection`]||=this.keepAlive?`Keep-Alive`:`close`;for(let e of Object.keys(i))o+=`${e}: ${i[e]}\r\n`;let s=cl(r);r.write(`${o}\r\n`);let{connect:c,buffered:l}=await s;if(e.emit(`proxyConnect`,c),this.emit(`proxyConnect`,c,e),c.statusCode===200){if(e.once(`socket`,dl),t.secureEndpoint){ll(`Upgrading socket connection to TLS`);let e=t.servername||t.host;return Le.connect({...fl(t,`host`,`path`,`port`),socket:r,servername:Ie.isIP(e)?void 0:e})}return r}r.destroy();let u=new Ie.Socket({writable:!1});return u.readable=!0,e.once(`socket`,e=>{ll(`Replaying proxy buffer for failed request`),e.push(l),e.push(null)}),u}};ul.__initStatic();function dl(e){e.resume()}function fl(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}function pl(e){return new Pe({read(){this.push(e),this.push(null)}})}function ml(e){let t;try{t=new URL(e.url)}catch{return T(()=>{console.warn(`[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.`)}),za(e,()=>Promise.resolve({}))}let n=t.protocol===`https:`,r=hl(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),i=n?Ne:he,a=e.keepAlive===void 0?!1:e.keepAlive,o=r?new ul(r):new i.Agent({keepAlive:a,maxSockets:30,timeout:2e3});return za(e,gl(e,e.httpModule??i,o))}function hl(e,t){let{no_proxy:n}=process.env;if(!n?.split(`,`).some(t=>e.host.endsWith(t)||e.hostname.endsWith(t)))return t}function gl(e,t,n){let{hostname:r,pathname:i,port:a,protocol:o,search:s}=new URL(e.url);return function(c){return new Promise((l,u)=>{Ti(()=>{let d=pl(c.body),f={...e.headers};c.body.length>32768&&(f[`content-encoding`]=`gzip`,d=d.pipe(Fe()));let p=r.startsWith(`[`),m=t.request({method:`POST`,agent:n,headers:f,hostname:p?r.slice(1,-1):r,path:`${i}${s}`,port:a,protocol:o,ca:e.caCerts},e=>{e.on(`data`,()=>{}),e.on(`end`,()=>{}),e.setEncoding(`utf8`);let t=e.headers[`retry-after`]??null,n=e.headers[`x-sentry-rate-limits`]??null;l({statusCode:e.statusCode,headers:{"retry-after":t,"x-sentry-rate-limits":Array.isArray(n)?n[0]||null:n}})});m.on(`error`,u),d.pipe(m)})})}}function _l(e){if(e===!1)return!1;if(typeof e==`string`)return e;let t=Do(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?n??!0:t??n}function vl(){let e=new Re;function t(){return e.getStore()||{scope:Wn(),isolationScope:Gn()}}function n(n){let r=t().scope.clone(),i=t().isolationScope;return e.run({scope:r,isolationScope:i},()=>n(r))}function r(n,r){let i=t().isolationScope.clone();return e.run({scope:n,isolationScope:i},()=>r(n))}function i(n){let r=t().scope.clone(),i=t().isolationScope.clone();return e.run({scope:r,isolationScope:i},()=>n(i))}function a(n,r){let i=t().scope.clone();return e.run({scope:i,isolationScope:n},()=>r(n))}function o(e){return n(t=>(t.setSDKProcessingMetadata({__SENTRY_SUPPRESS_TRACING__:!0}),e()))}Zn({suppressTracing:o,withScope:n,withSetScope:r,withIsolationScope:i,withSetIsolationScope:a,getCurrentScope:()=>t().scope,getIsolationScope:()=>t().isolationScope})}function yl(e,t,n,r){let i=0,a=[];X&&E.log(r,`Patching request.on`);let o=new WeakMap,s=n===`small`?1e3:n===`medium`?1e4:1048576;try{e.on=new Proxy(e.on,{apply:(e,t,n)=>{let[c,l,...u]=n;if(c===`data`){X&&E.log(r,`Handling request.on("data") with maximum body size of ${s}b`);let n=new Proxy(l,{apply:(e,t,n)=>{try{let e=n[0],t=Buffer.from(e);i<s?(a.push(t),i+=t.byteLength):X&&E.log(r,`Dropping request body chunk because maximum body length of ${s}b is exceeded.`)}catch{X&&E.error(r,`Encountered error while storing body chunk.`)}return Reflect.apply(e,t,n)}});return o.set(l,n),Reflect.apply(e,t,[c,n,...u])}return Reflect.apply(e,t,n)}}),e.off=new Proxy(e.off,{apply:(e,t,n)=>{let[,r]=n,i=o.get(r);if(i){o.delete(r);let a=n.slice();return a[1]=i,Reflect.apply(e,t,a)}return Reflect.apply(e,t,n)}}),e.on(`end`,()=>{try{let e=Buffer.concat(a).toString(`utf-8`);if(e){let n=Buffer.byteLength(e,`utf-8`)>s?`${Buffer.from(e).subarray(0,s-3).toString(`utf-8`)}...`:e;t.setSDKProcessingMetadata({normalizedRequest:{data:n}})}}catch(e){X&&E.error(r,`Error building captured request body`,e)}})}catch(e){X&&E.error(r,`Error patching request to capture body`,e)}}function bl(e,t){if(!e)return t;let n=lr(e),r=lr(t);if(!r)return e;let i={...n};return Object.entries(r).forEach(([e,t])=>{i[e]||(i[e]=t)}),dr(i)}const $=`@sentry/instrumentation-http`;function xl(e,t){let n=Cl(e),r=t?.statusCode,i=Ts(r);Y({category:`http`,data:{status_code:r,...n},type:`http`,level:i},{event:`response`,request:e,response:t})}function Sl(e,t){let n=Tl(e),{tracePropagationTargets:r,propagateTraceparent:i}=H()?.getOptions()||{},a=Io(n,r,t)?Mo({propagateTraceparent:i}):void 0;if(!a)return;let{"sentry-trace":o,baggage:s,traceparent:c}=a;if(o&&!e.getHeader(`sentry-trace`))try{e.setHeader(`sentry-trace`,o),X&&E.log($,`Added sentry-trace header to outgoing request`)}catch(e){X&&E.error($,`Failed to add sentry-trace header to outgoing request:`,D(e)?e.message:`Unknown error`)}if(c&&!e.getHeader(`traceparent`))try{e.setHeader(`traceparent`,c),X&&E.log($,`Added traceparent header to outgoing request`)}catch(e){X&&E.error($,`Failed to add traceparent header to outgoing request:`,D(e)?e.message:`Unknown error`)}if(s){let t=bl(e.getHeader(`baggage`),s);if(t)try{e.setHeader(`baggage`,t),X&&E.log($,`Added baggage header to outgoing request`)}catch(e){X&&E.error($,`Failed to add baggage header to outgoing request:`,D(e)?e.message:`Unknown error`)}}}function Cl(e){try{let t=e.getHeader(`host`)||e.host,n=Oo(new URL(e.path,`${e.protocol}//${t}`).toString()),r={url:Ao(n),"http.method":e.method||`GET`};return n.search&&(r[`http.query`]=n.search),n.hash&&(r[`http.fragment`]=n.hash),r}catch{return{}}}function wl(e){return{method:e.method,protocol:e.protocol,host:e.host,hostname:e.host,path:e.path,headers:e.getHeaders()}}function Tl(e){let t=e.getHeader(`host`)||e.host;return`${e.protocol}//${t}${e.path}`}const El=`Http`,Dl=new WeakSet,Ol=((e={})=>{let t={maxRequestBodySize:e.maxRequestBodySize??`medium`,ignoreRequestBody:e.ignoreRequestBody,breadcrumbs:e.breadcrumbs??!0,ignoreOutgoingRequests:e.ignoreOutgoingRequests},n=new js(100),r=new WeakMap;return{name:El,setupOnce(){v(`http.server.request.start`,(e=>{kl(e.server,t)})),v(`http.client.request.created`,(e=>{Al(e.request,t,n,r)})),v(`http.client.response.finish`,(e=>{let n=e;jl(n.request,n.response,t,r)})),v(`http.client.request.error`,(e=>{jl(e.request,void 0,t,r)}))}}});function kl(e,{ignoreRequestBody:t,maxRequestBodySize:n}){let r=e.emit;if(Dl.has(r))return;let i=new Proxy(r,{apply(e,r,i){if(i[0]!==`request`||!B().getClient())return e.apply(r,i);X&&E.log(El,`Handling incoming request`);let a=V().clone(),o=i[1],s=Ro(o),c=o.ip||o.socket?.remoteAddress,l=o.url||`/`;n!==`none`&&!t?.(l,o)&&yl(o,a,n,El),a.setSDKProcessingMetadata({normalizedRequest:s,ipAddress:c});let u=`${(o.method||`GET`).toUpperCase()} ${ko(l)}`;return a.setTransactionName(u),er(a,()=>{let t=s.headers?.[`sentry-trace`],n=s.headers?.baggage;return Ci({sentryTrace:Array.isArray(t)?t[0]:t,baggage:Array.isArray(n)?n[0]:n},()=>(B().getPropagationContext().propagationSpanId=Bn(),e.apply(r,i)))})}});Dl.add(i),e.emit=i}function Al(e,t,n,r){let i=Ml(e,t);r.set(e,i),!i&&Sl(e,n)}function jl(e,t,n,r){n.breadcrumbs&&((r.get(e)??Ml(e,n))||xl(e,t))}function Ml(e,t){if(B().getScopeData().sdkProcessingMetadata.__SENTRY_SUPPRESS_TRACING__)return!0;let{ignoreOutgoingRequests:n}=t;return n?n(`${e.protocol}//${e.getHeader(`host`)||e.host}${e.path}`,wl(e)):!1}const Nl=`sentry-trace`,Pl=`baggage`,Fl=/baggage: (.*)\r\n/;function Il(e,t){let n=zl(e.origin,e.path),{tracePropagationTargets:r,propagateTraceparent:i}=H()?.getOptions()||{},a=Io(n,r,t)?Mo({propagateTraceparent:i}):void 0;if(!a)return;let{"sentry-trace":o,baggage:s,traceparent:c}=a;if(Array.isArray(e.headers)){let t=e.headers;o&&!t.includes(Nl)&&t.push(Nl,o),c&&!t.includes(`traceparent`)&&t.push(`traceparent`,c);let n=t.findIndex(e=>e===Pl);if(s&&n===-1)t.push(Pl,s);else if(s){let e=t[n+1],r=bl(e,s);r&&(t[n+1]=r)}}else{let t=e.headers;o&&!t.includes(`${Nl}:`)&&(e.headers+=`${Nl}: ${o}\r\n`),c&&!t.includes(`traceparent:`)&&(e.headers+=`traceparent: ${c}\r\n`);let n=e.headers.match(Fl)?.[1];if(s&&!n)e.headers+=`${Pl}: ${s}\r\n`;else if(s){let t=bl(n,s);t&&(e.headers=e.headers.replace(Fl,`baggage: ${t}\r\n`))}}}function Ll(e,t){let n=Rl(e),r=t.statusCode,i=Ts(r);Y({category:`http`,data:{status_code:r,...n},type:`http`,level:i},{event:`response`,request:e,response:t})}function Rl(e){try{let t=Oo(zl(e.origin,e.path)),n={url:Ao(t),"http.method":e.method||`GET`};return t.search&&(n[`http.query`]=t.search),t.hash&&(n[`http.fragment`]=t.hash),n}catch{return{}}}function zl(e,t=`/`){try{return new URL(t,e).toString()}catch{let n=`${e}`;return n.endsWith(`/`)&&t.startsWith(`/`)?`${n}${t.slice(1)}`:!n.endsWith(`/`)&&!t.startsWith(`/`)?`${n}/${t}`:`${n}${t}`}}const Bl=((e={})=>{let t={breadcrumbs:e.breadcrumbs??!0,ignoreOutgoingRequests:e.ignoreOutgoingRequests},n=new js(100),r=new WeakMap;return{name:`NodeFetch`,setupOnce(){v(`undici:request:create`,(e=>{Vl(e.request,t,n,r)})),v(`undici:request:headers`,(e=>{let n=e;Hl(n.request,n.response,t,r)}))}}});function Vl(e,t,n,r){let i=Ul(e,t);r.set(e,i),!i&&Il(e,n)}function Hl(e,t,n,r){n.breadcrumbs&&(r.get(e)||Ll(e,t))}function Ul(e,t){if(B().getScopeData().sdkProcessingMetadata.__SENTRY_SUPPRESS_TRACING__)return!0;let{ignoreOutgoingRequests:n}=t;return n?n(zl(e.origin,e.path)):!1}function Wl(){return[Go(),Uo(),os(),ps(),tl(),Ss(),Ol(),Bl(),Bc(),Uc(),fc(),Oc(),Rs(),Ns(),Yc(),Mc()]}function Gl(e={}){return Kl(e,Wl)}function Kl(e={},t){let n=ql(e,t);n.debug===!0&&(X?E.enable():T(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),vl(),B().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:e})=>e===Xc)&&n.integrations.push(Zc({sidecarUrl:typeof n.spotlight==`string`?n.spotlight:void 0})),jo(n,`node-light`,[`node-core`]);let r=new Ms(n);return B().setClient(r),r.init(),E.log(`SDK initialized from ${kc()?`CommonJS`:`ESM`} (light mode)`),r.startClientReportTracking(),Xl(),process.env.VERCEL&&process.on(`SIGTERM`,async()=>{await r.flush(200)}),r}function ql(e,t){let n=Jl(e.release),r=_l(e.spotlight),i=Yl(e.tracesSampleRate),a={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??ml,stackParser:Et(e.stackParser||al),release:n,tracesSampleRate:i,spotlight:r,debug:Do(e.debug??process.env.SENTRY_DEBUG)},o=e.integrations,s=e.defaultIntegrations??t(a);return{...a,integrations:_a({defaultIntegrations:s,integrations:o})}}function Jl(e){if(e!==void 0)return e;let t=il();if(t!==void 0)return t}function Yl(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let n=parseFloat(t);return isFinite(n)?n:void 0}function Xl(){if(Do(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,n=wr(e,t);B().setPropagationContext(n)}}const Zl=e.PRISMIC_SENTRY_DSN||`https://e1886b1775bd397cd1afc60bfd2ebfc8@o146123.ingest.us.sentry.io/4510445143588864`;function Ql(){return e.PRISMIC_SENTRY_ENABLED??e.PROD}function $l(){if(e.PRISMIC_SENTRY_ENVIRONMENT)return e.PRISMIC_SENTRY_ENVIRONMENT;let t=Be.match(/-(.+?)\./);return t?t[1]:`production`}function eu(){try{if(!Ql())return;Gl({dsn:Zl,release:Be,environment:$l(),defaultIntegrations:!1,integrations:[],maxValueLength:2500}),ra(`Process`,{command:process.argv.join(` `),cwd:process.cwd()})}catch{}}async function tu(e){try{if(!Ql())return;na(e,e instanceof Error?{extra:{cause:e.cause,fullCommand:process.argv.join(` `)}}:{}),await oa()}catch{}}const nu=aa,ru=ia,iu=ra,au=5e3,ou=6e4;async function su(){let{values:{help:e,repo:t=await re(),watch:n}}=g({args:process.argv.slice(3),options:{repo:{type:`string`,short:`r`},watch:{type:`boolean`,short:`w`},help:{type:`boolean`,short:`h`}},allowPositionals:!1});if(e){console.info(`Sync slices, page types, and custom types from Prismic to local files.
15
+
16
+ Remote models are the source of truth. Local files are created, updated,
17
+ or deleted to match.
18
+
19
+ USAGE
20
+ prismic sync [flags]
21
+
22
+ FLAGS
23
+ -r, --repo string Repository domain
24
+ -w, --watch Watch for changes and sync continuously
25
+ -h, --help Show help for command`);return}if(!t){console.error(`Missing prismic.config.json or --repo option`),process.exitCode=1;return}ot(t),ru(`repository`,t),iu(`Repository Data`,{name:t});let r;try{r=await d()}catch(e){if(e instanceof h){console.error(e.message),process.exitCode=1;return}throw e}console.info(`Syncing from repository: ${t}`),rt(`sync`,{repository:t}),n?await cu(t,r):(await lu(t,r),await uu(t,r),it(`sync`,!0,void 0,{watch:!1}),console.info(`Sync complete`))}async function cu(e,t){let n=await l(),r=await u(),i=await Ke({repo:e,token:n,host:r}),a=await Ge({repo:e,token:n,host:r});await lu(e,t),await uu(e,t),console.info(o`
26
+ Initial sync completed!
27
+
28
+ Watching for changes (polling every ${au/1e3}s),
29
+ Press Ctrl+C to stop\n
30
+ `);let s=pu(i),c=pu(a),d=0;for(process.on(`SIGINT`,du),process.on(`SIGTERM`,du),process.on(`SIGHUP`,du),process.on(`SIGQUIT`,du),process.platform===`win32`&&process.on(`SIGBREAK`,du);;){await Se(fu(d));try{let i=pu(await Ke({repo:e,token:n,host:r})),a=i!==s,o=pu(await Ge({repo:e,token:n,host:r})),l=o!==c;if(a||l){let n=[];a&&(await lu(e,t),s=i,n.push(`slices`)),l&&(await uu(e,t),c=o,n.push(`custom types`));let r=new Date().toLocaleTimeString();console.info(`[${r}] Changes detected in ${n.join(` and `)}`)}d=0}catch(e){d++;let t=e instanceof Error?e.message:`Unknown error`,n=Math.min(au*2**(d-1),ou);if(console.error(`Error checking for changes: ${t}. Retrying in ${n/1e3}s...`),d>=10)throw Error(`Too many consecutive errors (10), stopping watch.`)}}}async function lu(e,t){let n=await Ke({repo:e,token:await l(),host:await u()}),r=await t.getSlices();for(let e of n)r.find(t=>t.model.id===e.id)&&await t.updateSlice(e);for(let e of r)n.some(t=>t.id===e.model.id)||await t.deleteSlice(e.model.id);let i=await t.getDefaultSliceLibrary();for(let e of n)r.some(t=>t.model.id===e.id)||await t.createSlice(e,i)}async function uu(e,t){let n=await Ge({repo:e,token:await l(),host:await u()}),r=await t.getCustomTypes();for(let e of n)r.find(t=>t.model.id===e.id)&&await t.updateCustomType(e);for(let e of r)n.some(t=>t.id===e.model.id)||await t.deleteCustomType(e.model.id);for(let e of n)r.some(t=>t.model.id===e.id)||await t.createCustomType(e)}function du(){console.info(`Watch stopped. Goodbye!`),it(`sync`,!0,void 0,{watch:!0}),process.exit(0)}function fu(e){return e===0?au:Math.min(au*2**(e-1),ou)}function pu(e){return be(`sha256`).update(JSON.stringify(e)).digest(`hex`)}async function mu(){let{values:e}=g({args:process.argv.slice(3),options:{help:{type:`boolean`,short:`h`},repo:{type:`string`,short:`r`}}});if(e.help){console.info(`Initialize a Prismic project by creating a prismic.config.json file.
31
+
32
+ Detects the project framework, installs dependencies, and syncs models
33
+ from Prismic. If a slicemachine.config.json exists, it will be migrated.
34
+
35
+ USAGE
36
+ prismic init [flags]
37
+
38
+ FLAGS
39
+ -r, --repo string Repository name
40
+ -h, --help Show help for command
41
+
42
+ EXAMPLES
43
+ prismic init --repo my-repo
44
+
45
+ LEARN MORE
46
+ Use \`prismic <command> --help\` for more information about a command.`);return}if((await p()).ok){console.error(`A prismic.config.json file already exists.`),process.exitCode=1;return}let t=await ee(`slicemachine.config.json`,{stop:`package.json`}),n,r;if(t)try{let e=await le(t,`utf8`),i=JSON.parse(e);n=i.repositoryName,r=i.libraries}catch{console.warn(`Could not read slicemachine.config.json, ignoring.`)}let i=e.repo??n;if(!i){console.error(`Missing required flag: --repo`),process.exitCode=1;return}let a=await l(),o=await u(),f;try{f=await He({token:a,host:o})}catch(e){if(e instanceof oe||e instanceof s){console.info(`Not logged in. Starting login...`);let{email:e}=await m({onReady:e=>{console.info(`Opening browser to complete login...`),console.info(`If the browser doesn't open, visit: ${e}`),We(e)}});console.info(`Logged in as ${e}`)}throw e}if(!f.repositories.find(e=>e.domain===i)){console.error(`Repository "${i}" not found in your account. Check the name or create it with \`prismic repo create\`.`),process.exitCode=1;return}let te;try{te=await d()}catch(e){if(e instanceof h){console.error(e.message),process.exitCode=1;return}throw e}let re={repositoryName:i};r?.length&&(re.libraries=r);let ie=await c(re);if(!ie.ok){ie.error instanceof ne?console.error(`Could not find a package.json file. Run this command from a project directory.`):console.error(`Failed to create config file.`),process.exitCode=1;return}t&&(await ue(t),console.info(`Migrated slicemachine.config.json to prismic.config.json`)),await te.initProject(),await lu(i,te),await uu(i,te),console.info(`Initialized Prismic for repository "${i}". Run \`npm install\` to install new dependencies.`)}async function hu(){let{values:e}=g({args:process.argv.slice(3),options:{help:{type:`boolean`,short:`h`}}});if(e.help){console.info(`Log in to Prismic via browser.
47
+
48
+ USAGE
49
+ prismic login [flags]
50
+
51
+ FLAGS
52
+ -h, --help Show help for command
53
+
54
+ LEARN MORE
55
+ Use \`prismic <command> --help\` for more information about a command.`);return}let{email:t}=await m({onReady:e=>{console.info(`Opening browser to complete login...`),console.info(`If the browser doesn't open, visit: ${e}`),gu(e)}});console.info(`Logged in to Prismic as ${t}`)}function gu(e){_e(`${process.platform===`darwin`?`open`:process.platform===`win32`?`start`:`xdg-open`} "${e.toString()}"`)}async function _u(){let{values:e}=g({args:process.argv.slice(3),options:{help:{type:`boolean`,short:`h`}}});if(e.help){console.info(`Log out of Prismic.
56
+
57
+ USAGE
58
+ prismic logout [flags]
59
+
60
+ FLAGS
61
+ -h, --help Show help for command
62
+
63
+ LEARN MORE
64
+ Use \`prismic <command> --help\` for more information about a command.`);return}await a()?console.info(`Logged out of Prismic`):(console.error(`Logout failed. You can log out manually by deleting the file.`),process.exitCode=1)}async function vu(){let{values:{help:e}}=g({args:process.argv.slice(3),options:{help:{type:`boolean`,short:`h`}}});if(e){console.info(`Show the currently logged in user.
65
+
66
+ USAGE
67
+ prismic whoami [flags]
68
+
69
+ FLAGS
70
+ -h, --help Show help for command
71
+
72
+ LEARN MORE
73
+ Use \`prismic <command> --help\` for more information about a command.`);return}let t=await He({token:await l(),host:await u()});console.info(t.email)}const yu=new Set([`login`,`logout`,`whoami`,`sync`]),bu=new Set([`login`,`logout`]),{positionals:xu,values:{version:Su}}=g({options:{help:{type:`boolean`,short:`h`},version:{type:`boolean`,short:`v`}},allowPositionals:!0,strict:!1});if(eu(),await nt(),Su)console.info(Be);else{let e=xu[0],t=await re();t&&(ot(t),ru(`repository`,t),iu(`Repository Data`,{name:t}));let n=await te();n&&ru(`framework`,n.id),bu.has(e)||ie().then(async e=>{if(!e)return;let t=await He({token:e,host:await u()});at({shortId:t.shortId,intercomHash:t.intercomHash}),nu({id:t.shortId})}).catch(()=>{}),yu.has(e)||rt(e,{repository:t});try{switch(e){case`init`:await mu();break;case`sync`:await su();break;case`login`:await hu();break;case`logout`:await _u();break;case`whoami`:await vu();break;default:e&&(console.error(`Unknown command: ${e}`),process.exitCode=1),console.info(`Prismic CLI for managing repositories and configurations.
74
+
75
+ USAGE
76
+ prismic <command> [flags]
77
+
78
+ COMMANDS
79
+ init Initialize a Prismic project
80
+ sync Sync types and slices from Prismic
81
+ login Log in to Prismic
82
+ logout Log out of Prismic
83
+ whoami Show the currently logged in user
84
+
85
+ FLAGS
86
+ -v, --version Show CLI version
87
+ -h, --help Show help for command
88
+
89
+ LEARN MORE
90
+ Use \`prismic <command> --help\` for more information about a command.`)}yu.has(e)||it(e,process.exitCode!==1)}catch(t){if(yu.has(e)||it(e,!1,t),process.exitCode=1,t instanceof oe||t instanceof s)console.error("Not logged in. Run `prismic login` first.");else throw await tu(t),t}}export{};