prismic 1.3.0-pr.75.eafee21 → 1.3.0-pr.77.6fcb24d

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.
Files changed (2) hide show
  1. package/dist/index.mjs +18 -18
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,I as s,K as c,L as l,M as u,N as d,O as f,P as p,R as m,S as h,U as g,V as ee,W as te,_ as ne,c as re,d as ie,f as ae,g as oe,h as se,i as ce,j as _,k as le,l as ue,m as de,o as fe,q as pe,r as me,s as v,t as he,u as ge,w as _e,z as ve}from"./string-CFNpwnbk.mjs";import*as ye from"node:util";import{parseArgs as be,promisify as xe}from"node:util";import{readFile as Se,rm as Ce,writeFile as we}from"node:fs/promises";import{pathToFileURL as Te}from"node:url";import{dirname as Ee,join as De,posix as Oe,sep as ke}from"node:path";import{exec as Ae,execFile as je,spawn as Me}from"node:child_process";import{Readable as Ne}from"node:stream";import{createInterface as Pe}from"node:readline";import*as Fe from"node:http";import{createServer as Ie}from"node:http";import*as y from"node:os";import{homedir as Le}from"node:os";import*as Re from"node:crypto";import{createHash as ze,randomUUID as Be}from"node:crypto";import{setTimeout as Ve}from"node:timers/promises";import{isMainThread as He,threadId as Ue}from"worker_threads";import*as We from"node:diagnostics_channel";import{subscribe as Ge}from"node:diagnostics_channel";import{createReadStream as Ke,existsSync as qe,readFile as Je,readFileSync as Ye,readdir as Xe}from"node:fs";import{Worker as Ze}from"node:worker_threads";import*as Qe from"node:https";import{createGzip as $e}from"node:zlib";import*as et from"node:net";import*as tt from"node:tls";import{AsyncLocalStorage as nt}from"node:async_hooks";var rt=`prismic`,it=`1.3.0-pr.75.eafee21`;async function b(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?ee(t.schema,s):s;throw o.status===401?new ct(o):o.status===403?new st(o):o.status===404?new ot(o):new x(o)}var at=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}},x=class extends at{name=`UnknownRequestError`},ot=class extends at{name=`NotFoundRequestError`},st=class extends at{name=`ForbiddenRequestError`},ct=class extends at{name=`UnauthorizedRequestError`};async function lt(e,t){let{host:n}=t,r=ut(n),i=new URL(`refreshtoken`,r);return i.searchParams.set(`token`,e),await b(i,{schema:m()})}function ut(e){return new URL(`https://auth.${e}/`)}const dt=`prismic.io`,S=ee(a({MODE:m(),DEV:ve(),PROD:ve(),TEST:ve(),PRISMIC_SENTRY_DSN:f(u(),`https://e1886b1775bd397cd1afc60bfd2ebfc8@o146123.ingest.us.sentry.io/4510445143588864`),PRISMIC_SENTRY_ENVIRONMENT:s(m()),PRISMIC_SENTRY_ENABLED:s(ve()),PRISMIC_HOST:s(m())}),{...process.env,MODE:`production`,DEV:`false`,PROD:`true`,TEST:`false`}),ft=new URL(`.prismic`,i(Te(Le()))),pt=a({token:s(m().check(t(1))),host:s(m().check(t(1)))});async function C(){return(await gt())?.token}async function w(){return S.PRISMIC_HOST?S.PRISMIC_HOST:(await gt())?.host??dt}async function mt(){let e=await C();if(!e)return;let t=await w(),n=await lt(e,{host:t});return await _t({token:n,host:t}),n}async function ht(){if(!await _e(ft))return!0;try{return await Ce(ft,{force:!0}),!0}catch{return!1}}async function gt(){try{let e=await Se(ft,`utf-8`);return ee(pt,JSON.parse(e))}catch{return}}async function _t(e){await we(ft,n(e))}async function vt(e){let t=await w(),n=`https://${t}`;return new Promise((r,i)=>{let a=Ie((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 _t({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 yt(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 yt(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}const bt=a({email:m(),shortId:m(),intercomHash:m(),repositories:le(a({domain:m(),name:s(m()),role:s(m())}))});async function xt(e){let{token:t,host:n}=e,r=St(n);return await b(new URL(`profile`,r),{credentials:{"prismic-auth":t},schema:bt})}function St(e){return new URL(`https://user-service.${e}/`)}function T(e,t){return async function(){let{positionals:n={},options:r}=e,i=e.name.split(` `).length,a=process.argv.slice(1+i),o=Object.keys(n).length>0,s=be({args:a,options:{...r,help:{type:`boolean`,short:`h`}},allowPositionals:o,strict:!0});if(s.values.help){console.info(Ct(e));return}await t(s)}}function Ct(e){let{description:t,sections:n,positionals:r={},options:i}=e,a=Object.keys(r),o=[he(t)];o.push(``),o.push(`USAGE`);let s=` ${e.name}`;if(a.length>0&&(s+=` `+a.map(e=>`<${e}>`).join(` `)),s+=` [options]`,o.push(s),a.length>0){o.push(``),o.push(`ARGUMENTS`);let e=Math.max(...a.map(e=>`<${e}>`.length));for(let t in r){let n=`<${t}>`.padEnd(e),i=r[t].description;o.push(` ${n} ${i}`)}}o.push(``),o.push(`OPTIONS`);let c=[];if(i){let e=Object.keys(i);for(let t of e){let e=i[t],n=`${e.short?`-${e.short}, `:` `}--${t}${e.type===`string`?` string`:``}`;c.push({left:n,description:e.description})}}c.push({left:`-h, --help`,description:`Show help for command`});let l=Math.max(...c.map(e=>e.left.length));for(let e of c){let t=e.left.padEnd(l);o.push(` ${t} ${e.description}`)}if(n)for(let e in n){let t=he(n[e]);o.push(``),o.push(e);for(let e of t.split(`
2
+ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,I as s,K as c,L as l,M as u,N as d,O as f,P as p,R as m,S as h,U as g,V as ee,W as te,_ as ne,c as re,d as ie,f as ae,g as oe,h as se,i as ce,j as _,k as le,l as ue,m as de,o as fe,q as pe,r as me,s as v,t as he,u as ge,w as _e,z as ve}from"./string-CFNpwnbk.mjs";import*as ye from"node:util";import{parseArgs as be,promisify as xe}from"node:util";import{readFile as Se,rm as Ce,writeFile as we}from"node:fs/promises";import{pathToFileURL as Te}from"node:url";import{dirname as Ee,join as De,posix as Oe,sep as ke}from"node:path";import{exec as Ae,execFile as je,spawn as Me}from"node:child_process";import{Readable as Ne}from"node:stream";import{createInterface as Pe}from"node:readline";import*as Fe from"node:http";import{createServer as Ie}from"node:http";import*as y from"node:os";import{homedir as Le}from"node:os";import*as Re from"node:crypto";import{createHash as ze,randomUUID as Be}from"node:crypto";import{setTimeout as Ve}from"node:timers/promises";import{isMainThread as He,threadId as Ue}from"worker_threads";import*as We from"node:diagnostics_channel";import{subscribe as Ge}from"node:diagnostics_channel";import{createReadStream as Ke,existsSync as qe,readFile as Je,readFileSync as Ye,readdir as Xe}from"node:fs";import{Worker as Ze}from"node:worker_threads";import*as Qe from"node:https";import{createGzip as $e}from"node:zlib";import*as et from"node:net";import*as tt from"node:tls";import{AsyncLocalStorage as nt}from"node:async_hooks";var rt=`prismic`,it=`1.3.0-pr.77.6fcb24d`;async function b(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?ee(t.schema,s):s;throw o.status===401?new ct(o):o.status===403?new st(o):o.status===404?new ot(o):new x(o)}var at=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}},x=class extends at{name=`UnknownRequestError`},ot=class extends at{name=`NotFoundRequestError`},st=class extends at{name=`ForbiddenRequestError`},ct=class extends at{name=`UnauthorizedRequestError`};async function lt(e,t){let{host:n}=t,r=ut(n),i=new URL(`refreshtoken`,r);return i.searchParams.set(`token`,e),await b(i,{schema:m()})}function ut(e){return new URL(`https://auth.${e}/`)}const dt=`prismic.io`,S=ee(a({MODE:m(),DEV:ve(),PROD:ve(),TEST:ve(),PRISMIC_SENTRY_DSN:f(u(),`https://e1886b1775bd397cd1afc60bfd2ebfc8@o146123.ingest.us.sentry.io/4510445143588864`),PRISMIC_SENTRY_ENVIRONMENT:s(m()),PRISMIC_SENTRY_ENABLED:s(ve()),PRISMIC_HOST:s(m())}),{...process.env,MODE:`production`,DEV:`false`,PROD:`true`,TEST:`false`}),ft=new URL(`.prismic`,i(Te(Le()))),pt=a({token:s(m().check(t(1))),host:s(m().check(t(1)))});async function C(){return(await gt())?.token}async function w(){return S.PRISMIC_HOST?S.PRISMIC_HOST:(await gt())?.host??dt}async function mt(){let e=await C();if(!e)return;let t=await w(),n=await lt(e,{host:t});return await _t({token:n,host:t}),n}async function ht(){if(!await _e(ft))return!0;try{return await Ce(ft,{force:!0}),!0}catch{return!1}}async function gt(){try{let e=await Se(ft,`utf-8`);return ee(pt,JSON.parse(e))}catch{return}}async function _t(e){await we(ft,n(e))}async function vt(e){let t=await w(),n=`https://${t}`;return new Promise((r,i)=>{let a=Ie((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 _t({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 yt(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 yt(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}const bt=a({email:m(),shortId:m(),intercomHash:m(),repositories:le(a({domain:m(),name:s(m()),role:s(m())}))});async function xt(e){let{token:t,host:n}=e,r=St(n);return await b(new URL(`profile`,r),{credentials:{"prismic-auth":t},schema:bt})}function St(e){return new URL(`https://user-service.${e}/`)}function T(e,t){return async function(){let{positionals:n={},options:r={}}=e,i=e.name.split(` `).length,a=process.argv.slice(1+i),o=Object.keys(n).length>0,s=be({args:a,options:{...r,help:{type:`boolean`,short:`h`}},allowPositionals:o,strict:!0});if(s.values.help){console.info(Ct(e));return}for(let[e,[t,r]]of Object.entries(n).entries())if(r.required&&!s.positionals[e])throw new E(`Missing required argument: <${t}>`);for(let[e,t]of Object.entries(r))if(t.required&&!(e in s.values))throw new E(`Missing required option: --${e}`);await t(s)}}function Ct(e){let{description:t,sections:n,positionals:r={},options:i}=e,a=Object.keys(r),o=[he(t)];o.push(``),o.push(`USAGE`);let s=` ${e.name}`;if(a.length>0&&(s+=` `+a.map(e=>`<${e}>`).join(` `)),s+=` [options]`,o.push(s),a.length>0){o.push(``),o.push(`ARGUMENTS`);let e=Math.max(...a.map(e=>`<${e}>`.length));for(let t in r){let n=`<${t}>`.padEnd(e),i=r[t],a=i.description+(i.required?` (required)`:``);o.push(` ${n} ${a}`)}}o.push(``),o.push(`OPTIONS`);let c=[];if(i){let e=Object.keys(i);for(let t of e){let e=i[t],n=`${e.short?`-${e.short}, `:` `}--${t}${e.type===`string`?` string`:``}`,r=e.description+(e.required?` (required)`:``);c.push({left:n,description:r})}}c.push({left:`-h, --help`,description:`Show help for command`});let l=Math.max(...c.map(e=>e.left.length));for(let e of c){let t=e.left.padEnd(l);o.push(` ${t} ${e.description}`)}if(n)for(let e in n){let t=he(n[e]);o.push(``),o.push(e);for(let e of t.split(`
3
3
  `))o.push(e?` ${e}`:``)}o.push(``),o.push(`LEARN MORE`);let u=e.name.split(` `)[0];return o.push(` Use \`${u} <command> --help\` for more information about a command.`),o.join(`
4
4
  `)}function wt(e){let{name:t,description:n,commands:r}=e,i=t.split(` `).length;return async function(){let{positionals:[a]}=be({args:process.argv.slice(1+i),options:{help:{type:`boolean`,short:`h`}},allowPositionals:!0,strict:!1}),o=a?e.commands[a]:void 0;if(o){await o.handler();return}if(a)throw new E(`Unknown command: ${a}`);console.info(Tt({name:t,description:n,commands:r}))}}function Tt(e){let{name:t,description:n,commands:r}=e,i=[n];i.push(``),i.push(`USAGE`),i.push(` ${t} <command> [options]`),i.push(``),i.push(`COMMANDS`);let a=Object.keys(r),o=Math.max(...a.map(e=>e.length));for(let e of a){let t=e.padEnd(o),n=r[e].description;i.push(` ${t} ${n}`)}return i.push(``),i.push(`OPTIONS`),i.push(` -h, --help Show help for command`),i.push(``),i.push(`LEARN MORE`),i.push(` Use \`${t} <command> --help\` for more information about a command.`),i.join(`
5
5
  `)}var E=class extends Error{name=`CommandError`},Et=T({name:`prismic gen setup`,description:`
@@ -206,7 +206,7 @@ await Promise.allSettled([
206
206
 
207
207
  By default, this command reads the repository from prismic.config.json at the
208
208
  project root.
209
- `,positionals:{code:{description:`Locale code (e.g. fr-fr, es-es)`}},options:{master:{type:`boolean`,description:`Set as the master locale`},name:{type:`string`,short:`n`,description:`Custom display name (for custom locales)`},repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),master:i=!1,name:a}=t;if(!n)throw new E(`Missing required argument: <code>`);let o=await C(),s=await w();try{await fi({id:n,isMaster:i,customName:a},{repo:r,token:o,host:s})}catch(e){throw e instanceof x?new E(`Failed to add locale: ${await e.text()}`):e}console.info(`Locale added: ${n}`)}),gi=T({name:`prismic locale list`,description:`
209
+ `,positionals:{code:{description:`Locale code (e.g. fr-fr, es-es)`,required:!0}},options:{master:{type:`boolean`,description:`Set as the master locale`},name:{type:`string`,short:`n`,description:`Custom display name (for custom locales)`},repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),master:i=!1,name:a}=t,o=await C(),s=await w();try{await fi({id:n,isMaster:i,customName:a},{repo:r,token:o,host:s})}catch(e){throw e instanceof x?new E(`Failed to add locale: ${await e.text()}`):e}console.info(`Locale added: ${n}`)}),gi=T({name:`prismic locale list`,description:`
210
210
  List all locales in a Prismic repository.
211
211
 
212
212
  By default, this command reads the repository from prismic.config.json at the
@@ -216,17 +216,17 @@ await Promise.allSettled([
216
216
 
217
217
  By default, this command reads the repository from prismic.config.json at the
218
218
  project root.
219
- `,positionals:{code:{description:`Locale code (e.g. en-us, fr-fr)`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <code>`);let i=await C(),a=await w();try{await pi(n,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to remove locale: ${await e.text()}`):e}console.info(`Locale removed: ${n}`)}),vi=T({name:`prismic locale set-master`,description:`
219
+ `,positionals:{code:{description:`Locale code (e.g. en-us, fr-fr)`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w();try{await pi(n,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to remove locale: ${await e.text()}`):e}console.info(`Locale removed: ${n}`)}),vi=T({name:`prismic locale set-master`,description:`
220
220
  Set the master locale for a Prismic repository.
221
221
 
222
222
  By default, this command reads the repository from prismic.config.json at the
223
223
  project root.
224
- `,positionals:{code:{description:`Locale code (e.g. en-us, fr-fr)`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <code>`);let i=await C(),a=await w(),o=await di({repo:r,token:i,host:a}),s=o.find(e=>e.id===n);if(!s)throw new E(`Locale "${n}" not found. Available locales: ${o.map(e=>e.id).join(`, `)}`);if(s.isMaster)throw new E(`Locale "${n}" is already the master.`);try{await fi({id:s.id,isMaster:!0,customName:s.customName??void 0},{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to set master locale: ${await e.text()}`):e}console.info(`Master locale set: ${n}`)}),yi=wt({name:`prismic locale`,description:`Manage locales in a Prismic repository.`,commands:{add:{handler:hi,description:`Add a locale`},list:{handler:gi,description:`List locales`},remove:{handler:_i,description:`Remove a locale`},"set-master":{handler:vi,description:`Set the master locale`}}}),bi=T({name:`prismic login`,description:`Log in to Prismic via browser.`,options:{"no-browser":{type:`boolean`,description:`Skip opening the browser automatically`}}},async({values:e})=>{let{"no-browser":t}=e,{email:n}=await vt({onReady:e=>{t?console.info(`Open this URL to log in: ${e}`):(console.info(`Opening browser to complete login...`),console.info(`If the browser doesn't open, visit: ${e}`),xi(e))}});console.info(`Logged in to Prismic as ${n}`)});function xi(e){Ae(`${process.platform===`darwin`?`open`:process.platform===`win32`?`start`:`xdg-open`} "${e.toString()}"`)}var Si=T({name:`prismic logout`,description:`Log out of Prismic.`},async()=>{if(await ht())console.info(`Logged out of Prismic`);else throw new E(`Logout failed. You can log out manually by deleting the file.`)});const Ci=a({results:le(a({id:m(),label:m(),url:m()}))});async function wi(e){let{repo:t,token:n,host:r}=e;return(await b(new URL(`core/repository/preview_configs`,Ai(t,r)),{credentials:{"prismic-auth":n},schema:Ci})).results}async function Ti(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`previews/new`,Ai(n,i)),{method:`POST`,body:{name:e.name,websiteURL:e.websiteURL,resolverPath:e.resolverPath},credentials:{"prismic-auth":r}})}async function Ei(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`previews/delete/${e}`,Ai(n,i)),{method:`POST`,body:{},credentials:{"prismic-auth":r}})}const Di=a({simulator_url:s(m())});async function Oi(e){let{repo:t,token:n,host:r}=e;return(await b(new URL(`core/repository`,Ai(t,r)),{credentials:{"prismic-auth":n},schema:Di})).simulator_url}async function ki(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`core/repository`,Ai(n,i)),{method:`PATCH`,body:{simulator_url:e},credentials:{"prismic-auth":r}})}function Ai(e,t){return new URL(`https://${e}.${t}/`)}var ji=T({name:`prismic preview add`,description:`
224
+ `,positionals:{code:{description:`Locale code (e.g. en-us, fr-fr)`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w(),o=await di({repo:r,token:i,host:a}),s=o.find(e=>e.id===n);if(!s)throw new E(`Locale "${n}" not found. Available locales: ${o.map(e=>e.id).join(`, `)}`);if(s.isMaster)throw new E(`Locale "${n}" is already the master.`);try{await fi({id:s.id,isMaster:!0,customName:s.customName??void 0},{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to set master locale: ${await e.text()}`):e}console.info(`Master locale set: ${n}`)}),yi=wt({name:`prismic locale`,description:`Manage locales in a Prismic repository.`,commands:{add:{handler:hi,description:`Add a locale`},list:{handler:gi,description:`List locales`},remove:{handler:_i,description:`Remove a locale`},"set-master":{handler:vi,description:`Set the master locale`}}}),bi=T({name:`prismic login`,description:`Log in to Prismic via browser.`,options:{"no-browser":{type:`boolean`,description:`Skip opening the browser automatically`}}},async({values:e})=>{let{"no-browser":t}=e,{email:n}=await vt({onReady:e=>{t?console.info(`Open this URL to log in: ${e}`):(console.info(`Opening browser to complete login...`),console.info(`If the browser doesn't open, visit: ${e}`),xi(e))}});console.info(`Logged in to Prismic as ${n}`)});function xi(e){Ae(`${process.platform===`darwin`?`open`:process.platform===`win32`?`start`:`xdg-open`} "${e.toString()}"`)}var Si=T({name:`prismic logout`,description:`Log out of Prismic.`},async()=>{if(await ht())console.info(`Logged out of Prismic`);else throw new E(`Logout failed. You can log out manually by deleting the file.`)});const Ci=a({results:le(a({id:m(),label:m(),url:m()}))});async function wi(e){let{repo:t,token:n,host:r}=e;return(await b(new URL(`core/repository/preview_configs`,Ai(t,r)),{credentials:{"prismic-auth":n},schema:Ci})).results}async function Ti(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`previews/new`,Ai(n,i)),{method:`POST`,body:{name:e.name,websiteURL:e.websiteURL,resolverPath:e.resolverPath},credentials:{"prismic-auth":r}})}async function Ei(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`previews/delete/${e}`,Ai(n,i)),{method:`POST`,body:{},credentials:{"prismic-auth":r}})}const Di=a({simulator_url:s(m())});async function Oi(e){let{repo:t,token:n,host:r}=e;return(await b(new URL(`core/repository`,Ai(t,r)),{credentials:{"prismic-auth":n},schema:Di})).simulator_url}async function ki(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`core/repository`,Ai(n,i)),{method:`PATCH`,body:{simulator_url:e},credentials:{"prismic-auth":r}})}function Ai(e,t){return new URL(`https://${e}.${t}/`)}var ji=T({name:`prismic preview add`,description:`
225
225
  Add a preview configuration to a Prismic repository.
226
226
 
227
227
  By default, this command reads the repository from prismic.config.json at the
228
228
  project root.
229
- `,positionals:{url:{description:`Preview URL (e.g. https://example.com/api/preview)`}},options:{name:{type:`string`,short:`n`,description:`Display name (defaults to hostname)`},repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),name:i}=t;if(!n)throw new E(`Missing required argument: <url>`);let a;try{a=new URL(n)}catch{throw new E(`Invalid URL: ${n}`)}let o=i||a.hostname,s=`${a.protocol}//${a.host}`,c=a.pathname===`/`?void 0:a.pathname,l=await C(),u=await w();try{await Ti({name:o,websiteURL:s,resolverPath:c},{repo:r,token:l,host:u})}catch(e){throw e instanceof x?new E(`Failed to add preview: ${await e.text()}`):e}console.info(`Preview added: ${n}`)}),Mi=T({name:`prismic preview list`,description:`
229
+ `,positionals:{url:{description:`Preview URL (e.g. https://example.com/api/preview)`,required:!0}},options:{name:{type:`string`,short:`n`,description:`Display name (defaults to hostname)`},repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),name:i}=t,a;try{a=new URL(n)}catch{throw new E(`Invalid URL: ${n}`)}let o=i||a.hostname,s=`${a.protocol}//${a.host}`,c=a.pathname===`/`?void 0:a.pathname,l=await C(),u=await w();try{await Ti({name:o,websiteURL:s,resolverPath:c},{repo:r,token:l,host:u})}catch(e){throw e instanceof x?new E(`Failed to add preview: ${await e.text()}`):e}console.info(`Preview added: ${n}`)}),Mi=T({name:`prismic preview list`,description:`
230
230
  List all preview configurations in a Prismic repository.
231
231
 
232
232
  By default, this command reads the repository from prismic.config.json at the
@@ -236,7 +236,7 @@ await Promise.allSettled([
236
236
 
237
237
  By default, this command reads the repository from prismic.config.json at the
238
238
  project root.
239
- `,positionals:{url:{description:`Preview URL to remove`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <url>`);let i=await C(),a=await w(),o=(await wi({repo:r,token:i,host:a})).find(e=>e.url===n);if(!o)throw new E(`Preview not found: ${n}`);try{await Ei(o.id,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to remove preview: ${await e.text()}`):e}console.info(`Preview removed: ${n}`)}),Pi=T({name:`prismic preview set-simulator`,description:`
239
+ `,positionals:{url:{description:`Preview URL to remove`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w(),o=(await wi({repo:r,token:i,host:a})).find(e=>e.url===n);if(!o)throw new E(`Preview not found: ${n}`);try{await Ei(o.id,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to remove preview: ${await e.text()}`):e}console.info(`Preview removed: ${n}`)}),Pi=T({name:`prismic preview set-simulator`,description:`
240
240
  Set the slice simulator URL for a Prismic repository.
241
241
 
242
242
  If the URL pathname does not end with /slice-simulator, it is appended
@@ -244,17 +244,17 @@ await Promise.allSettled([
244
244
 
245
245
  By default, this command reads the repository from prismic.config.json at the
246
246
  project root.
247
- `,positionals:{url:{description:`Simulator URL (e.g. https://example.com/slice-simulator)`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <url>`);let i;try{i=new URL(n)}catch{throw new E(`Invalid URL: ${n}`)}i.pathname.endsWith(`/slice-simulator`)||(i.pathname=i.pathname.replace(/\/+$/,``)+`/slice-simulator`);let a=i.toString(),o=await C(),s=await w();try{await ki(a,{repo:r,token:o,host:s})}catch(e){throw e instanceof x?new E(`Failed to set simulator URL: ${await e.text()}`):e}console.info(`Simulator URL set: ${a}`)}),Fi=wt({name:`prismic preview`,description:`Manage preview configurations in a Prismic repository.`,commands:{add:{handler:ji,description:`Add a preview configuration`},list:{handler:Mi,description:`List preview configurations`},remove:{handler:Ni,description:`Remove a preview configuration`},"set-simulator":{handler:Pi,description:`Set the slice simulator URL`}}});const Ii=a({documentsPublished:e(),documentsUnpublished:e(),releasesCreated:e(),releasesUpdated:e(),tagsCreated:e(),tagsDeleted:e()}),Li=Object.keys(Ii.shape),Ri=a({config:_(Ii,{_id:m(),url:m(),active:e(),name:d(m()),secret:d(m()),headers:l(m(),m())})});async function zi(e){let{repo:t,token:n,host:r}=e,i=I(t,r);return await b(new URL(`app/settings/webhooks`,i),{credentials:{"prismic-auth":n},schema:le(Ri)})}async function Bi(e,t){let{repo:n,token:r,host:i}=t,a=I(n,i),o=new URL(`app/settings/webhooks/create`,a),s=new FormData;s.set(`url`,e.url),s.set(`name`,e.name??``),s.set(`secret`,e.secret??``),s.set(`headers`,JSON.stringify({})),s.set(`active`,`on`),s.set(`documentsPublished`,e.documentsPublished.toString()),s.set(`documentsUnpublished`,e.documentsUnpublished.toString()),s.set(`releasesCreated`,e.releasesCreated.toString()),s.set(`releasesUpdated`,e.releasesUpdated.toString()),s.set(`tagsCreated`,e.tagsCreated.toString()),s.set(`tagsDeleted`,e.tagsDeleted.toString()),await b(o,{method:`POST`,body:s,credentials:{"prismic-auth":r}})}async function Vi(e,t,n){let{repo:r,token:i,host:a}=n,o=I(r,a),s=new URL(`app/settings/webhooks/${e}`,o),c=new FormData;c.set(`url`,t.url),c.set(`name`,t.name??``),c.set(`secret`,t.secret??``),c.set(`headers`,JSON.stringify(t.headers??{})),c.set(`active`,t.active?`on`:`off`),c.set(`documentsPublished`,t.documentsPublished.toString()),c.set(`documentsUnpublished`,t.documentsUnpublished.toString()),c.set(`releasesCreated`,t.releasesCreated.toString()),c.set(`releasesUpdated`,t.releasesUpdated.toString()),c.set(`tagsCreated`,t.tagsCreated.toString()),c.set(`tagsDeleted`,t.tagsDeleted.toString()),await b(s,{method:`POST`,body:c,credentials:{"prismic-auth":i}})}async function Hi(e,t){let{repo:n,token:r,host:i}=t,a=I(n,i);await b(new URL(`app/settings/webhooks/${e}/delete`,a),{method:`POST`,credentials:{"prismic-auth":r}})}const Ui=a({id:m(),scope:m(),token:m(),created_at:a({$date:p()})}),Wi=a({id:m(),name:m(),wroom_auths:le(Ui)}),Gi=a({app_name:m(),token:m(),timestamp:p()}),Ki=a({max_tokens:p(),tokens:le(Gi)});async function qi(e){return await b(new URL(`settings/security/contentapi`,I(e.repo,e.host)),{credentials:{"prismic-auth":e.token},schema:le(Wi)})}async function Ji(e,t){return await b(new URL(`settings/security/oauthapp`,I(t.repo,t.host)),{method:`POST`,body:{app_name:e},credentials:{"prismic-auth":t.token},schema:Wi})}async function Yi(e,t,n){return await b(new URL(`settings/security/authorizations`,I(n.repo,n.host)),{method:`POST`,body:{app:e,scope:t},credentials:{"prismic-auth":n.token},schema:Ui})}async function Xi(e,t){await b(new URL(`settings/security/authorizations/${encodeURIComponent(e)}`,I(t.repo,t.host)),{method:`DELETE`,credentials:{"prismic-auth":t.token}})}async function Zi(e){return await b(new URL(`settings/security/customtypesapi`,I(e.repo,e.host)),{credentials:{"prismic-auth":e.token},schema:Ki})}async function Qi(e,t){return await b(new URL(`settings/security/token`,I(t.repo,t.host)),{method:`POST`,body:{app_name:e},credentials:{"prismic-auth":t.token},schema:Gi})}async function $i(e,t){await b(new URL(`settings/security/token/${encodeURIComponent(e)}`,I(t.repo,t.host)),{method:`DELETE`,credentials:{"prismic-auth":t.token}})}async function ea(t){let{domain:n,token:r,host:i}=t;return await b(new URL(`app/dashboard/repositories/${n}/exists`,sa(i)),{credentials:{"prismic-auth":r},schema:e()})}async function ta(e){let{domain:t,name:n,framework:r,token:i,host:a}=e;await b(new URL(`app/dashboard/repositories`,sa(a)),{method:`POST`,body:{domain:t,name:n,framework:r,plan:`personal`},credentials:{"prismic-auth":i}})}const na=a({repository:a({api_access:m()})});async function ra(e){let{repo:t,token:n,host:r}=e;return(await b(new URL(`syncState`,I(t,r)),{credentials:{"prismic-auth":n},schema:na})).repository.api_access}async function ia(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`settings/security/apiaccess`,I(n,i)),{method:`POST`,body:{api_access:e},credentials:{"prismic-auth":r}})}const aa=a({repository:a({name:m()})});async function oa(e,t){let{repo:n,token:r,host:i}=t,a=new URL(`app/settings/repository`,I(n,i)),o=new FormData;return o.set(`displayname`,e),(await b(a,{method:`POST`,body:o,credentials:{"prismic-auth":r},schema:aa})).repository.name}function sa(e){return new URL(`https://${e}/`)}function I(e,t){return new URL(`https://${e}.${t}/`)}var ca=T({name:`prismic repo create`,description:`Create a new Prismic repository.`,options:{name:{type:`string`,short:`n`,description:`Display name for the repository`}}},async({values:e})=>{let{name:t}=e,n=await C(),r=await w(),i=await la({token:n,host:r});if(!i)throw new E(`Failed to create a repository. Please try again.`);let a=(await ce().catch(()=>void 0))?.id??`other`;try{await ta({domain:i,name:t??i,framework:a,token:n,host:r})}catch(e){throw e instanceof x?new E(`Failed to create repository: ${await e.text()}`):e}console.info(`Repository created: ${i}`),console.info(`URL: https://${i}.${r}/`)});async function la(e){let{token:t,host:n}=e,r;for(let e=0;e<5;e++){let e=crypto.randomUUID().replace(/-/g,``).slice(0,8);if(await ea({domain:e,token:t,host:n})){r=e;break}}return r}var ua=T({name:`prismic repo list`,description:`List all Prismic repositories associated with your account.`,options:{json:{type:`boolean`,description:`Output as JSON`}}},async({values:e})=>{let{json:t}=e,r=await C(),i=await w(),a;try{a=await xt({token:r,host:i})}catch(e){throw e instanceof x?new E(`Failed to list repositories: ${await e.text()}`):e}let o=a.repositories;if(t){console.info(n(o.map(e=>({domain:e.domain,name:e.name??null,role:e.role??null,url:`https://${e.domain}.${i}/`}))));return}if(o.length===0){console.info(`No repositories found.`);return}for(let e of o){let t=e.name||`(no name)`,n=e.role?` ${e.role}`:``;console.info(`${e.domain} ${t}${n}`)}});const da=[`private`,`public`,`open`];var fa=T({name:`prismic repo set-api-access`,description:`
247
+ `,positionals:{url:{description:`Simulator URL (e.g. https://example.com/slice-simulator)`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i;try{i=new URL(n)}catch{throw new E(`Invalid URL: ${n}`)}i.pathname.endsWith(`/slice-simulator`)||(i.pathname=i.pathname.replace(/\/+$/,``)+`/slice-simulator`);let a=i.toString(),o=await C(),s=await w();try{await ki(a,{repo:r,token:o,host:s})}catch(e){throw e instanceof x?new E(`Failed to set simulator URL: ${await e.text()}`):e}console.info(`Simulator URL set: ${a}`)}),Fi=wt({name:`prismic preview`,description:`Manage preview configurations in a Prismic repository.`,commands:{add:{handler:ji,description:`Add a preview configuration`},list:{handler:Mi,description:`List preview configurations`},remove:{handler:Ni,description:`Remove a preview configuration`},"set-simulator":{handler:Pi,description:`Set the slice simulator URL`}}});const Ii=a({documentsPublished:e(),documentsUnpublished:e(),releasesCreated:e(),releasesUpdated:e(),tagsCreated:e(),tagsDeleted:e()}),Li=Object.keys(Ii.shape),Ri=a({config:_(Ii,{_id:m(),url:m(),active:e(),name:d(m()),secret:d(m()),headers:l(m(),m())})});async function zi(e){let{repo:t,token:n,host:r}=e,i=I(t,r);return await b(new URL(`app/settings/webhooks`,i),{credentials:{"prismic-auth":n},schema:le(Ri)})}async function Bi(e,t){let{repo:n,token:r,host:i}=t,a=I(n,i),o=new URL(`app/settings/webhooks/create`,a),s=new FormData;s.set(`url`,e.url),s.set(`name`,e.name??``),s.set(`secret`,e.secret??``),s.set(`headers`,JSON.stringify({})),s.set(`active`,`on`),s.set(`documentsPublished`,e.documentsPublished.toString()),s.set(`documentsUnpublished`,e.documentsUnpublished.toString()),s.set(`releasesCreated`,e.releasesCreated.toString()),s.set(`releasesUpdated`,e.releasesUpdated.toString()),s.set(`tagsCreated`,e.tagsCreated.toString()),s.set(`tagsDeleted`,e.tagsDeleted.toString()),await b(o,{method:`POST`,body:s,credentials:{"prismic-auth":r}})}async function Vi(e,t,n){let{repo:r,token:i,host:a}=n,o=I(r,a),s=new URL(`app/settings/webhooks/${e}`,o),c=new FormData;c.set(`url`,t.url),c.set(`name`,t.name??``),c.set(`secret`,t.secret??``),c.set(`headers`,JSON.stringify(t.headers??{})),c.set(`active`,t.active?`on`:`off`),c.set(`documentsPublished`,t.documentsPublished.toString()),c.set(`documentsUnpublished`,t.documentsUnpublished.toString()),c.set(`releasesCreated`,t.releasesCreated.toString()),c.set(`releasesUpdated`,t.releasesUpdated.toString()),c.set(`tagsCreated`,t.tagsCreated.toString()),c.set(`tagsDeleted`,t.tagsDeleted.toString()),await b(s,{method:`POST`,body:c,credentials:{"prismic-auth":i}})}async function Hi(e,t){let{repo:n,token:r,host:i}=t,a=I(n,i);await b(new URL(`app/settings/webhooks/${e}/delete`,a),{method:`POST`,credentials:{"prismic-auth":r}})}const Ui=a({id:m(),scope:m(),token:m(),created_at:a({$date:p()})}),Wi=a({id:m(),name:m(),wroom_auths:le(Ui)}),Gi=a({app_name:m(),token:m(),timestamp:p()}),Ki=a({max_tokens:p(),tokens:le(Gi)});async function qi(e){return await b(new URL(`settings/security/contentapi`,I(e.repo,e.host)),{credentials:{"prismic-auth":e.token},schema:le(Wi)})}async function Ji(e,t){return await b(new URL(`settings/security/oauthapp`,I(t.repo,t.host)),{method:`POST`,body:{app_name:e},credentials:{"prismic-auth":t.token},schema:Wi})}async function Yi(e,t,n){return await b(new URL(`settings/security/authorizations`,I(n.repo,n.host)),{method:`POST`,body:{app:e,scope:t},credentials:{"prismic-auth":n.token},schema:Ui})}async function Xi(e,t){await b(new URL(`settings/security/authorizations/${encodeURIComponent(e)}`,I(t.repo,t.host)),{method:`DELETE`,credentials:{"prismic-auth":t.token}})}async function Zi(e){return await b(new URL(`settings/security/customtypesapi`,I(e.repo,e.host)),{credentials:{"prismic-auth":e.token},schema:Ki})}async function Qi(e,t){return await b(new URL(`settings/security/token`,I(t.repo,t.host)),{method:`POST`,body:{app_name:e},credentials:{"prismic-auth":t.token},schema:Gi})}async function $i(e,t){await b(new URL(`settings/security/token/${encodeURIComponent(e)}`,I(t.repo,t.host)),{method:`DELETE`,credentials:{"prismic-auth":t.token}})}async function ea(t){let{domain:n,token:r,host:i}=t;return await b(new URL(`app/dashboard/repositories/${n}/exists`,sa(i)),{credentials:{"prismic-auth":r},schema:e()})}async function ta(e){let{domain:t,name:n,framework:r,token:i,host:a}=e;await b(new URL(`app/dashboard/repositories`,sa(a)),{method:`POST`,body:{domain:t,name:n,framework:r,plan:`personal`},credentials:{"prismic-auth":i}})}const na=a({repository:a({api_access:m()})});async function ra(e){let{repo:t,token:n,host:r}=e;return(await b(new URL(`syncState`,I(t,r)),{credentials:{"prismic-auth":n},schema:na})).repository.api_access}async function ia(e,t){let{repo:n,token:r,host:i}=t;await b(new URL(`settings/security/apiaccess`,I(n,i)),{method:`POST`,body:{api_access:e},credentials:{"prismic-auth":r}})}const aa=a({repository:a({name:m()})});async function oa(e,t){let{repo:n,token:r,host:i}=t,a=new URL(`app/settings/repository`,I(n,i)),o=new FormData;return o.set(`displayname`,e),(await b(a,{method:`POST`,body:o,credentials:{"prismic-auth":r},schema:aa})).repository.name}function sa(e){return new URL(`https://${e}/`)}function I(e,t){return new URL(`https://${e}.${t}/`)}var ca=T({name:`prismic repo create`,description:`Create a new Prismic repository.`,options:{name:{type:`string`,short:`n`,description:`Display name for the repository`}}},async({values:e})=>{let{name:t}=e,n=await C(),r=await w(),i=await la({token:n,host:r});if(!i)throw new E(`Failed to create a repository. Please try again.`);let a=(await ce().catch(()=>void 0))?.id??`other`;try{await ta({domain:i,name:t??i,framework:a,token:n,host:r})}catch(e){throw e instanceof x?new E(`Failed to create repository: ${await e.text()}`):e}console.info(`Repository created: ${i}`),console.info(`URL: https://${i}.${r}/`)});async function la(e){let{token:t,host:n}=e,r;for(let e=0;e<5;e++){let e=crypto.randomUUID().replace(/-/g,``).slice(0,8);if(await ea({domain:e,token:t,host:n})){r=e;break}}return r}var ua=T({name:`prismic repo list`,description:`List all Prismic repositories associated with your account.`,options:{json:{type:`boolean`,description:`Output as JSON`}}},async({values:e})=>{let{json:t}=e,r=await C(),i=await w(),a;try{a=await xt({token:r,host:i})}catch(e){throw e instanceof x?new E(`Failed to list repositories: ${await e.text()}`):e}let o=a.repositories;if(t){console.info(n(o.map(e=>({domain:e.domain,name:e.name??null,role:e.role??null,url:`https://${e.domain}.${i}/`}))));return}if(o.length===0){console.info(`No repositories found.`);return}for(let e of o){let t=e.name||`(no name)`,n=e.role?` ${e.role}`:``;console.info(`${e.domain} ${t}${n}`)}});const da=[`private`,`public`,`open`];var fa=T({name:`prismic repo set-api-access`,description:`
248
248
  Set the Content API access level of a Prismic repository.
249
249
 
250
250
  By default, this command reads the repository from prismic.config.json at the
251
251
  project root.
252
- `,positionals:{level:{description:`Access level (${da.join(`, `)})`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <level>`);if(!da.includes(n))throw new E(`Invalid access level: ${n}. Must be one of: ${da.join(`, `)}`);let i=await C(),a=await w();try{await ia(n,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to set repository access: ${await e.text()}`):e}console.info(`Repository access set to: ${n}`)}),pa=T({name:`prismic repo set-name`,description:`
252
+ `,positionals:{level:{description:`Access level (${da.join(`, `)})`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!da.includes(n))throw new E(`Invalid access level: ${n}. Must be one of: ${da.join(`, `)}`);let i=await C(),a=await w();try{await ia(n,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to set repository access: ${await e.text()}`):e}console.info(`Repository access set to: ${n}`)}),pa=T({name:`prismic repo set-name`,description:`
253
253
  Set the display name of a Prismic repository.
254
254
 
255
255
  By default, this command reads the repository from prismic.config.json at the
256
256
  project root.
257
- `,positionals:{name:{description:`Display name for the repository`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <name>`);let i=await C(),a=await w(),o;try{o=await oa(n,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to set repository name: ${await e.text()}`):e}console.info(`Repository name set to: ${o}`)}),ma=T({name:`prismic repo view`,description:`
257
+ `,positionals:{name:{description:`Display name for the repository`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w(),o;try{o=await oa(n,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to set repository name: ${await e.text()}`):e}console.info(`Repository name set to: ${o}`)}),ma=T({name:`prismic repo view`,description:`
258
258
  View details of a Prismic repository.
259
259
 
260
260
  By default, this command reads the repository from prismic.config.json at the
@@ -269,7 +269,7 @@ await Promise.allSettled([
269
269
 
270
270
  By default, this command reads the repository from prismic.config.json at the
271
271
  project root.
272
- `,positionals:{token:{description:`Token value`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <token>`);let i=await C(),a=await w(),[o,s]=await Promise.all([qi({repo:r,token:i,host:a}),Zi({repo:r,token:i,host:a})]),c=o.flatMap(e=>e.wroom_auths).find(e=>e.token===n);if(c){await Xi(c.id,{repo:r,token:i,host:a}),console.info(`Token deleted`);return}let l=s.tokens.find(e=>e.token===n);if(l){await $i(l.token,{repo:r,token:i,host:a}),console.info(`Token deleted`);return}throw new E(`Token not found: ${n}`)}),ya=wt({name:`prismic token`,description:`Manage API tokens for a Prismic repository.`,commands:{list:{handler:T({name:`prismic token list`,description:`
272
+ `,positionals:{token:{description:`Token value`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w(),[o,s]=await Promise.all([qi({repo:r,token:i,host:a}),Zi({repo:r,token:i,host:a})]),c=o.flatMap(e=>e.wroom_auths).find(e=>e.token===n);if(c){await Xi(c.id,{repo:r,token:i,host:a}),console.info(`Token deleted`);return}let l=s.tokens.find(e=>e.token===n);if(l){await $i(l.token,{repo:r,token:i,host:a}),console.info(`Token deleted`);return}throw new E(`Token not found: ${n}`)}),ya=wt({name:`prismic token`,description:`Manage API tokens for a Prismic repository.`,commands:{list:{handler:T({name:`prismic token list`,description:`
273
273
  List all API tokens for a Prismic repository.
274
274
 
275
275
  By default, this command reads the repository from prismic.config.json at the
@@ -279,7 +279,7 @@ await Promise.allSettled([
279
279
 
280
280
  By default, this command reads the repository from prismic.config.json at the
281
281
  project root.
282
- `,positionals:{url:{description:`Webhook URL to receive events`}},options:{name:{type:`string`,short:`n`,description:`Webhook name`},secret:{type:`string`,short:`s`,description:`Secret for webhook signature`},trigger:{type:`string`,multiple:!0,short:`t`,description:`Trigger events (can be repeated)`},repo:{type:`string`,short:`r`,description:`Repository domain`}},sections:{TRIGGERS:`
282
+ `,positionals:{url:{description:`Webhook URL to receive events`,required:!0}},options:{name:{type:`string`,short:`n`,description:`Webhook name`},secret:{type:`string`,short:`s`,description:`Secret for webhook signature`},trigger:{type:`string`,multiple:!0,short:`t`,description:`Trigger events (can be repeated)`},repo:{type:`string`,short:`r`,description:`Repository domain`}},sections:{TRIGGERS:`
283
283
  documentsPublished When documents are published
284
284
  documentsUnpublished When documents are unpublished
285
285
  releasesCreated When a release is created
@@ -288,17 +288,17 @@ await Promise.allSettled([
288
288
  tagsDeleted When a tag is deleted
289
289
 
290
290
  If no triggers specified, all are enabled.
291
- `}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),name:i,secret:a,trigger:o=[]}=t;if(!n)throw new E(`Missing required argument: <url>`);for(let e of o)if(!Li.includes(e))throw new E(`Invalid trigger: ${e}\nValid triggers: ${Li.join(`, `)}`);let s=await C(),c=await w(),l=!(o.length>0);try{await Bi({url:n,name:i??null,secret:a??null,documentsPublished:o.includes(`documentsPublished`)||l,documentsUnpublished:o.includes(`documentsUnpublished`)||l,releasesCreated:o.includes(`releasesCreated`)||l,releasesUpdated:o.includes(`releasesUpdated`)||l,tagsCreated:o.includes(`tagsCreated`)||l,tagsDeleted:o.includes(`tagsDeleted`)||l},{repo:r,token:s,host:c})}catch(e){throw e instanceof x?new E(`Failed to create webhook: ${await e.text()}`):e}console.info(`Webhook created: ${n}`)}),xa=T({name:`prismic webhook disable`,description:`
291
+ `}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),name:i,secret:a,trigger:o=[]}=t;for(let e of o)if(!Li.includes(e))throw new E(`Invalid trigger: ${e}\nValid triggers: ${Li.join(`, `)}`);let s=await C(),c=await w(),l=!(o.length>0);try{await Bi({url:n,name:i??null,secret:a??null,documentsPublished:o.includes(`documentsPublished`)||l,documentsUnpublished:o.includes(`documentsUnpublished`)||l,releasesCreated:o.includes(`releasesCreated`)||l,releasesUpdated:o.includes(`releasesUpdated`)||l,tagsCreated:o.includes(`tagsCreated`)||l,tagsDeleted:o.includes(`tagsDeleted`)||l},{repo:r,token:s,host:c})}catch(e){throw e instanceof x?new E(`Failed to create webhook: ${await e.text()}`):e}console.info(`Webhook created: ${n}`)}),xa=T({name:`prismic webhook disable`,description:`
292
292
  Disable a webhook in a Prismic repository.
293
293
 
294
294
  By default, this command reads the repository from prismic.config.json at the
295
295
  project root.
296
- `,positionals:{url:{description:`Webhook URL`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <url>`);let i=await C(),a=await w(),o=(await zi({repo:r,token:i,host:a})).find(e=>e.config.url===n);if(!o)throw new E(`Webhook not found: ${n}`);if(!o.config.active){console.info(`Webhook already disabled: ${n}`);return}let s=o.config._id,c=structuredClone(o.config);c.active=!1;try{await Vi(s,c,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to disable webhook: ${await e.text()}`):e}console.info(`Webhook disabled: ${n}`)}),Sa=T({name:`prismic webhook enable`,description:`
296
+ `,positionals:{url:{description:`Webhook URL`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w(),o=(await zi({repo:r,token:i,host:a})).find(e=>e.config.url===n);if(!o)throw new E(`Webhook not found: ${n}`);if(!o.config.active){console.info(`Webhook already disabled: ${n}`);return}let s=o.config._id,c=structuredClone(o.config);c.active=!1;try{await Vi(s,c,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to disable webhook: ${await e.text()}`):e}console.info(`Webhook disabled: ${n}`)}),Sa=T({name:`prismic webhook enable`,description:`
297
297
  Enable a webhook in a Prismic repository.
298
298
 
299
299
  By default, this command reads the repository from prismic.config.json at the
300
300
  project root.
301
- `,positionals:{url:{description:`Webhook URL`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <url>`);let i=await C(),a=await w(),o=(await zi({repo:r,token:i,host:a})).find(e=>e.config.url===n);if(!o)throw new E(`Webhook not found: ${n}`);if(o.config.active){console.info(`Webhook already enabled: ${n}`);return}let s=o.config._id,c=structuredClone(o.config);c.active=!0;try{await Vi(s,c,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to enable webhook: ${await e.text()}`):e}console.info(`Webhook enabled: ${n}`)}),Ca=T({name:`prismic webhook list`,description:`
301
+ `,positionals:{url:{description:`Webhook URL`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w(),o=(await zi({repo:r,token:i,host:a})).find(e=>e.config.url===n);if(!o)throw new E(`Webhook not found: ${n}`);if(o.config.active){console.info(`Webhook already enabled: ${n}`);return}let s=o.config._id,c=structuredClone(o.config);c.active=!0;try{await Vi(s,c,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to enable webhook: ${await e.text()}`):e}console.info(`Webhook enabled: ${n}`)}),Ca=T({name:`prismic webhook list`,description:`
302
302
  List all webhooks in a Prismic repository.
303
303
 
304
304
  By default, this command reads the repository from prismic.config.json at the
@@ -308,24 +308,24 @@ await Promise.allSettled([
308
308
 
309
309
  By default, this command reads the repository from prismic.config.json at the
310
310
  project root.
311
- `,positionals:{url:{description:`Webhook URL`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <url>`);let i=await C(),a=await w(),o=(await zi({repo:r,token:i,host:a})).find(e=>e.config.url===n);if(!o)throw new E(`Webhook not found: ${n}`);let s=o.config._id;try{await Hi(s,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to remove webhook: ${await e.text()}`):e}console.info(`Webhook removed: ${n}`)}),Ta=T({name:`prismic webhook set-triggers`,description:`
311
+ `,positionals:{url:{description:`Webhook URL`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=await C(),a=await w(),o=(await zi({repo:r,token:i,host:a})).find(e=>e.config.url===n);if(!o)throw new E(`Webhook not found: ${n}`);let s=o.config._id;try{await Hi(s,{repo:r,token:i,host:a})}catch(e){throw e instanceof x?new E(`Failed to remove webhook: ${await e.text()}`):e}console.info(`Webhook removed: ${n}`)}),Ta=T({name:`prismic webhook set-triggers`,description:`
312
312
  Update which events trigger a webhook.
313
313
 
314
314
  By default, this command reads the repository from prismic.config.json at the
315
315
  project root.
316
- `,positionals:{url:{description:`Webhook URL`}},options:{trigger:{type:`string`,multiple:!0,short:`t`,description:`Trigger events (can be repeated, at least one required)`},repo:{type:`string`,short:`r`,description:`Repository domain`}},sections:{TRIGGERS:`
316
+ `,positionals:{url:{description:`Webhook URL`,required:!0}},options:{trigger:{type:`string`,multiple:!0,short:`t`,description:`Trigger events (can be repeated)`,required:!0},repo:{type:`string`,short:`r`,description:`Repository domain`}},sections:{TRIGGERS:`
317
317
  documentsPublished When documents are published
318
318
  documentsUnpublished When documents are unpublished
319
319
  releasesCreated When a release is created
320
320
  releasesUpdated When a release is edited or deleted
321
321
  tagsCreated When a tag is created
322
322
  tagsDeleted When a tag is deleted
323
- `}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),trigger:i=[]}=t;if(!n)throw new E(`Missing required argument: <url>`);if(i.length===0)throw new E(`Missing required option: --trigger`);for(let e of i)if(!Li.includes(e))throw new E(`Invalid trigger: ${e}\nValid triggers: ${Li.join(`, `)}`);let a=await C(),o=await w(),s=(await zi({repo:r,token:a,host:o})).find(e=>e.config.url===n);if(!s)throw new E(`Webhook not found: ${n}`);let c=s.config._id;try{await Vi(c,{...s.config,documentsPublished:i.includes(`documentsPublished`),documentsUnpublished:i.includes(`documentsUnpublished`),releasesCreated:i.includes(`releasesCreated`),releasesUpdated:i.includes(`releasesUpdated`),tagsCreated:i.includes(`tagsCreated`),tagsDeleted:i.includes(`tagsDeleted`)},{repo:r,token:a,host:o})}catch(e){throw e instanceof x?new E(`Failed to update webhook triggers: ${await e.text()}`):e}console.info(`Webhook triggers updated: ${i.join(`, `)}`)}),Ea=T({name:`prismic webhook view`,description:`
323
+ `}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v(),trigger:i=[]}=t;for(let e of i)if(!Li.includes(e))throw new E(`Invalid trigger: ${e}\nValid triggers: ${Li.join(`, `)}`);let a=await C(),o=await w(),s=(await zi({repo:r,token:a,host:o})).find(e=>e.config.url===n);if(!s)throw new E(`Webhook not found: ${n}`);let c=s.config._id;try{await Vi(c,{...s.config,documentsPublished:i.includes(`documentsPublished`),documentsUnpublished:i.includes(`documentsUnpublished`),releasesCreated:i.includes(`releasesCreated`),releasesUpdated:i.includes(`releasesUpdated`),tagsCreated:i.includes(`tagsCreated`),tagsDeleted:i.includes(`tagsDeleted`)},{repo:r,token:a,host:o})}catch(e){throw e instanceof x?new E(`Failed to update webhook triggers: ${await e.text()}`):e}console.info(`Webhook triggers updated: ${i.join(`, `)}`)}),Ea=T({name:`prismic webhook view`,description:`
324
324
  View details of a webhook in a Prismic repository.
325
325
 
326
326
  By default, this command reads the repository from prismic.config.json at the
327
327
  project root.
328
- `,positionals:{url:{description:`Webhook URL`}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t;if(!n)throw new E(`Missing required argument: <url>`);let i=(await zi({repo:r,token:await C(),host:await w()})).find(e=>e.config.url===n);if(!i)throw new E(`Webhook not found: ${n}`);let{config:a}=i;console.info(`URL: ${a.url}`),console.info(`Name: ${a.name||`(none)`}`),console.info(`Status: ${a.active?`enabled`:`disabled`}`),console.info(`Secret: ${a.secret?`(set)`:`(none)`}`);let o=[];for(let e of Li)a[e]&&o.push(e);if(console.info(`Triggers: ${o.length>0?o.join(`, `):`(none)`}`),Object.keys(a.headers).length>0){console.info(`Headers:`);for(let[e,t]of Object.entries(a.headers))console.info(` ${e}: ${t}`)}else console.info(`Headers: (none)`)}),Da=wt({name:`prismic webhook`,description:`Manage webhooks in a Prismic repository.`,commands:{list:{handler:Ca,description:`List all webhooks`},create:{handler:ba,description:`Create a new webhook`},view:{handler:Ea,description:`View webhook details`},remove:{handler:wa,description:`Delete a webhook`},enable:{handler:Sa,description:`Enable a webhook`},disable:{handler:xa,description:`Disable a webhook`},"set-triggers":{handler:Ta,description:`Update webhook triggers`}}}),Oa=T({name:`prismic whoami`,description:`Show the currently logged in user.`},async()=>{let e=await xt({token:await C(),host:await w()});console.info(e.email)});const L=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,R=globalThis,ka=`10.42.0`;function z(){return Aa(R),R}function Aa(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||ka,t[ka]=t[ka]||{}}function ja(e,t,n=R){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[ka]=r[ka]||{};return i[e]||(i[e]=t())}const Ma=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],Na={};function B(e){if(!(`console`in R))return e();let t=R.console,n={},r=Object.keys(Na);r.forEach(e=>{let r=Na[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Pa(){Va().enabled=!0}function Fa(){Va().enabled=!1}function Ia(){return Va().enabled}function La(...e){Ba(`log`,...e)}function Ra(...e){Ba(`warn`,...e)}function za(...e){Ba(`error`,...e)}function Ba(e,...t){L&&Ia()&&B(()=>{R.console[e](`Sentry Logger [${e}]:`,...t)})}function Va(){return L?ja(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}const V={enable:Pa,disable:Fa,isEnabled:Ia,log:La,warn:Ra,error:za},Ha=/\(error: (.*)\)/,Ua=/captureMessage|captureException/;function Wa(...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(`
328
+ `,positionals:{url:{description:`Webhook URL`,required:!0}},options:{repo:{type:`string`,short:`r`,description:`Repository domain`}}},async({positionals:e,values:t})=>{let[n]=e,{repo:r=await v()}=t,i=(await zi({repo:r,token:await C(),host:await w()})).find(e=>e.config.url===n);if(!i)throw new E(`Webhook not found: ${n}`);let{config:a}=i;console.info(`URL: ${a.url}`),console.info(`Name: ${a.name||`(none)`}`),console.info(`Status: ${a.active?`enabled`:`disabled`}`),console.info(`Secret: ${a.secret?`(set)`:`(none)`}`);let o=[];for(let e of Li)a[e]&&o.push(e);if(console.info(`Triggers: ${o.length>0?o.join(`, `):`(none)`}`),Object.keys(a.headers).length>0){console.info(`Headers:`);for(let[e,t]of Object.entries(a.headers))console.info(` ${e}: ${t}`)}else console.info(`Headers: (none)`)}),Da=wt({name:`prismic webhook`,description:`Manage webhooks in a Prismic repository.`,commands:{list:{handler:Ca,description:`List all webhooks`},create:{handler:ba,description:`Create a new webhook`},view:{handler:Ea,description:`View webhook details`},remove:{handler:wa,description:`Delete a webhook`},enable:{handler:Sa,description:`Enable a webhook`},disable:{handler:xa,description:`Disable a webhook`},"set-triggers":{handler:Ta,description:`Update webhook triggers`}}}),Oa=T({name:`prismic whoami`,description:`Show the currently logged in user.`},async()=>{let e=await xt({token:await C(),host:await w()});console.info(e.email)});const L=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,R=globalThis,ka=`10.42.0`;function z(){return Aa(R),R}function Aa(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||ka,t[ka]=t[ka]||{}}function ja(e,t,n=R){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[ka]=r[ka]||{};return i[e]||(i[e]=t())}const Ma=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],Na={};function B(e){if(!(`console`in R))return e();let t=R.console,n={},r=Object.keys(Na);r.forEach(e=>{let r=Na[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Pa(){Va().enabled=!0}function Fa(){Va().enabled=!1}function Ia(){return Va().enabled}function La(...e){Ba(`log`,...e)}function Ra(...e){Ba(`warn`,...e)}function za(...e){Ba(`error`,...e)}function Ba(e,...t){L&&Ia()&&B(()=>{R.console[e](`Sentry Logger [${e}]:`,...t)})}function Va(){return L?ja(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}const V={enable:Pa,disable:Fa,isEnabled:Ia,log:La,warn:Ra,error:za},Ha=/\(error: (.*)\)/,Ua=/captureMessage|captureException/;function Wa(...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(`
329
329
  `);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=Ha.test(n)?n.replace(Ha,`$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 Ka(i.slice(r))}}function Ga(e){return Array.isArray(e)?Wa(...e):e}function Ka(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(qa(t).function||``)&&t.pop(),t.reverse(),Ua.test(qa(t).function||``)&&(t.pop(),Ua.test(qa(t).function||``)&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||qa(t).filename,function:e.function||`?`}))}function qa(e){return e[e.length-1]||{}}const Ja=`<anonymous>`;function Ya(e){try{return!e||typeof e!=`function`?Ja:e.name||Ja}catch{return Ja}}function Xa(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}function Za(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}const Qa={},$a={};function eo(e,t){Qa[e]=Qa[e]||[],Qa[e].push(t)}function to(e,t){if(!$a[e]){$a[e]=!0;try{t()}catch(t){L&&V.error(`Error while instrumenting ${e}`,t)}}}function no(e,t){let n=e&&Qa[e];if(n)for(let r of n)try{r(t)}catch(t){L&&V.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ya(r)}\nError:`,t)}}let ro=null;function io(e){let t=`error`;eo(t,e),to(t,ao)}function ao(){ro=R.onerror,R.onerror=function(e,t,n,r,i){return no(`error`,{column:r,error:i,line:n,msg:e,url:t}),ro?ro.apply(this,arguments):!1},R.onerror.__SENTRY_INSTRUMENTED__=!0}let oo=null;function so(e){let t=`unhandledrejection`;eo(t,e),to(t,co)}function co(){oo=R.onunhandledrejection,R.onunhandledrejection=function(e){return no(`unhandledrejection`,e),oo?oo.apply(this,arguments):!0},R.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const lo=Object.prototype.toString;function uo(e){switch(lo.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return Co(e,Error)}}function fo(e,t){return lo.call(e)===`[object ${t}]`}function po(e){return fo(e,`ErrorEvent`)}function mo(e){return fo(e,`String`)}function ho(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function go(e){return e===null||ho(e)||typeof e!=`object`&&typeof e!=`function`}function _o(e){return fo(e,`Object`)}function vo(e){return typeof Event<`u`&&Co(e,Event)}function yo(e){return typeof Element<`u`&&Co(e,Element)}function bo(e){return fo(e,`RegExp`)}function xo(e){return!!(e?.then&&typeof e.then==`function`)}function So(e){return _o(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function Co(e,t){try{return e instanceof t}catch{return!1}}function wo(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}const To=R;function Eo(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=Do(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 Do(e,t){let n=e,r=[];if(!n?.tagName)return``;if(To.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&&mo(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 Oo(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&Ao(i,r);try{e[t]=i}catch{L&&V.log(`Failed to replace method "${t}" in object`,e)}}function ko(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{L&&V.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Ao(e,t){try{e.prototype=t.prototype=t.prototype||{},ko(e,`__sentry_original__`,t)}catch{}}function jo(e){return e.__sentry_original__}function Mo(e){if(uo(e))return{message:e.message,name:e.name,stack:e.stack,...Po(e)};if(vo(e)){let t={type:e.type,target:No(e.target),currentTarget:No(e.currentTarget),...Po(e)};return typeof CustomEvent<`u`&&Co(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function No(e){try{return yo(e)?Eo(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Po(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 Fo(e){let t=Object.keys(Mo(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}let Io;function Lo(e){if(Io!==void 0)return Io?Io(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=R;return t in n&&typeof n[t]==`function`?(Io=n[t],Io(e)):(Io=null,e())}function H(){return Lo(()=>Math.random())}function Ro(){return Lo(()=>Date.now())}function zo(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Bo(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 Vo(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{wo(r)?n.push(Xa(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function Ho(e,t,n=!1){return mo(e)?bo(t)?t.test(e):mo(t)?n?e===t:e.includes(t):!1:!1}function Uo(e,t=[],n=!1){return t.some(t=>Ho(e,t,n))}function Wo(){let e=R;return e.crypto||e.msCrypto}let Go;function Ko(){return H()*16}function U(e=Wo()){try{if(e?.randomUUID)return Lo(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Go||=`10000000100040008000100000000000`,Go.replace(/[018]/g,e=>(e^(Ko()&15)>>e/4).toString(16))}function qo(e){return e.exception?.values?.[0]}function Jo(e){let{message:t,event_id:n}=e;if(t)return t;let r=qo(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Yo(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 Xo(e,t){let n=qo(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 Zo=/^(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 Qo(e){return parseInt(e||``,10)}function $o(e){let t=e.match(Zo)||[],n=Qo(t[1]),r=Qo(t[2]),i=Qo(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 es(e){if(ts(e))return!0;try{ko(e,`__sentry_captured__`,!0)}catch{}return!1}function ts(e){try{return e.__sentry_captured__}catch{}}const ns=1e3;function rs(){return Ro()/ns}function is(){let{performance:e}=R;if(!e?.now||!e.timeOrigin)return rs;let t=e.timeOrigin;return()=>(t+Lo(()=>e.now()))/ns}let as;function os(){return(as??=is())()}function ss(e){let t=os(),n={sid:U(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>us(n)};return e&&cs(n,e),n}function cs(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||os(),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:U()),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 ls(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),cs(e,n)}function us(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 ds(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]=ds(r[e],t[e],n-1));return r}function fs(){return U()}function ps(){return U().substring(16)}const ms=`_sentrySpan`;function hs(e,t){t?ko(e,ms,t):delete e[ms]}function gs(e){return e[ms]}var _s=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:fs(),sampleRand:H()}}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,hs(t,gs(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&&cs(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():_o(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,hs(this,void 0),this._attachments=[],this.setPropagationContext({traceId:fs(),sampleRand:H()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:100;if(n<=0)return this;let r={timestamp:rs(),...e,message:e.message?zo(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:gs(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ds(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||U();if(!this._client)return L&&V.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||U();if(!this._client)return L&&V.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||U();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(L&&V.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 vs(){return ja(`defaultCurrentScope`,()=>new _s)}function ys(){return ja(`defaultIsolationScope`,()=>new _s)}var bs=class{constructor(e,t){let n;n=e||new _s;let r;r=t||new _s,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 xo(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 xs(){let e=Aa(z());return e.stack=e.stack||new bs(vs(),ys())}function Ss(e){return xs().withScope(e)}function Cs(e,t){let n=xs();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function ws(e){return xs().withScope(()=>e(xs().getIsolationScope()))}function Ts(){return{withIsolationScope:ws,withScope:Ss,withSetScope:Cs,withSetIsolationScope:(e,t)=>ws(t),getCurrentScope:()=>xs().getScope(),getIsolationScope:()=>xs().getIsolationScope()}}function Es(e){let t=Aa(z());t.acs=e}function W(e){let t=Aa(e);return t.acs?t.acs:Ts()}function G(){return W(z()).getCurrentScope()}function K(){return W(z()).getIsolationScope()}function Ds(){return ja(`globalScope`,()=>new _s)}function Os(...e){let t=W(z());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function ks(...e){let t=W(z());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function q(){return G().getClient()}function As(e){let{traceId:t,parentSpanId:n,propagationSpanId:r}=e.getPropagationContext(),i={trace_id:t,span_id:r||ps()};return n&&(i.parent_span_id=n),i}const js=`sentry.profile_id`,Ms=`sentry.exclusive_time`;function Ns(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}function Ps(e){let t=e;return{scope:t._sentryScope,isolationScope:Ns(t._sentryIsolationScope)}}const Fs=/^sentry-/;function Is(e){let t=Rs(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.match(Fs)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function Ls(e){if(e)return Bs(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`sentry-${t}`]=n),e),{}))}function Rs(e){if(!(!e||!mo(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=zs(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):zs(e)}function zs(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 Bs(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?(L&&V.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}const Vs=/^o(\d+)\./,Hs=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Us(e){return e===`http`||e===`https`}function Ws(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 Gs(e){let t=Hs.exec(e);if(!t){B(()=>{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 Ks({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function Ks(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function qs(e){if(!L)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(V.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?Us(r)?t&&isNaN(parseInt(t,10))?(V.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(V.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(V.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Js(e){return e.match(Vs)?.[1]}function Ys(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Js(n)),r}function Xs(e){let t=typeof e==`string`?Gs(e):Ks(e);if(!(!t||!qs(t)))return t}function Zs(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 Qs=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function $s(e){if(!e)return;let t=e.match(Qs);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 ec(e,t){let n=$s(e),r=Is(t);if(!n?.traceId)return{traceId:fs(),sampleRand:H()};let i=rc(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 tc(e=fs(),t=ps(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function nc(e=fs(),t=ps(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function rc(e,t){let n=Zs(t?.sample_rand);if(n!==void 0)return n;let r=Zs(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?H()*r:r+H()*(1-r):H()}function ic(e,t){let n=Ys(e);return t&&n&&t!==n?(V.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)?(V.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 ac=!1;function oc(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:fc(e).parent_span_id,a=Ps(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||ps():t,trace_id:n}}function sc(e){let{traceId:t,spanId:n}=e.spanContext();return tc(t,n,hc(e))}function cc(e){let{traceId:t,spanId:n}=e.spanContext();return nc(t,n,hc(e))}function lc(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 uc(e){return typeof e==`number`?dc(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?dc(e.getTime()):os()}function dc(e){return e>9999999999?e/1e3:e}function fc(e){if(mc(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(pc(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:uc(i),timestamp:uc(o)||void 0,status:gc(s),op:r[`sentry.op`],origin:r[`sentry.origin`],links:lc(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function pc(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function mc(e){return typeof e.getSpanJSON==`function`}function hc(e){let{traceFlags:t}=e.spanContext();return t===1}function gc(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function _c(e){return e._sentryRootSpan||e}function vc(){let e=W(z());return e.getActiveSpan?e.getActiveSpan():gs(G())}function yc(){ac||=(B(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}let bc=!1;function xc(){if(bc)return;function e(){let e=vc(),t=e&&_c(e);if(t){let e=`internal_error`;L&&V.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}e.tag=`sentry_tracingErrorCallback`,bc=!0,io(e),so(e)}function Sc(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||q()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Cc(e){V.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function wc(e,t){if(!t?.length||!e.description)return!1;for(let n of t){if(Ec(n)){if(Ho(e.description,n))return L&&Cc(e),!0;continue}if(!n.name&&!n.op)continue;let t=n.name?Ho(e.description,n.name):!0,r=n.op?e.op&&Ho(e.op,n.op):!0;if(t&&r)return L&&Cc(e),!0}return!1}function Tc(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 Ec(e){return typeof e==`string`||e instanceof RegExp}const Dc=`production`;function Oc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||Dc,release:n.release,public_key:r,trace_id:e,org_id:Ys(t)};return t.emit(`createDsc`,i),i}function kc(e,t){let n=t.getPropagationContext();return n.dsc||Oc(n.traceId,e)}function Ac(e){let t=q();if(!t)return{};let n=_c(e),r=fc(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&&Is(l);if(u)return s(u);let d=Oc(e.spanContext().traceId,t),f=i[`sentry.source`],p=r.description;return f!==`url`&&p&&(d.transaction=p),Sc()&&(d.sampled=String(hc(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??Ps(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}function J(e,t=100,n=1/0){try{return Mc(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function jc(e,t=3,n=100*1024){let r=J(e,t);return Ic(r)>n?jc(e,t-1,n):r}function Mc(e,t,n=1/0,r=1/0,i=Lc()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=Nc(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 Mc(``,l.toJSON(),c-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,f=Mo(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]=Mc(e,t,c-1,r,i),d++}return o(t),u}function Nc(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(wo(t))return Xa(t);if(So(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${Ya(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=Pc(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function Pc(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function Fc(e){return~-encodeURI(e).split(/%..|./).length}function Ic(e){return Fc(JSON.stringify(e))}function Lc(){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 Rc(e,t=[]){return[e,t]}function zc(e,t){let[n,r]=e;return[n,[...r,t]]}function Bc(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 Vc(e,t){return Bc(e,(e,n)=>t.includes(n))}function Hc(e){let t=Aa(R);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Uc(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[Hc(r),e]:r.push(typeof e==`string`?Hc(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(J(n))}i(e)}}return typeof r==`string`?r:Wc(r)}function Wc(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 Gc(e){let t=typeof e.data==`string`?Hc(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Kc={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 qc(e){return Kc[e]}function Jc(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Yc(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:Ws(r)},...i&&{trace:i}}}function Xc(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 Zc(e,t,n,r){let i=Jc(n);return Rc({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:Ws(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Qc(e,t,n,r){let i=Jc(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Xc(e,n?.sdk);let o=Yc(e,i,r,t);return delete e.sdkProcessingMetadata,Rc(o,[[{type:a},e]])}const $c=`__SENTRY_SUPPRESS_TRACING__`,el=(e,t)=>{let n=W(z());if(n.continueTrace)return n.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,a=q(),o=Is(i);return a&&!ic(a,o?.org_id)?rl(t):Os(e=>{let n=ec(r,i);return e.setPropagationContext(n),hs(e,void 0),t()})};function tl(e,t){let n=il();return n.withActiveSpan?n.withActiveSpan(e,t):Os(n=>(hs(n,e||void 0),t(n)))}function nl(e){let t=il();return t.suppressTracing?t.suppressTracing(e):Os(t=>{t.setSDKProcessingMetadata({[$c]:!0});let n=e();return t.setSDKProcessingMetadata({[$c]:void 0}),n})}function rl(e){return Os(t=>(t.setPropagationContext({traceId:fs(),sampleRand:H()}),L&&V.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),tl(null,e)))}function il(){return W(z())}function al(e){return new sl(t=>{t(e)})}function ol(e){return new sl((t,n)=>{n(e)})}var sl=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(xo(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 cl(e,t,n,r=0){try{let i=ll(t,n,e,r);return xo(i)?i:al(i)}catch(e){return ol(e)}}function ll(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return L&&a===null&&V.log(`Event processor "${i.id||`?`}" dropped event`),xo(a)?a.then(e=>ll(e,t,n,r+1)):ll(a,t,n,r+1)}let ul,dl,fl,Y;function pl(e){let t=R._sentryDebugIds,n=R._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Y&&r.length===dl&&i.length===fl)return Y;dl=r.length,fl=i.length,Y={},ul||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=ul?.[r];if(i&&Y&&t)Y[i[0]]=t,ul&&(ul[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&&Y&&ul){Y[i]=t,ul[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Y}function ml(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;vl(e,t),r&&xl(e,r),Sl(e,n),yl(e,i),bl(e,a)}function hl(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;gl(e,`extra`,n),gl(e,`tags`,r),gl(e,`attributes`,i),gl(e,`user`,a),gl(e,`contexts`,o),e.sdkProcessingMetadata=ds(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 gl(e,t,n){e[t]=ds(e[t],n,1)}function _l(e,t){let n=Ds().getScopeData();return e&&hl(n,e.getScopeData()),t&&hl(n,t.getScopeData()),n}function vl(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 yl(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function bl(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function xl(e,t){e.contexts={trace:oc(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Ac(t),...e.sdkProcessingMetadata};let n=fc(_c(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function Sl(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 Cl(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||U(),timestamp:t.timestamp||rs()},l=n.integrations||e.integrations.map(e=>e.name);wl(c,e),Dl(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Tl(c,e.stackParser);let u=kl(r,n.captureContext);n.mechanism&&Xo(c,n.mechanism);let d=i?i.getEventProcessors():[],f=_l(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),ml(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?al(c):cl(m,c,n)).then(e=>(e&&El(e),typeof o==`number`&&o>0?Ol(e,o,s):e))}function wl(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||Dc,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=zo(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=zo(e.value,a)})}function Tl(e,t){let n=pl(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function El(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 Dl(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Ol(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:J(e.data,t,n)}}))},...e.user&&{user:J(e.user,t,n)},...e.contexts&&{contexts:J(e.contexts,t,n)},...e.extra&&{extra:J(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=J(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:J(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=J(e.contexts.flags,3,n)),r}function kl(e,t){if(!t)return e;let n=e?e.clone():new _s;return n.update(t),n}function Al(e){if(e)return jl(e)||Nl(e)?{captureContext:e}:e}function jl(e){return e instanceof _s||typeof e==`function`}const Ml=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Nl(e){return Object.keys(e).some(e=>Ml.includes(e))}function Pl(e,t){return G().captureException(e,Al(t))}function Fl(e,t){K().setContext(e,t)}function Il(e,t){K().setTag(e,t)}function Ll(e){K().setUser(e)}async function Rl(e){let t=q();return t?t.flush(e):(L&&V.warn(`Cannot flush events. No client defined.`),Promise.resolve(!1))}function zl(){let e=q();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Bl(e){let t=K(),{user:n}=_l(t,G()),{userAgent:r}=R.navigator||{},i=ss({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&cs(a,{status:`exited`}),Vl(),t.setSession(i),i}function Vl(){let e=K(),t=G().getSession()||e.getSession();t&&ls(t),Hl(),e.setSession()}function Hl(){let e=K(),t=q(),n=e.getSession();n&&t&&t.captureSession(n)}function Ul(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Wl(e){return`${Ul(e)}${e.projectId}/envelope/`}function Gl(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 Kl(e,t,n){return t||`${Wl(e)}?${Gl(e,n)}`}const ql=[];function Jl(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 Yl(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 Jl(r)}function Xl(e,t){let n={};return t.forEach(t=>{t&&Ql(e,t,n)}),n}function Zl(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Ql(e,t,n){if(n[t.name]){L&&V.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!ql.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),ql.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)}L&&V.log(`Integration installed: ${t.name}`)}function X(e){return e}function $l(e,t){return t?Os(t,()=>{let n=vc(),r=n?oc(n):As(t);return[n?Ac(n):kc(e,t),r]}):[void 0,void 0]}function eu(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function tu(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Ws(r)),Rc(i,[eu(e)])}function nu(e,t){let n=t??ru(e)??[];if(n.length===0)return;let r=e.getOptions(),i=tu(n,r._metadata,r.tunnel,e.getDsn());iu().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function ru(e){return iu().get(e)}function iu(){return ja(`clientToLogBufferMap`,()=>new WeakMap)}function au(e){return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{items:e}]}function ou(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Ws(r)),Rc(i,[au(e)])}function su(e,t){let n=t??cu(e)??[];if(n.length===0)return;let r=e.getOptions(),i=ou(n,r._metadata,r.tunnel,e.getDsn());lu().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function cu(e){return lu().get(e)}function lu(){return ja(`clientToMetricBufferMap`,()=>new WeakMap)}function uu(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}const du=Symbol.for(`SentryBufferFullError`);function fu(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return ol(du);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return al(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>uu(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}function pu(e,t=Ro()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function mu(e,t){return e[t]||e.all||0}function hu(e,t,n=Ro()){return mu(e,t)>n}function gu(e,{statusCode:t,headers:n},r=Ro()){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+pu(o,r):t===429&&(i.all=r+60*1e3);return i}function _u(e,t,n=fu(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(Bc(i,(t,n)=>{let i=qc(n);hu(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=Rc(i[0],a),s=t=>{if(Vc(o,[`client_report`])){L&&V.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}Bc(o,(n,r)=>{e.recordDroppedEvent(t,qc(r))})};return n.add(()=>t({body:Uc(o)}).then(e=>e.statusCode===413?(L&&V.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(L&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&V.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=gu(r,e),e),e=>{throw s(`network_error`),L&&V.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===du)return L&&V.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function vu(e,t,n){let r=[{type:`client_report`},{timestamp:n||rs(),discarded_events:e}];return Rc(t?{dsn:t}:{},[r])}function yu(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 bu(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?.[js],exclusive_time:o?.[Ms],measurements:e.measurements,is_segment:!0}}function xu(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&&{[js]:e.profile_id},...e.exclusive_time&&{[Ms]:e.exclusive_time}}}},measurements:e.measurements}}const Su=`Not capturing exception because it's already been captured.`,Cu=`Discarded session because of missing or non-string release`,wu=Symbol.for(`SentryInternalError`),Tu=Symbol.for(`SentryDoNotSendEventError`);function Eu(e){return{message:e,[wu]:!0}}function Du(e){return{message:e,[Tu]:!0}}function Ou(e){return!!e&&typeof e==`object`&&wu in e}function ku(e){return!!e&&typeof e==`object`&&Tu in e}function Au(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=uu(setTimeout(()=>{i(e)},5e3)))}),e.on(`flush`,()=>{i(e)})}var ju=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=fu(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=Xs(e.dsn):L&&V.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Kl(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&&Au(this,`afterCaptureLog`,`flushLogs`,Ru,nu),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Au(this,`afterCaptureMetric`,`flushMetrics`,Lu,su)}captureException(e,t,n){let r=U();if(es(e))return L&&V.log(Su),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:U(),...n},a=ho(e)?e:String(e),o=go(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=U();if(t?.originalException&&es(t.originalException))return L&&V.log(Su),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=Mu(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),cs(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){nu(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];Ql(this,e,this._integrations),t||Zl(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=Qc(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=zc(n,Gc(e));this.sendEnvelope(n).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=Dc}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){L&&V.warn(Cu);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){L&&V.warn(Cu);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=Zc(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}`;L&&V.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 L&&V.error(`Error while sending envelope:`,e),{}}return L&&V.error(`Transport disabled`),{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Xl(this,e),Zl(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)&&(cs(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),Cl(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:As(n),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:kc(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=G(),r=K()){return L&&Fu(e)&&V.log(`Captured error event \`${yu(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{L&&(ku(e)?V.log(e.message):Ou(e)?V.warn(e.message):V.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=Iu(e),s=Fu(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:Zs(a);if(s&&typeof l==`number`&&H()>l)return this.recordDroppedEvent(`sample_rate`,`error`),ol(Du(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=Mu(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),Du("An event processor returned `null`, will not send event.");return t.data&&t.data.__sentry__===!0?e:Nu(Pu(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 Du(`${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 ku(e)||Ou(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),Eu(`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===du&&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(){L&&V.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){L&&V.log(`No outcomes to send`);return}if(!this._dsn){L&&V.log(`No dsn provided, will not send outcomes`);return}L&&V.log(`Sending outcomes:`,e);let t=vu(e,this._options.tunnel&&Ws(this._dsn));this.sendEnvelope(t)}};function Mu(e){return e===`replay_event`?`replay`:e||`error`}function Nu(e,t){let n=`${t} must return \`null\` or a valid event.`;if(xo(e))return e.then(e=>{if(!_o(e)&&e!==null)throw Eu(n);return e},e=>{throw Eu(`${t} rejected with ${e}`)});if(!_o(e)&&e!==null)throw Eu(n);return e}function Pu(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:s}=t,c=n;if(Fu(c)&&i)return i(c,r);if(Iu(c)){if(o||s){let t=bu(c);if(s?.length&&wc(t,s))return null;if(o){let e=o(t);e?c=ds(n,xu(e)):yc()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(s?.length&&wc(e,s)){Tc(n,e);continue}if(o){let n=o(e);n?t.push(n):(yc(),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 Fu(e){return e.type===void 0}function Iu(e){return e.type===`transaction`}function Lu(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+zu(e.attributes)}function Ru(e){let t=0;return e.message&&(t+=e.message.length*2),t+zu(e.attributes)}function zu(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Bu(e[0]):go(e)?t+=Bu(e):t+=100}),t}function Bu(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function Vu(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=Ws(i)),t&&(a.trace=t),Rc(a,[Hu(e)])}function Hu(e){return[{type:`check_in`},e]}function Uu(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 Wu(e,t){return e(t.stack||``,1)}function Gu(e){return uo(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function Ku(e){return Gu(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function qu(e,t){let n={type:t.name||t.constructor.name,value:Ku(t)},r=Wu(e,t);return r.length&&(n.stacktrace={frames:r}),n}function Ju(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function Yu(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=Fo(e);if(po(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=Xu(e);return`${n&&n!==`Object`?`'${n}'`:`Object`} captured as exception with keys: ${t}`}function Xu(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Zu(e,t,n,r){if(uo(n))return[n,void 0];if(t.synthetic=!0,_o(n)){let t=e?.getOptions().normalizeDepth,i={__serialized__:jc(n,t)},a=Ju(n);if(a)return[a,i];let o=Yu(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 Qu(e,t,n,r){let i=r?.data&&r.data.mechanism||{handled:!0,type:`generic`},[a,o]=Zu(e,i,n,r),s={exception:{values:[qu(t,a)]}};return o&&(s.extra=o),Yo(s,void 0,void 0),Xo(s,i),{...s,event_id:r?.event_id}}function $u(e,t,n=`info`,r,i){let a={event_id:r?.event_id,level:n};if(i&&r?.syntheticException){let n=Wu(e,r.syntheticException);n.length&&(a.exception={values:[{value:t,stacktrace:{frames:n}}]},Xo(a,{synthetic:!0}))}if(ho(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 ed=class extends ju{constructor(e){xc(),Uu(e),super(e),this._setUpMetricsProcessing()}eventFromException(e,t){let n=Qu(this,this._options.stackParser,e,t);return n.level=`error`,al(n)}eventFromMessage(e,t=`info`,n){return al($u(this._options.stackParser,e,t,n,this._options.attachStacktrace))}captureException(e,t,n){return td(t),super.captureException(e,t,n)}captureEvent(e,t,n){return!e.type&&e.exception?.values&&e.exception.values.length>0&&td(t),super.captureEvent(e,t,n)}captureCheckIn(e,t,n){let r=`checkInId`in e&&e.checkInId?e.checkInId:U();if(!this._isEnabled())return L&&V.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]=$l(this,n);l&&(s.contexts={trace:l});let u=Vu(s,c,this.getSdkMetadata(),o,this.getDsn());return L&&V.log(`Sending checkin:`,e.monitorSlug,e.status),this.sendEnvelope(u),r}dispose(){L&&V.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=fu(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 td(e){let t=K().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!==`crashed`?t.status=`errored`:n||(t.status=`crashed`)}}const nd=new Set([`false`,`f`,`n`,`no`,`off`,`0`]),rd=new Set([`true`,`t`,`y`,`yes`,`on`,`1`]);function id(e,t){let n=String(e).toLowerCase();return nd.has(n)?!1:rd.has(n)?!0:t?.strict?null:!!e}function ad(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 od(e){return e.split(/[?#]/,1)[0]}function sd(e){let{protocol:t,host:n,path:r}=e,i=n?.replace(/^.*@/,`[filtered]:[filtered]@`).replace(/(:80)$/,``).replace(/(:443)$/,``)||``;return`${t?`${t}://`:``}${i}${r}`}function cd(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:ka})),i.version=ka)}function ld(e={}){let t=e.client||q();if(!zl()||!t)return{};let n=W(z());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||G(),i=e.span||vc(),a=i?sc(i):ud(r),o=Ls(i?Ac(i):kc(t,r));if(!Qs.test(a))return V.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let s={"sentry-trace":a,baggage:o};return e.propagateTraceparent&&(s.traceparent=i?cc(i):dd(r)),s}function ud(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return tc(t,r,n)}function dd(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return nc(t,r,n)}const fd=`[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:`;function pd(e,t,n){if(typeof e!=`string`||!t)return!0;let r=n?.get(e);if(r!==void 0)return L&&!r&&V.log(fd,e),r;let i=Uo(e,t);return n?.set(e,i),L&&!i&&V.log(fd,e),i}function md(e){let t=Object.create(null);try{Object.entries(e).forEach(([e,n])=>{typeof n==`string`&&(t[e]=n)})}catch{}return t}function hd(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=gd({url:i,host:n,protocol:r}),o=e.body||void 0,s=e.cookies;return{url:a,method:e.method,query_string:_d(i),headers:md(t),cookies:s,data:o}}function gd({url:e,protocol:t,host:n}){if(e?.startsWith(`http`))return e;if(e&&n)return`${t}://${n}${e}`}function _d(e){if(e)try{let t=new URL(e,`http://s.io`).search.slice(1);return t.length?t:void 0}catch{return}}function vd(e,t){let n=q(),r=K();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=100}=n.getOptions();if(a<=0)return;let o={timestamp:rs(),...e},s=i?B(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}let yd;const bd=new WeakMap,xd=X((()=>({name:`FunctionToString`,setupOnce(){yd=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=jo(this),n=bd.has(q())&&t!==void 0?t:this;return yd.apply(n,e)}}catch{}},setup(e){bd.set(e,!0)}}))),Sd=[/^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$/],Cd=X((e={})=>{let t;return{name:`EventFilters`,setup(n){t=wd(e,n.getOptions())},processEvent(n,r,i){return t||=wd(e,i.getOptions()),Td(n,t)?null:n}}});function wd(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Sd],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Td(e,t){if(e.type){if(e.type===`transaction`&&Dd(e,t.ignoreTransactions))return L&&V.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Jo(e)}`),!0}else{if(Ed(e,t.ignoreErrors))return L&&V.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Jo(e)}`),!0;if(Md(e))return L&&V.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${Jo(e)}`),!0;if(Od(e,t.denyUrls))return L&&V.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Jo(e)}.\nUrl: ${jd(e)}`),!0;if(!kd(e,t.allowUrls))return L&&V.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Jo(e)}.\nUrl: ${jd(e)}`),!0}return!1}function Ed(e,t){return t?.length?yu(e).some(e=>Uo(e,t)):!1}function Dd(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Uo(n,t):!1}function Od(e,t){if(!t?.length)return!1;let n=jd(e);return n?Uo(n,t):!1}function kd(e,t){if(!t?.length)return!0;let n=jd(e);return n?Uo(n,t):!0}function Ad(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 jd(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?Ad(t):null}catch{return L&&V.error(`Cannot extract url for event ${Jo(e)}`),null}}function Md(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function Nd(e,t,n,r,i,a){if(!i.exception?.values||!a||!Co(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=Pd(e,t,r,a.originalException,n,i.exception.values,o,0))}function Pd(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Co(r[i],Error)){Id(o,s,r);let a=e(t,r[i]),l=c.length;Ld(a,i,l,s),c=Pd(e,t,n,r[i],i,[a,...c],a,l)}return Fd(r)&&r.errors.forEach((a,l)=>{if(Co(a,Error)){Id(o,s,r);let u=e(t,a),d=c.length;Ld(u,`errors[${l}]`,d,s),c=Pd(e,t,n,a,i,[u,...c],u,d)}}),c}function Fd(e){return Array.isArray(e.errors)}function Id(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...Fd(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ld(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}const Rd=X(((e={})=>{let t=e.limit||5,n=e.key||`cause`;return{name:`LinkedErrors`,preprocessEvent(e,r,i){Nd(qu,i.getOptions().stackParser,n,t,e,r)}}}));function zd(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 Bd=[`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 Vd(e){let t={};for(let n of Object.keys(e))t[n.toLowerCase()]=e[n];return Bd.map(e=>{let n=t[e.toLowerCase()],r=Array.isArray(n)?n.join(`;`):n;return e===`Forwarded`?Hd(r):r?.split(`,`).map(e=>e.trim())}).reduce((e,t)=>t?e.concat(t):e,[]).find(e=>e!==null&&Ud(e))||null}function Hd(e){if(!e)return null;for(let t of e.split(`;`))if(t.startsWith(`for=`))return t.slice(4);return null}function Ud(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 Wd={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Gd=X(((e={})=>{let t={...Wd,...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&&Kd(e,a,{ipAddress:o},s),e}}}));function Kd(e,t,n,r){if(e.request={...e.request,...qd(t,r)},r.ip){let r=t.headers&&Vd(t.headers)||n.ipAddress;r&&(e.user={...e.user,ip_address:r})}}function qd(e,t){let n={},r={...e.headers};return t.headers&&(n.headers=r,t.cookies||delete r.cookie,t.ip||Bd.forEach(e=>{delete r[e]})),n.method=e.method,t.url&&(n.url=e.url),t.cookies&&(n.cookies=e.cookies||(r?.cookie?zd(r.cookie):void 0)||{}),t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function Jd(e){let t=`console`;eo(t,e),to(t,Yd)}function Yd(){`console`in R&&Ma.forEach(function(e){e in R.console&&Oo(R.console,e,function(t){return Na[e]=t,function(...t){no(`console`,{args:t,level:e}),Na[e]?.apply(R.console,t)}})})}function Xd(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}const Zd=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Qd(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Zd.exec(t);return n?n.slice(1):[]}function $d(e){let t=Qd(e),n=t[0]||``,r=t[1];return!n&&!r?`.`:(r&&=r.slice(0,r.length-1),n+r)}const ef=X((e={})=>{let t=new Set(e.levels||Ma);return{name:`Console`,setup(e){Jd(({args:n,level:r})=>{q()!==e||!t.has(r)||tf(r,n)})}}});function tf(e,t){let n={category:`console`,data:{arguments:t,logger:`console`},level:Xd(e),message:nf(t)};if(e===`assert`)if(t[0]===!1){let e=t.slice(1);n.message=e.length>0?`Assertion failed: ${nf(e)}`:`Assertion failed`,n.data.arguments=e}else return;vd(n,{input:t,level:e})}function nf(e){return`util`in R&&typeof R.util.format==`function`?R.util.format(...e):Vo(e,` `)}function rf(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}function af(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 of(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=Za(o[2]),c=o[5]===`native`;!s&&o[5]&&!c&&(s=o[5]);let l=s?lf(s):void 0;return{filename:l??s,module:l&&e?.(l),function:r,lineno:cf(o[3]),colno:cf(o[4]),in_app:af(s||``,c)}}if(i.match(t))return{filename:i}}}function sf(e){return[90,of(e)]}function cf(e){return parseInt(e||``,10)||void 0}function lf(e){try{return decodeURI(e)}catch{return}}var uf=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 Z=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;var df=class extends ed{constructor(e){let t=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||y.hostname(),n={...e,platform:`node`,runtime:{name:`node`,version:global.process.version},serverName:t};cd(n,`node-light`,[`node-core`]),V.log(`Initializing Sentry: process: ${process.pid}, thread: ${He?`main`:`worker-${Ue}`}.`),super(n),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{nu(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(()=>{Z&&V.log(`Flushing client reports based on interval.`),this._flushOutcomes()},e.clientReportFlushInterval??6e4).unref(),process.on(`beforeExit`,this._clientReportOnExitFlushListener))}};const ff=X((e={})=>({name:`ChildProcess`,setup(){We.channel(`child_process`).subscribe(t=>{t&&typeof t==`object`&&`process`in t&&pf(t.process,e)}),We.channel(`worker_threads`).subscribe(t=>{t&&typeof t==`object`&&`worker`in t&&mf(t.worker,e)})}}));function pf(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&&vd({category:`child_process`,message:`Child process exited with code '${e}'`,level:e===0?`info`:`warning`,data:r}))}).on(`error`,e=>{n||(n=!0,vd({category:`child_process`,message:`Child process errored with '${e.message}'`,level:`error`,data:r}))})}function mf(e,t){let n;e.on(`online`,()=>{n=e.threadId}).on(`error`,e=>{t.captureWorkerErrors===!1?vd({category:`worker_thread`,message:`Worker thread errored with '${e.message}'`,level:`error`,data:{threadId:n}}):Pl(e,{mechanism:{type:`auto.child_process.worker_thread`,handled:!1,data:{threadId:String(n)}}})})}const hf=xe(Je),gf=xe(Xe),_f=X(((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=vf(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 yf()),n.app&&(e.app=xf()),n.device&&(e.device=Sf(n.device)),n.culture){let t=bf();t&&(e.culture=t)}return n.cloudResource&&(e.cloud_resource=kf()),e}return{name:`Context`,processEvent(e){return r(e)}}}));function vf(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=y.freemem()),e}async function yf(){let e=y.platform();switch(e){case`darwin`:return Ef();case`linux`:return Of();default:return{name:Cf[e]||e,version:y.release()}}}function bf(){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 xf(){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 Sf(e){let t={},n;try{n=y.uptime()}catch{}if(typeof n==`number`&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=y.arch(),(e===!0||e.memory)&&(t.memory_size=y.totalmem(),t.free_memory=y.freemem()),e===!0||e.cpu){let e=y.cpus(),n=e?.[0];n&&(t.processor_count=e.length,t.cpu_description=n.model,t.processor_frequency=n.speed)}return t}const Cf={aix:`IBM AIX`,freebsd:`FreeBSD`,openbsd:`OpenBSD`,sunos:`SunOS`,win32:`Windows`,ohos:`OpenHarmony`,android:`Android`},wf=[{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`]}],Tf={alpine:e=>e,arch:e=>Q(/distrib_release=(.*)/,e),centos:e=>Q(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>Q(/release (..)/,e),mint:e=>Q(/distrib_release=(.*)/,e),red:e=>Q(/release ([^ ]+)/,e),suse:e=>Q(/VERSION = (.*)\n/,e),ubuntu:e=>Q(/distrib_release=(.*)/,e)};function Q(e,t){let n=e.exec(t);return n?n[1]:void 0}async function Ef(){let e={kernel_version:y.release(),name:`Mac OS X`,version:`10.${Number(y.release().split(`.`)[0])-4}`};try{let t=await new Promise((e,t)=>{je(`/usr/bin/sw_vers`,(n,r)=>{if(n){t(n);return}e(r)})});e.name=Q(/^ProductName:\s+(.*)$/m,t),e.version=Q(/^ProductVersion:\s+(.*)$/m,t),e.build=Q(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function Df(e){return e.split(` `)[0].toLowerCase()}async function Of(){let e={kernel_version:y.release(),name:`Linux`};try{let t=await gf(`/etc`),n=wf.find(e=>t.includes(e.name));if(!n)return e;let r=(await hf(De(`/etc`,n.name),{encoding:`utf-8`})).toLowerCase(),{distros:i}=n;e.name=i.find(e=>r.indexOf(Df(e))>=0)||i[0],e.version=Tf[Df(e.name)]?.(r)}catch{}return e}function kf(){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 Af=new uf(10),jf=new uf(20);function Mf(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function Nf(e){return!!(e.startsWith(`node:`)||e.endsWith(`.min.js`)||e.endsWith(`.min.cjs`)||e.endsWith(`.min.mjs`)||e.startsWith(`data:`))}function Pf(e){return e.lineno!==void 0&&e.lineno>1e4||e.colno!==void 0&&e.colno>1e3}function Ff(e,t){let n=Af.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 If(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!=`number`)return[];let i=Wf(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=Wf(r,t)),n++}return a}function Lf(e,t,n){return new Promise((r,i)=>{let a=Ke(e),o=Pe({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){jf.set(e,1),Z&&V.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]=Bo(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 Rf(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`||Nf(i)||Pf(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(jf.get(e))continue;let r=n[e];if(!r)continue;r.sort((e,t)=>e-t);let a=If(r,t);if(a.every(t=>Ff(e,t)))continue;let o=Mf(Af,e,{});i.push(Lf(e,a,o))}if(await Promise.all(i).catch(()=>{Z&&V.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&&zf(n.stacktrace.frames,t,Af);return e}function zf(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;Vf(r.lineno,r,t,e)}}function Bf(e){delete e.pre_context,delete e.context_line,delete e.post_context}function Vf(e,t,n,r){if(t.lineno===void 0||r===void 0){Z&&V.error(`Cannot resolve context for frame with no lineno or file contents`);return}t.pre_context=[];for(let i=Hf(e,n);i<e;i++){let e=r[i];if(e===void 0){Bf(t),Z&&V.error(`Could not find line ${i} in file ${t.filename}`);return}t.pre_context.push(e)}if(r[e]===void 0){Bf(t),Z&&V.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let i=Uf(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 Hf(e,t){return Math.max(1,e-t)}function Uf(e,t){return e+t}function Wf(e,t){return[Hf(e,t),Uf(e,t)]}const Gf=X(((e={})=>{let t=e.frameContextLines===void 0?7:e.frameContextLines;return{name:`ContextLines`,processEvent(e){return Rf(e,t)}}})),Kf=$o(process.versions.node),qf=Kf.major;Kf.minor;let Jf;async function Yf(){if(Jf===void 0)try{Jf=!!(await import(`node:inspector`)).url()}catch{Jf=!1}return Jf}const Xf=`__SENTRY_ERROR_LOCAL_VARIABLES__`;function Zf(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 Qf(e){return e!==void 0&&(e.length===0||e===`?`||e===`<anonymous>`)}function $f(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||Qf(e)&&Qf(t)}function ep(...e){V.log(`[LocalVariables]`,...e)}const tp=X(((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||!$f(o.function,a.function)||(o.vars=a.vars)}}function n(e,n){if(n.originalException&&typeof n.originalException==`object`&&Xf in n.originalException&&Array.isArray(n.originalException[Xf])){for(let r of e.exception?.values||[])t(r,n.originalException[Xf]);n.originalException[Xf]=void 0}return e}async function r(){let e=await import(`node:inspector`);e.url()||e.open(0)}function i(e){let t=new Ze(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=>{ep(`Worker error`,e)}),t.once(`exit`,e=>{ep(`Worker exit`,e)}),t.unref()}return{name:`LocalVariablesAsync`,async setup(t){if(!t.getOptions().includeLocalVariables)return;if(await Yf()){V.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}let n={...e,debug:V.isEnabled()};r().then(()=>{try{i(n)}catch(e){V.error(`Failed to start worker`,e)}},e=>{V.error(`Failed to start inspector`,e)})},processEvent(e,t){return n(e,t)}}}));function np(e){if(e!==void 0)return e.slice(-10).reduce((e,t)=>`${e},${t.function},${t.lineno},${t.colno}`,``)}function rp(e,t){if(t!==void 0)return np(e(t,1))}function ip(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 ap=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}=ip(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 op=X(((e={},t)=>{let n=new uf(20),r,i=!1;function a(t){let r=np(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||!$f(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=q()?.getOptions();if(a?.includeLocalVariables){if(qf<18){V.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await Yf()){V.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}try{let o=await ap.create(t),s=(e,{params:{reason:t,data:i,callFrames:a}},s)=>{if(t!==`exception`&&t!==`promiseRejection`){s();return}r?.();let c=rp(e,i.description);if(c==null){s();return}let{add:l,next:u}=ip(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=Zf(e.maxExceptionsPerSecond||50,()=>{V.log(`Local variables rate-limit lifted.`),o.setPauseOnExceptions(!0)},e=>{V.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${e} seconds.`),o.setPauseOnExceptions(!1)})),i=!0}catch(e){V.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]}}})),sp=(e={})=>Kf.major<19?op(e):tp(e);function cp(){try{return typeof module<`u`&&module.exports!==void 0}catch{return!1}}let lp;const up=typeof __SENTRY_SERVER_MODULES__>`u`?{}:__SENTRY_SERVER_MODULES__,dp=(()=>({name:`Modules`,processEvent(e){return e.modules={...e.modules,...hp()},e},getModules:hp}));function fp(){try{return c.cache?Object.keys(c.cache):[]}catch{return[]}}function pp(){return{...up,..._p(),...cp()?mp():{}}}function mp(){let e=c.main?.paths||[],t=fp(),n={},r=new Set;return t.forEach(t=>{let i=t,a=()=>{let t=i;if(i=Ee(t),!i||t===i||r.has(t))return;if(e.indexOf(i)<0)return a();let o=De(t,`package.json`);if(r.add(t),!qe(o))return a();try{let e=JSON.parse(Ye(o,`utf8`));n[e.name]=e.version}catch{}};a()}),n}function hp(){return lp||=pp(),lp}function gp(){try{let e=De(process.cwd(),`package.json`);return JSON.parse(Ye(e,`utf8`))}catch{return{}}}function _p(){let e=gp();return{...e.dependencies,...e.devDependencies}}function vp(e){B(()=>{console.error(e)});let t=q();if(t===void 0){Z&&V.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||Z&&V.warn(`We reached the timeout for emptying the request buffer, still exiting now!`),global.process.exit(1)},e=>{Z&&V.error(e)})}const yp=X((e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:`OnUncaughtException`,setup(e){He&&global.process.on(`uncaughtException`,bp(e,t))}}});function bp(e,t){let n=!1,r=!1,i=!1,a,o=e.getOptions();return Object.assign(s=>{let c=vp;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?(Z&&V.warn(`uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown`),vp(s)):r||(r=!0,setTimeout(()=>{i||(i=!0,c(a,s))},2e3))):(a=s,n=!0,q()===e&&Pl(s,{originalException:s,captureContext:{level:`fatal`},mechanism:{handled:!1,type:`auto.node.onuncaughtexception`}}),!i&&u&&(i=!0,c(s)))},{_errorHandler:!0})}const xp=[{name:`AI_NoOutputGeneratedError`},{name:`AbortError`}],Sp=X(((e={})=>{let t={mode:e.mode??`warn`,ignore:[...xp,...e.ignore??[]]};return{name:`OnUnhandledRejection`,setup(e){global.process.on(`unhandledRejection`,Ep(e,t))}}}));function Cp(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 wp(e,t){let n=e.name===void 0||Ho(t.name,e.name,!0),r=e.message===void 0||Ho(t.message,e.message);return n&&r}function Tp(e,t){let n=Cp(t);return e.some(e=>wp(e,n))}function Ep(e,t){return function(n,r){if(q()!==e||Tp(t.ignore??[],n))return;let i=t.mode===`strict`?`fatal`:`error`,a=n&&typeof n==`object`?n._sentry_active_span:void 0;(a?e=>tl(a,e):e=>e())(()=>{Pl(n,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:i},mechanism:{handled:!1,type:`auto.node.onunhandledrejection`}})}),Dp(n,t.mode)}}function Dp(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`?B(()=>{console.warn(n),console.error(e&&typeof e==`object`&&`stack`in e?e.stack:e)}):t===`strict`&&(B(()=>{console.warn(n)}),vp(e))}const Op=X(()=>({name:`ProcessSession`,setupOnce(){Bl(),process.on(`beforeExit`,()=>{K().getSession()?.status!==`ok`&&Vl()})}})),kp=`Spotlight`,Ap=X(((e={})=>{let t={sidecarUrl:e.sidecarUrl||`http://localhost:8969/stream`};return{name:kp,setup(e){try{process.env.NODE_ENV&&process.env.NODE_ENV!==`development`&&V.warn(`[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?`)}catch{}jp(e,t)}}}));function jp(e,t){let n=Mp(t.sidecarUrl);if(!n)return;let r=0;e.on(`beforeEnvelope`,e=>{if(r>3){V.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests`);return}let t=Uc(e);nl(()=>{let e=Fe.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++,V.warn(`[Spotlight] Failed to send envelope to Spotlight Sidecar`)}),e.write(t),e.end()})})}function Mp(e){try{return new URL(`${e}`)}catch{V.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}function Np(e){return!(e instanceof Error)||!(`errno`in e)||typeof e.errno!=`number`?!1:ye.getSystemErrorMap().has(e.errno)}const Pp=X((e={})=>({name:`NodeSystemError`,processEvent:(t,n,r)=>{if(!Np(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 Fp(e){return e.replace(/^[A-Z]:/,``).replace(/\\/g,`/`)}function Ip(e=process.argv[1]?$d(process.argv[1]):process.cwd(),t=ke===`\\`){let n=t?Fp(e):e;return e=>{if(!e)return;let r=t?Fp(e):e,{dir:i,base:a,ext:o}=Oe.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 Lp(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(R.SENTRY_RELEASE?.id)return R.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 Rp=Wa(sf(Ip())),$=Symbol(`AgentBaseInternalState`);var zp=class extends Fe.Agent{constructor(e){super(e),this[$]={}}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(`
330
330
  `).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 Fe.Agent)return i.addRequest(e,r);this[$].currentSocket=i,super.createSocket(e,t,n)},n)}createConnection(){let e=this[$].currentSocket;if(this[$].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[$].defaultPort??(this.protocol===`https:`?443:80)}set defaultPort(e){this[$]&&(this[$].defaultPort=e)}get protocol(){return this[$].protocol??(this.isSecureEndpoint()?`https:`:`http:`)}set protocol(e){this[$]&&(this[$].protocol=e)}};function Bp(...e){V.log(`[https-proxy-agent:parse-proxy-response]`,...e)}function Vp(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(),Bp(`onend`),n(Error(`Proxy connection ended before receiving CONNECT response`))}function c(e){o(),Bp(`onerror %o`,e),n(e)}function l(s){i.push(s),r+=s.length;let c=Buffer.concat(i,r),l=c.indexOf(`\r
331
331
  \r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismic",
3
- "version": "1.3.0-pr.75.eafee21",
3
+ "version": "1.3.0-pr.77.6fcb24d",
4
4
  "description": "Prismic's official command line tool",
5
5
  "keywords": [
6
6
  "prismic",