@duffel/components 3.0.2-canary → 3.0.3-canary

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.
@@ -20,11 +20,11 @@ const envVariablesToDefine = {
20
20
  esbuild
21
21
  .build({
22
22
  define: envVariablesToDefine,
23
- entryPoints: ["src/index.ts"],
23
+ entryPoints: ["src/index.ts", "src/custom-elements.ts"],
24
24
  bundle: true,
25
25
  minify: true,
26
26
  sourcemap: true,
27
- outfile: `react-dist/index.js`,
27
+ outdir: "react-dist",
28
28
  format: "cjs",
29
29
  external: ["react", "react-dom"],
30
30
  plugins: [
package/package.json CHANGED
@@ -1,9 +1,16 @@
1
1
  {
2
2
  "name": "@duffel/components",
3
- "version": "3.0.2-canary",
3
+ "version": "3.0.3-canary",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "main": "react-dist/index.js",
7
+ "maintainers": [
8
+ {
9
+ "name": "Duffel",
10
+ "email": "hello@duffel.com",
11
+ "url": "https://duffel.com"
12
+ }
13
+ ],
7
14
  "scripts": {
8
15
  "precdn-build": "rm -rf ./cdn-dist",
9
16
  "cdn-build": "node config/esbuild.cdn.config.js",
@@ -130,7 +137,7 @@
130
137
  "main"
131
138
  ]
132
139
  },
133
- "description": "## What is this?",
140
+ "description": "Component library to build your travel product with Duffel.",
134
141
  "repository": {
135
142
  "type": "git",
136
143
  "url": "git+https://github.com/duffelhq/duffel-checkout.git"
@@ -139,8 +146,7 @@
139
146
  "Duffel",
140
147
  "ancillaries",
141
148
  "seats",
142
- "seat",
143
- "map",
149
+ "seat map",
144
150
  "baggage",
145
151
  "travel"
146
152
  ],
@@ -0,0 +1 @@
1
+ export { onDuffelAncillariesPayloadReady, renderDuffelAncillariesCustomElement, } from "./components/DuffelAncillariesCustomElement";
@@ -0,0 +1,36 @@
1
+ "use strict";var oc=Object.create;var pr=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var ac=Object.getOwnPropertyNames;var sc=Object.getPrototypeOf,cc=Object.prototype.hasOwnProperty;var Fo=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),yn=(t,e)=>{for(var r in e)pr(t,r,{get:e[r],enumerable:!0})},Go=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ac(e))!cc.call(t,o)&&o!==r&&pr(t,o,{get:()=>e[o],enumerable:!(n=ic(e,o))||n.enumerable});return t};var C=(t,e,r)=>(r=t!=null?oc(sc(t)):{},Go(e||!t||!t.__esModule?pr(r,"default",{value:t,enumerable:!0}):r,t)),lc=t=>Go(pr({},"__esModule",{value:!0}),t);var ha=Fo((P1,Md)=>{Md.exports={name:"@duffel/components",version:"3.0.3-canary",private:!1,license:"MIT",main:"react-dist/index.js",maintainers:[{name:"Duffel",email:"hello@duffel.com",url:"https://duffel.com"}],scripts:{"precdn-build":"rm -rf ./cdn-dist","cdn-build":"node config/esbuild.cdn.config.js","build-storybook":"storybook build","check-types":"tsc --project tsconfig.json --noEmit --emitDeclarationOnly false",dev:"node config/esbuild.dev.config.js","generate-fixture":"esbuild ./scripts/generate-fixture.ts --outfile=dist/scripts/generate-fixture.cjs --format=cjs --platform=node --bundle --tsconfig=scripts.tsconfig.json","postgenerate-fixture":"node dist/scripts/generate-fixture.cjs","generate-type-declarations":"tsc --project tsconfig.json",commit:"cz",lint:"eslint . --ext .ts,.tsx,.mjs,.js --max-warnings=0","pre-commit-check":'concurrently --raw "yarn check-types" "yarn lint-staged"',"post-commit-check":"yarn commitlint --from main",prepare:"husky install",prettier:"prettier --write --loglevel=warn .","prettier-check":"prettier --check .","prereact-build":"rm -rf ./react-dist","react-build":"node config/esbuild.react.config.js","postreact-build":"yarn generate-type-declarations","run-client-side-server":"http-server src/examples/client-side --port=6262","run-example:client-side":'concurrently "yarn dev" "yarn run-client-side-server"',"run-example:full-stack":'concurrently "yarn dev" "yarn run-full-stack-server"',"run-full-stack-server":"node src/examples/full-stack/server.mjs",storybook:"storybook dev -p 6006",test:"LANG='en_US' TZ=UTC yarn jest","preupload-to-cdn":"yarn cdn-build","upload-to-cdn":"bash ./scripts/upload-to-cdn.sh",prerelease:"yarn react-build",release:"yarn semantic-release","get-version":"cat package.json | jq '.version'"},husky:{hooks:{"pre-commit":"yarn pre-commit-check","post-commit":"yarn post-commit"}},"lint-staged":{"*.{ts,tsx,mjs,js}":["eslint --fix","prettier --write"]},dependencies:{"@sentry/browser":"^7.43.0",classnames:"^2.3.2",react:"18.2.0","react-dom":"18.2.0"},devDependencies:{"@babel/core":"^7.21.4","@babel/preset-env":"^7.21.4","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.4","@commitlint/cli":"^17.6.5","@commitlint/config-conventional":"^17.6.5","@duffel/api":"^1.26.0","@sentry/esbuild-plugin":"^0.7.0","@storybook/addon-essentials":"^7.0.2","@storybook/addon-interactions":"^7.0.2","@storybook/addon-links":"^7.0.2","@storybook/addon-storyshots":"^7.0.4","@storybook/blocks":"^7.0.2","@storybook/react":"^7.0.2","@storybook/react-webpack5":"^7.0.2","@storybook/testing-library":"^0.1.0","@testing-library/react":"^14.0.0","@types/jest":"^29.5.0","@types/node":"^18.15.11","@types/prompts":"^2.4.4","@types/react":"^18.0.32","@types/react-dom":"^18.0.11","@typescript-eslint/eslint-plugin":"^5.43.0","@typescript-eslint/parser":"^5.57.0","babel-jest":"^29.5.0",commitizen:"^4.3.0",concurrently:"^8.0.0","cz-conventional-changelog":"^3.3.0",dotenv:"^16.0.3",esbuild:"0.17.19","esbuild-copy-static-files":"^0.1.0",eslint:"^8.0.1","eslint-config-prettier":"^8.8.0","eslint-plugin-import":"^2.25.2","eslint-plugin-jsx-a11y":"^6.7.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-storybook":"^0.6.11","http-server":"^14.1.1",husky:"^8.0.3",jest:"^29.5.0","jest-environment-jsdom":"^29.5.0","lint-staged":"^13.2.0",prettier:"^2.8.7","prettier-plugin-organize-imports":"^3.2.2",prompts:"^2.4.2","prop-types":"^15.8.1","semantic-release":"^21.0.3",storybook:"^7.0.2","ts-node":"^10.9.1","tsconfig-paths-webpack-plugin":"^4.0.1",typescript:"5.0.4"},engines:{node:"~18.*"},config:{commitizen:{path:"./node_modules/cz-conventional-changelog"}},plugins:[["@semantic-release/commit-analyzer"],["@semantic-release/release-notes-generator"],"@semantic-release/npm","@semantic-release/github"],release:{branches:["main"]},description:"Component library to build your travel product with Duffel.",repository:{type:"git",url:"git+https://github.com/duffelhq/duffel-checkout.git"},keywords:["Duffel","ancillaries","seats","seat map","baggage","travel"],author:"duffel.com",bugs:{url:"https://github.com/duffelhq/duffel-checkout/issues"},homepage:"https://github.com/duffelhq/duffel-checkout#readme"}});var fe=Fo((Fh,nn)=>{(function(){"use strict";var t={}.hasOwnProperty,e="[native code]";function r(){for(var n=[],o=0;o<arguments.length;o++){var i=arguments[o];if(i){var a=typeof i;if(a==="string"||a==="number")n.push(i);else if(Array.isArray(i)){if(i.length){var s=r.apply(null,i);s&&n.push(s)}}else if(a==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){n.push(i.toString());continue}for(var c in i)t.call(i,c)&&i[c]&&n.push(c)}}}return n.join(" ")}typeof nn<"u"&&nn.exports?(r.default=r,nn.exports=r):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return r}):window.classNames=r})()});var nf={};yn(nf,{onDuffelAncillariesPayloadReady:()=>Qs,renderDuffelAncillariesCustomElement:()=>Js});module.exports=lc(nf);var Ks=require("react-dom/client");var Uo=Object.prototype.toString;function Vt(t){switch(Uo.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return j(t,Error)}}function gt(t,e){return Uo.call(t)===`[object ${e}]`}function jt(t){return gt(t,"ErrorEvent")}function mr(t){return gt(t,"DOMError")}function En(t){return gt(t,"DOMException")}function B(t){return gt(t,"String")}function ht(t){return t===null||typeof t!="object"&&typeof t!="function"}function Q(t){return gt(t,"Object")}function St(t){return typeof Event<"u"&&j(t,Event)}function vn(t){return typeof Element<"u"&&j(t,Element)}function bn(t){return gt(t,"RegExp")}function st(t){return!!(t&&t.then&&typeof t.then=="function")}function Tn(t){return Q(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function zt(t){return typeof t=="number"&&t!==t}function j(t,e){try{return t instanceof e}catch{return!1}}function _r(t){return t&&t.Math==Math?t:void 0}var R=typeof globalThis=="object"&&_r(globalThis)||typeof window=="object"&&_r(window)||typeof self=="object"&&_r(self)||typeof global=="object"&&_r(global)||function(){return this}()||{};function ee(){return R}function ct(t,e,r){let n=r||R,o=n.__SENTRY__=n.__SENTRY__||{};return o[t]||(o[t]=e())}var gr=ee(),dc=80;function me(t,e={}){try{let r=t,n=5,o=[],i=0,a=0,s=" > ",c=s.length,l,d=Array.isArray(e)?e:e.keyAttrs,f=!Array.isArray(e)&&e.maxStringLength||dc;for(;r&&i++<n&&(l=fc(r,d),!(l==="html"||i>1&&a+o.length*c+l.length>=f));)o.push(l),a+=l.length,r=r.parentNode;return o.reverse().join(s)}catch{return"<unknown>"}}function fc(t,e){let r=t,n=[],o,i,a,s,c;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());let l=e&&e.length?e.filter(f=>r.getAttribute(f)).map(f=>[f,r.getAttribute(f)]):null;if(l&&l.length)l.forEach(f=>{n.push(`[${f[0]}="${f[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),o=r.className,o&&B(o))for(i=o.split(/\s+/),c=0;c<i.length;c++)n.push(`.${i[c]}`);let d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)a=d[c],s=r.getAttribute(a),s&&n.push(`[${a}="${s}"]`);return n.join("")}function Cn(){try{return gr.document.location.href}catch{return""}}function Rn(t){return gr.document&&gr.document.querySelector?gr.document.querySelector(t):null}var uc="Sentry Logger ",yt=["debug","info","warn","error","log","assert","trace"];function hr(t){if(!("console"in R))return t();let e=R.console,r={};yt.forEach(n=>{let o=e[n]&&e[n].__sentry_original__;n in e&&o&&(r[n]=e[n],e[n]=o)});try{return t()}finally{Object.keys(r).forEach(n=>{e[n]=r[n]})}}function Ho(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?yt.forEach(r=>{e[r]=(...n)=>{t&&hr(()=>{R.console[r](`${uc}[${r}]:`,...n)})}}):yt.forEach(r=>{e[r]=()=>{}}),e}var u;typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?u=ct("logger",Ho):u=Ho();var pc=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function mc(t){return t==="http"||t==="https"}function _e(t,e=!1){let{host:r,path:n,pass:o,port:i,projectId:a,protocol:s,publicKey:c}=t;return`${s}://${c}${e&&o?`:${o}`:""}@${r}${i?`:${i}`:""}/${n&&`${n}/`}${a}`}function Yo(t){let e=pc.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}let[r,n,o="",i,a="",s]=e.slice(1),c="",l=s,d=l.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),l=d.pop()),l){let f=l.match(/^\d+/);f&&(l=f[0])}return $o({host:i,pass:o,path:c,projectId:l,port:a,protocol:r,publicKey:n})}function $o(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function _c(t){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:e,projectId:r,protocol:n}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(u.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:r.match(/^\d+$/)?mc(n)?e&&isNaN(parseInt(e,10))?(u.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(u.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(u.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function Sr(t){let e=typeof t=="string"?Yo(t):$o(t);if(!(!e||!_c(e)))return e}var D=class extends Error{constructor(e,r="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=r}};function je(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function yr(t,e){if(!Array.isArray(t))return"";let r=[];for(let n=0;n<t.length;n++){let o=t[n];try{r.push(String(o))}catch{r.push("[value cannot be serialized]")}}return r.join(e)}function Wo(t,e,r=!1){return B(t)?bn(e)?e.test(t):B(e)?r?t===e:t.includes(e):!1:!1}function ze(t,e=[],r=!1){return e.some(n=>Wo(t,n,r))}function x(t,e,r){if(!(e in t))return;let n=t[e],o=r(n);if(typeof o=="function")try{Er(o,n)}catch{}t[e]=o}function Et(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}function Er(t,e){let r=e.prototype||{};t.prototype=e.prototype=r,Et(t,"__sentry_original__",e)}function lt(t){return t.__sentry_original__}function Nn(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function vr(t){if(Vt(t))return{message:t.message,name:t.name,stack:t.stack,...jo(t)};if(St(t)){let e={type:t.type,target:Vo(t.target),currentTarget:Vo(t.currentTarget),...jo(t)};return typeof CustomEvent<"u"&&j(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Vo(t){try{return vn(t)?me(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function jo(t){if(typeof t=="object"&&t!==null){let e={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}else return{}}function In(t,e=40){let r=Object.keys(vr(t));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=e)return je(r[0],e);for(let n=r.length;n>0;n--){let o=r.slice(0,n).join(", ");if(!(o.length>e))return n===r.length?o:je(o,e)}return""}function L(t){return xn(t,new Map)}function xn(t,e){if(Q(t)){let r=e.get(t);if(r!==void 0)return r;let n={};e.set(t,n);for(let o of Object.keys(t))typeof t[o]<"u"&&(n[o]=xn(t[o],e));return n}if(Array.isArray(t)){let r=e.get(t);if(r!==void 0)return r;let n=[];return e.set(t,n),t.forEach(o=>{n.push(xn(o,e))}),n}return t}var qo=50,zo=/\(error: (.*)\)/;function br(...t){let e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{let o=[],i=r.split(`
2
+ `);for(let a=n;a<i.length;a++){let s=i[a];if(s.length>1024)continue;let c=zo.test(s)?s.replace(zo,"$1"):s;if(!c.match(/\S*Error: /)){for(let l of e){let d=l(c);if(d){o.push(d);break}}if(o.length>=qo)break}}return Zo(o)}}function Pn(t){return Array.isArray(t)?br(...t):t}function Zo(t){if(!t.length)return[];let e=t.slice(0,qo),r=e[e.length-1].function;r&&/sentryWrapped/.test(r)&&e.pop(),e.reverse();let n=e[e.length-1].function;return n&&/captureMessage|captureException/.test(n)&&e.pop(),e.map(o=>({...o,filename:o.filename||e[e.length-1].filename,function:o.function||"?"}))}var On="<anonymous>";function z(t){try{return!t||typeof t!="function"?On:t.name||On}catch{return On}}var Dn=ee();function Tr(){if(!("fetch"in Dn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function qt(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function An(){if(!Tr())return!1;if(qt(Dn.fetch))return!0;let t=!1,e=Dn.document;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=qt(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}var Cr=ee();function Ko(){let t=Cr.chrome,e=t&&t.app&&t.app.runtime,r="history"in Cr&&!!Cr.history.pushState&&!!Cr.history.replaceState;return!e&&r}var v=ee(),Ie="__sentry_xhr_v2__",Zt={},Xo={};function gc(t){if(!Xo[t])switch(Xo[t]=!0,t){case"console":hc();break;case"dom":Cc();break;case"xhr":yc();break;case"fetch":Sc();break;case"history":Ec();break;case"error":Rc();break;case"unhandledrejection":xc();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("unknown instrumentation type:",t);return}}function N(t,e){Zt[t]=Zt[t]||[],Zt[t].push(e),gc(t)}function te(t,e){if(!(!t||!Zt[t]))for(let r of Zt[t]||[])try{r(e)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.error(`Error while triggering instrumentation handler.
3
+ Type: ${t}
4
+ Name: ${z(r)}
5
+ Error:`,n)}}function hc(){"console"in v&&yt.forEach(function(t){t in v.console&&x(v.console,t,function(e){return function(...r){te("console",{args:r,level:t}),e&&e.apply(v.console,r)}})})}function Sc(){An()&&x(v,"fetch",function(t){return function(...e){let{method:r,url:n}=ei(e),o={args:e,fetchData:{method:r,url:n},startTimestamp:Date.now()};return te("fetch",{...o}),t.apply(v,e).then(i=>(te("fetch",{...o,endTimestamp:Date.now(),response:i}),i),i=>{throw te("fetch",{...o,endTimestamp:Date.now(),error:i}),i})}})}function Mn(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Jo(t){return typeof t=="string"?t:t?Mn(t,"url")?t.url:t.toString?t.toString():"":""}function ei(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[r,n]=t;return{url:Jo(r),method:Mn(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:Jo(e),method:Mn(e,"method")?String(e.method).toUpperCase():"GET"}}function yc(){if(!("XMLHttpRequest"in v))return;let t=XMLHttpRequest.prototype;x(t,"open",function(e){return function(...r){let n=r[1],o=this[Ie]={method:B(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};B(n)&&o.method==="POST"&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let i=()=>{let a=this[Ie];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}te("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?x(this,"onreadystatechange",function(a){return function(...s){return i(),a.apply(this,s)}}):this.addEventListener("readystatechange",i),x(this,"setRequestHeader",function(a){return function(...s){let[c,l]=s,d=this[Ie];return d&&(d.request_headers[c.toLowerCase()]=l),a.apply(this,s)}}),e.apply(this,r)}}),x(t,"send",function(e){return function(...r){let n=this[Ie];return n&&r[0]!==void 0&&(n.body=r[0]),te("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),e.apply(this,r)}})}var Rr;function Ec(){if(!Ko())return;let t=v.onpopstate;v.onpopstate=function(...r){let n=v.location.href,o=Rr;if(Rr=n,te("history",{from:o,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){let o=n.length>2?n[2]:void 0;if(o){let i=Rr,a=String(o);Rr=a,te("history",{from:i,to:a})}return r.apply(this,n)}}x(v.history,"pushState",e),x(v.history,"replaceState",e)}var vc=1e3,xr,Nr;function bc(t,e){if(!t||t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch{}return!1}function Tc(t){if(t.type!=="keypress")return!1;try{let e=t.target;if(!e||!e.tagName)return!0;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return!1}catch{}return!0}function Qo(t,e=!1){return r=>{if(!r||Nr===r||Tc(r))return;let n=r.type==="keypress"?"input":r.type;xr===void 0?(t({event:r,name:n,global:e}),Nr=r):bc(Nr,r)&&(t({event:r,name:n,global:e}),Nr=r),clearTimeout(xr),xr=v.setTimeout(()=>{xr=void 0},vc)}}function Cc(){if(!("document"in v))return;let t=te.bind(null,"dom"),e=Qo(t,!0);v.document.addEventListener("click",e,!1),v.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let n=v[r]&&v[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(x(n,"addEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=l[i]=l[i]||{refCount:0};if(!d.handler){let f=Qo(t);d.handler=f,o.call(this,i,f,s)}d.refCount++}catch{}return o.call(this,i,a,s)}}),x(n,"removeEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__||{},d=l[i];d&&(d.refCount--,d.refCount<=0&&(o.call(this,i,d.handler,s),d.handler=void 0,delete l[i]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,a,s)}}))})}var Ir=null;function Rc(){Ir=v.onerror,v.onerror=function(t,e,r,n,o){return te("error",{column:n,error:o,line:r,msg:t,url:e}),Ir&&!Ir.__SENTRY_LOADER__?Ir.apply(this,arguments):!1},v.onerror.__SENTRY_INSTRUMENTED__=!0}var Or=null;function xc(){Or=v.onunhandledrejection,v.onunhandledrejection=function(t){return te("unhandledrejection",t),Or&&!Or.__SENTRY_LOADER__?Or.apply(this,arguments):!0},v.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function ti(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function r(o){if(t)return e.has(o)?!0:(e.add(o),!1);for(let i=0;i<e.length;i++)if(e[i]===o)return!0;return e.push(o),!1}function n(o){if(t)e.delete(o);else for(let i=0;i<e.length;i++)if(e[i]===o){e.splice(i,1);break}}return[r,n]}function F(){let t=R,e=t.crypto||t.msCrypto;if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");let r=e&&e.getRandomValues?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>Math.random()*16;return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function ri(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function re(t){let{message:e,event_id:r}=t;if(e)return e;let n=ri(t);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function vt(t,e,r){let n=t.exception=t.exception||{},o=n.values=n.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=r||"Error")}function Oe(t,e){let r=ri(t);if(!r)return;let n={type:"generic",handled:!0},o=r.mechanism;if(r.mechanism={...n,...o,...e},e&&"data"in e){let i={...o&&o.data,...e.data};r.mechanism.data=i}}function Pr(t){if(t&&t.__sentry_captured__)return!0;try{Et(t,"__sentry_captured__",!0)}catch{}return!1}function Kt(t){return Array.isArray(t)?t:[t]}function kn(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Bn(){return"npm"}function ni(){return!kn()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function oi(t,e){return t.require(e)}function ne(t,e=100,r=1/0){try{return Dr("",t,e,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function Ar(t,e=3,r=100*1024){let n=ne(t,e);return Pc(n)>r?Ar(t,e-1,r):n}function Dr(t,e,r=1/0,n=1/0,o=ti()){let[i,a]=o;if(e==null||["number","boolean","string"].includes(typeof e)&&!zt(e))return e;let s=Nc(t,e);if(!s.startsWith("[object "))return s;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:r;if(c===0)return s.replace("object ","");if(i(e))return"[Circular ~]";let l=e;if(l&&typeof l.toJSON=="function")try{let p=l.toJSON();return Dr("",p,c-1,n,o)}catch{}let d=Array.isArray(e)?[]:{},f=0,m=vr(e);for(let p in m){if(!Object.prototype.hasOwnProperty.call(m,p))continue;if(f>=n){d[p]="[MaxProperties ~]";break}let y=m[p];d[p]=Dr(p,y,c-1,n,o),f++}return a(e),d}function Nc(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Tn(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${z(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let r=Ic(e);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Ic(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function Oc(t){return~-encodeURI(t).split(/%..|./).length}function Pc(t){return Oc(JSON.stringify(t))}var Pe;(function(t){t[t.PENDING=0]="PENDING";let r=1;t[t.RESOLVED=r]="RESOLVED";let n=2;t[t.REJECTED=n]="REJECTED"})(Pe||(Pe={}));function w(t){return new b(e=>{e(t)})}function qe(t){return new b((e,r)=>{r(t)})}var b=class{__init(){this._state=Pe.PENDING}__init2(){this._handlers=[]}constructor(e){b.prototype.__init.call(this),b.prototype.__init2.call(this),b.prototype.__init3.call(this),b.prototype.__init4.call(this),b.prototype.__init5.call(this),b.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(r){this._reject(r)}}then(e,r){return new b((n,o)=>{this._handlers.push([!1,i=>{if(!e)n(i);else try{n(e(i))}catch(a){o(a)}},i=>{if(!r)o(i);else try{n(r(i))}catch(a){o(a)}}]),this._executeHandlers()})}catch(e){return this.then(r=>r,e)}finally(e){return new b((r,n)=>{let o,i;return this.then(a=>{i=!1,o=a,e&&e()},a=>{i=!0,o=a,e&&e()}).then(()=>{if(i){n(o);return}r(o)})})}__init3(){this._resolve=e=>{this._setResult(Pe.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Pe.REJECTED,e)}}__init5(){this._setResult=(e,r)=>{if(this._state===Pe.PENDING){if(st(r)){r.then(this._resolve,this._reject);return}this._state=e,this._value=r,this._executeHandlers()}}}__init6(){this._executeHandlers=()=>{if(this._state===Pe.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(r=>{r[0]||(this._state===Pe.RESOLVED&&r[1](this._value),this._state===Pe.REJECTED&&r[2](this._value),r[0]=!0)})}}};function wn(t){let e=[];function r(){return t===void 0||e.length<t}function n(a){return e.splice(e.indexOf(a),1)[0]}function o(a){if(!r())return qe(new D("Not adding Promise because buffer limit was reached."));let s=a();return e.indexOf(s)===-1&&e.push(s),s.then(()=>n(s)).then(null,()=>n(s).then(null,()=>{})),s}function i(a){return new b((s,c)=>{let l=e.length;if(!l)return s(!0);let d=setTimeout(()=>{a&&a>0&&s(!1)},a);e.forEach(f=>{w(f).then(()=>{--l||(clearTimeout(d),s(!0))},c)})})}return{$:e,add:o,drain:i}}function Xt(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}var ii=["fatal","error","warning","log","info","debug"];function Ln(t){return t==="warn"?"warning":ii.includes(t)?t:"log"}var si=ee(),Gn={nowSeconds:()=>Date.now()/1e3};function Dc(){let{performance:t}=si;if(!t||!t.now)return;let e=Date.now()-t.now();return{now:()=>t.now(),timeOrigin:e}}function Ac(){try{return oi(module,"perf_hooks").performance}catch{return}}var Fn=ni()?Ac():Dc(),ai=Fn===void 0?Gn:{nowSeconds:()=>(Fn.timeOrigin+Fn.now())/1e3},De=Gn.nowSeconds.bind(Gn),oe=ai.nowSeconds.bind(ai);var Jt,ie=(()=>{let{performance:t}=si;if(!t||!t.now){Jt="none";return}let e=3600*1e3,r=t.now(),n=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+r-n):e,i=o<e,a=t.timing&&t.timing.navigationStart,c=typeof a=="number"?Math.abs(a+r-n):e,l=c<e;return i||l?o<=c?(Jt="timeOrigin",t.timeOrigin):(Jt="navigationStart",a):(Jt="dateNow",n)})();var ci=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Qt(t){let e=t.match(ci);if(!t||!e)return;let r;return e[3]==="1"?r=!0:e[3]==="0"&&(r=!1),{traceId:e[1],parentSampled:r,parentSpanId:e[2]}}function ge(t,e=[]){return[t,e]}function Hn(t,e){let[r,n]=t;return[r,[...n,e]]}function Mr(t,e){let r=t[1];for(let n of r){let o=n[0].type;if(e(n,o))return!0}return!1}function Un(t,e){return(e||new TextEncoder).encode(t)}function Yn(t,e){let[r,n]=t,o=JSON.stringify(r);function i(a){typeof o=="string"?o=typeof a=="string"?o+a:[Un(o,e),a]:o.push(typeof a=="string"?Un(a,e):a)}for(let a of n){let[s,c]=a;if(i(`
6
+ ${JSON.stringify(s)}
7
+ `),typeof c=="string"||c instanceof Uint8Array)i(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(ne(c))}i(l)}}return typeof o=="string"?o:Mc(o)}function Mc(t){let e=t.reduce((o,i)=>o+i.length,0),r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function $n(t,e){let r=typeof t.data=="string"?Un(t.data,e):t.data;return[L({type:"attachment",length:r.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),r]}var kc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function kr(t){return kc[t]}function Br(t){if(!t||!t.sdk)return;let{name:e,version:r}=t.sdk;return{name:e,version:r}}function Wn(t,e,r,n){let o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!r&&{dsn:_e(n)},...o&&{trace:L({...o})}}}function Vn(t,e,r){let n=[{type:"client_report"},{timestamp:r||De(),discarded_events:t}];return ge(e?{dsn:e}:{},[n])}function li(t,e=Date.now()){let r=parseInt(`${t}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${t}`);return isNaN(n)?6e4:n-e}function di(t,e){return t[e]||t.all||0}function jn(t,e,r=Date.now()){return di(t,e)>r}function zn(t,{statusCode:e,headers:r},n=Date.now()){let o={...t},i=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(i)for(let s of i.trim().split(",")){let[c,l]=s.split(":",2),d=parseInt(c,10),f=(isNaN(d)?60:d)*1e3;if(!l)o.all=n+f;else for(let m of l.split(";"))o[m]=n+f}else a?o.all=n+li(a,n):e===429&&(o.all=n+60*1e3);return o}var er="baggage",qn="sentry-",ui=/^sentry-/,pi=8192;function Zn(t){if(!B(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((n,o)=>{let i=fi(o);return{...n,...i}},{});else{if(!t)return;e=fi(t)}let r=Object.entries(e).reduce((n,[o,i])=>{if(o.match(ui)){let a=o.slice(qn.length);n[a]=i}return n},{});if(Object.keys(r).length>0)return r}function wr(t){let e=Object.entries(t).reduce((r,[n,o])=>(o&&(r[`${qn}${n}`]=o),r),{});return Bc(e)}function fi(t){return t.split(",").map(e=>e.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((e,[r,n])=>(e[r]=n,e),{})}function Bc(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[r,n],o)=>{let i=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,a=o===0?i:`${e},${i}`;return a.length>pi?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},"")}var bt="production";function mi(t){let e=oe(),r={sid:F(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>wc(r)};return t&&Ae(r,t),r}function Ae(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||oe(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:F()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function _i(t,e){let r={};e?r={status:e}:t.status==="ok"&&(r={status:"exited"}),Ae(t,r)}function wc(t){return L({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}var Lc=100,G=class{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){let r=new G;return e&&(r._breadcrumbs=[...e._breadcrumbs],r._tags={...e._tags},r._extra={...e._extra},r._contexts={...e._contexts},r._user=e._user,r._level=e._level,r._span=e._span,r._session=e._session,r._transactionName=e._transactionName,r._fingerprint=e._fingerprint,r._eventProcessors=[...e._eventProcessors],r._requestSession=e._requestSession,r._attachments=[...e._attachments],r._sdkProcessingMetadata={...e._sdkProcessingMetadata}),r}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Ae(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,r){return this._tags={...this._tags,[e]:r},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,r){return this._extra={...this._extra,[e]:r},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,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){let r=e(this);return r instanceof G?r:this}return e instanceof G?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):Q(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,r){let n=typeof r=="number"?r:Lc;if(n<=0)return this;let o={timestamp:De(),...e};return this._breadcrumbs=[...this._breadcrumbs,o].slice(-n),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}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,r={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};let n=this._span.transaction;if(n){e.sdkProcessingMetadata={dynamicSamplingContext:n.getDynamicSamplingContext(),...e.sdkProcessingMetadata};let o=n.name;o&&(e.tags={transaction:o,...e.tags})}}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...gi(),...this._eventProcessors],e,r)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,r,n,o=0){return new b((i,a)=>{let s=e[o];if(r===null||typeof s!="function")i(r);else{let c=s({...r},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&s.id&&c===null&&u.log(`Event processor "${s.id}" dropped event`),st(c)?c.then(l=>this._notifyEventProcessors(e,l,n,o+1).then(i)).then(null,a):this._notifyEventProcessors(e,c,n,o+1).then(i).then(null,a)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Kt(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function gi(){return ct("globalEventProcessors",()=>[])}function Ze(t){gi().push(t)}var hi=4,Fc=100,Tt=class{constructor(e,r=new G,n=hi){this._version=n,this._stack=[{scope:r}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let r=this.getStackTop();r.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=G.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let r=this.pushScope();try{e(r)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,r){let n=this._lastEventId=r&&r.event_id?r.event_id:F(),o=new Error("Sentry syntheticException");return this._withClient((i,a)=>{i.captureException(e,{originalException:e,syntheticException:o,...r,event_id:n},a)}),n}captureMessage(e,r,n){let o=this._lastEventId=n&&n.event_id?n.event_id:F(),i=new Error(e);return this._withClient((a,s)=>{a.captureMessage(e,r,{originalException:e,syntheticException:i,...n,event_id:o},s)}),o}captureEvent(e,r){let n=r&&r.event_id?r.event_id:F();return e.type||(this._lastEventId=n),this._withClient((o,i)=>{o.captureEvent(e,{...r,event_id:n},i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,r){let{scope:n,client:o}=this.getStackTop();if(!o)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Fc}=o.getOptions&&o.getOptions()||{};if(a<=0)return;let c={timestamp:De(),...e},l=i?hr(()=>i(c,r)):c;l!==null&&(o.emit&&o.emit("beforeAddBreadcrumb",l,r),n.addBreadcrumb(l,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,r){this.getScope().setTag(e,r)}setExtra(e,r){this.getScope().setExtra(e,r)}setContext(e,r){this.getScope().setContext(e,r)}configureScope(e){let{scope:r,client:n}=this.getStackTop();n&&e(r)}run(e){let r=Lr(this);try{e(this)}finally{Lr(r)}}getIntegration(e){let r=this.getClient();if(!r)return null;try{return r.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,r){let n=this._callExtensionMethod("startTransaction",e,r);return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!n&&console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
8
+ Sentry.addTracingExtensions();
9
+ Sentry.init({...});
10
+ `),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let r=this.getStackTop().scope,n=r.getSession();n&&_i(n),this._sendSessionUpdate(),r.setSession()}startSession(e){let{scope:r,client:n}=this.getStackTop(),{release:o,environment:i=bt}=n&&n.getOptions()||{},{userAgent:a}=R.navigator||{},s=mi({release:o,environment:i,user:r.getUser(),...a&&{userAgent:a},...e}),c=r.getSession&&r.getSession();return c&&c.status==="ok"&&Ae(c,{status:"exited"}),this.endSession(),r.setSession(s),s}shouldSendDefaultPii(){let e=this.getClient(),r=e&&e.getOptions();return!!(r&&r.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:r}=this.getStackTop(),n=e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}_withClient(e){let{scope:r,client:n}=this.getStackTop();n&&e(n,r)}_callExtensionMethod(e,...r){let o=dt().__SENTRY__;if(o&&o.extensions&&typeof o.extensions[e]=="function")return o.extensions[e].apply(this,r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function dt(){return R.__SENTRY__=R.__SENTRY__||{extensions:{},hub:void 0},R}function Lr(t){let e=dt(),r=tr(e);return Kn(e,t),r}function _(){let t=dt();if(t.__SENTRY__&&t.__SENTRY__.acs){let e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Gc(t)}function Gc(t=dt()){return(!Uc(t)||tr(t).isOlderThan(hi))&&Kn(t,new Tt),tr(t)}function Uc(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function tr(t){return ct("hub",()=>new Tt,t)}function Kn(t,e){if(!t)return!1;let r=t.__SENTRY__=t.__SENTRY__||{};return r.hub=e,!0}function Ct(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=_().getClient(),r=t||e&&e.getOptions();return!!r&&(r.enableTracing||"tracesSampleRate"in r||"tracesSampler"in r)}function ae(t){return(t||_()).getScope().getTransaction()}var Si=!1;function yi(){Si||(Si=!0,N("error",Xn),N("unhandledrejection",Xn))}function Xn(){let t=ae();if(t){let e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}Xn.tag="sentry_tracingErrorCallback";var Ke=class{__init(){this.spans=[]}constructor(e=1e3){Ke.prototype.__init.call(this),this._maxlen=e}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},q=class{__init2(){this.traceId=F()}__init3(){this.spanId=F().substring(16)}__init4(){this.startTimestamp=oe()}__init5(){this.tags={}}__init6(){this.data={}}__init7(){this.instrumenter="sentry"}constructor(e){if(q.prototype.__init2.call(this),q.prototype.__init3.call(this),q.prototype.__init4.call(this),q.prototype.__init5.call(this),q.prototype.__init6.call(this),q.prototype.__init7.call(this),!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp),e.instrumenter&&(this.instrumenter=e.instrumenter)}startChild(e){let r=new q({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(r.spanRecorder=this.spanRecorder,r.spanRecorder&&r.spanRecorder.add(r),r.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&r.transaction){let n=e&&e.op||"< unknown op >",o=r.transaction.name||"< unknown name >",i=r.transaction.spanId,a=`[Tracing] Starting '${n}' span on transaction '${o}' (${i}).`;r.transaction.metadata.spanMetadata[r.spanId]={logMessage:a},u.log(a)}return r}setTag(e,r){return this.tags={...this.tags,[e]:r},this}setData(e,r){return this.data={...this.data,[e]:r},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e));let r=Ei(e);return r!=="unknown_error"&&this.setStatus(r),this}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:r}=this.transaction.metadata.spanMetadata[this.spanId];r&&u.log(r.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:oe()}toTraceparent(){let e="";return this.sampled!==void 0&&(e=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${e}`}toContext(){return L({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return L({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return L({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})}};function Ei(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}var he=class extends q{__init(){this._measurements={}}__init2(){this._contexts={}}__init3(){this._frozenDynamicSamplingContext=void 0}constructor(e,r){super(e),he.prototype.__init.call(this),he.prototype.__init2.call(this),he.prototype.__init3.call(this),this._hub=r||_(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;let n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}setName(e,r="custom"){this._name=e,this.metadata.source=r}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Ke(e)),this.spanRecorder.add(this)}setContext(e,r){r===null?delete this._contexts[e]:this._contexts[e]=r}setMeasurement(e,r,n=""){this._measurements[e]={value:r,unit:n}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let r=this._hub.getClient();if(r&&r.emit&&r.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),r&&r.recordDroppedEvent("sample_rate","transaction");return}let n=this.spanRecorder?this.spanRecorder.spans.filter(s=>s!==this&&s.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((s,c)=>s.endTimestamp&&c.endTimestamp?s.endTimestamp>c.endTimestamp?s:c:s).endTimestamp);let o=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...o,dynamicSamplingContext:this.getDynamicSamplingContext()},...o.source&&{transaction_info:{source:o.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){let e=super.toContext();return L({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||_(),r=e&&e.getClient();if(!r)return{};let{environment:n,release:o}=r.getOptions()||{},{publicKey:i}=r.getDsn()||{},a=this.metadata.sampleRate,s=a!==void 0?a.toString():void 0,{segment:c}=e.getScope().getUser()||{},l=this.metadata.source,d=l&&l!=="url"?this.name:void 0,f=L({environment:n||bt,release:o,transaction:d,user_segment:c,public_key:i,trace_id:this.traceId,sample_rate:s});return r.emit&&r.emit("createDsc",f),f}setHub(e){this._hub=e}};var xt={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Hc="finishReason",Rt=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],Jn=class extends Ke{constructor(e,r,n,o){super(o),this._pushActivity=e,this._popActivity=r,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=r=>{e.endTimestamp=typeof r=="number"?r:oe(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},Z=class extends he{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._idleTimeoutCanceledPermanently=!1}__init5(){this._beforeFinishCallbacks=[]}__init6(){this._finishReason=Rt[4]}constructor(e,r,n=xt.idleTimeout,o=xt.finalTimeout,i=xt.heartbeatInterval,a=!1){super(e,r),this._idleHub=r,this._idleTimeout=n,this._finalTimeout=o,this._heartbeatInterval=i,this._onScope=a,Z.prototype.__init.call(this),Z.prototype.__init2.call(this),Z.prototype.__init3.call(this),Z.prototype.__init4.call(this),Z.prototype.__init5.call(this),Z.prototype.__init6.call(this),a&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),r.configureScope(s=>s.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Rt[3],this.finish())},this._finalTimeout)}finish(e=oe()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Hc,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let r of this._beforeFinishCallbacks)r(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanId===this.spanId)return!0;r.endTimestamp||(r.endTimestamp=e,r.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));let n=r.startTimestamp<e;return n||(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(r,void 0,2)),n}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] No active IdleTransaction");if(this._onScope){let r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let r=o=>{this._finished||this._pushActivity(o)},n=o=>{this._finished||this._popActivity(o)};this.spanRecorder=new Jn(r,n,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:r}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=r===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Rt[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Rt[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let r=oe();this._idleTimeoutCanceledPermanently?(this._finishReason=Rt[5],this.finish(r)):this._restartIdleTimeout(r+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Rt[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function Yc(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function vi(t,e,r){if(!Ct(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let n;return typeof e.tracesSampler=="function"?(n=e.tracesSampler(r),t.setMetadata({sampleRate:Number(n)})):r.parentSampled!==void 0?n=r.parentSampled:typeof e.tracesSampleRate<"u"?(n=e.tracesSampleRate,t.setMetadata({sampleRate:Number(n)})):(n=1,t.setMetadata({sampleRate:n})),$c(n)?n?(t.sampled=Math.random()<n,t.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),t)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function $c(t){return zt(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function Wc(t,e){let r=this.getClient(),n=r&&r.getOptions()||{},o=n.instrumenter||"sentry",i=t.instrumenter||"sentry";o!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${o}\` instrumenter.
11
+ The transaction will not be sampled. Please use the ${o} instrumentation to start transactions.`),t.sampled=!1);let a=new he(t,this);return a=vi(a,n,{parentSampled:t.parentSampled,transactionContext:t,...e}),a.sampled&&a.initSpanRecorder(n._experiments&&n._experiments.maxSpans),r&&r.emit&&r.emit("startTransaction",a),a}function Fr(t,e,r,n,o,i,a){let s=t.getClient(),c=s&&s.getOptions()||{},l=new Z(e,t,r,n,a,o);return l=vi(l,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),s&&s.emit&&s.emit("startTransaction",l),l}function Gr(){let t=dt();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=Wc),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=Yc),yi())}function Nt(t,e){return _().captureException(t,{captureContext:e})}function Ur(t){_().configureScope(t)}function Hr(t,e){_().setContext(t,e)}function Yr(t){_().withScope(t)}var Vc="7";function jc(t){let e=t.protocol?`${t.protocol}:`:"",r=t.port?`:${t.port}`:"";return`${e}//${t.host}${r}${t.path?`/${t.path}`:""}/api/`}function zc(t){return`${jc(t)}${t.projectId}/envelope/`}function qc(t,e){return Nn({sentry_key:t.publicKey,sentry_version:Vc,...e&&{sentry_client:`${e.name}/${e.version}`}})}function bi(t,e={}){let r=typeof e=="string"?e:e.tunnel,n=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return r||`${zc(t)}?${qc(t,n)}`}function Zc(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function Ti(t,e,r,n){let o=Br(r),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!n&&{dsn:_e(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return ge(i,[a])}function Ci(t,e,r,n){let o=Br(r),i=t.type&&t.type!=="replay_event"?t.type:"event";Zc(t,r&&r.sdk);let a=Wn(t,o,n,e);return delete t.sdkProcessingMetadata,ge(a,[[{type:i},t]])}var Ri=[];function Kc(t){let e={};return t.forEach(r=>{let{name:n}=r,o=e[n];o&&!o.isDefaultInstance&&r.isDefaultInstance||(e[n]=r)}),Object.keys(e).map(r=>e[r])}function Qn(t){let e=t.defaultIntegrations||[],r=t.integrations;e.forEach(a=>{a.isDefaultInstance=!0});let n;Array.isArray(r)?n=[...e,...r]:typeof r=="function"?n=Kt(r(e)):n=e;let o=Kc(n),i=Xc(o,a=>a.name==="Debug");if(i!==-1){let[a]=o.splice(i,1);o.push(a)}return o}function xi(t){let e={};return t.forEach(r=>{r&&eo(r,e)}),e}function eo(t,e){e[t.name]=t,Ri.indexOf(t.name)===-1&&(t.setupOnce(Ze,_),Ri.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`Integration installed: ${t.name}`))}function Xc(t,e){for(let r=0;r<t.length;r++)if(e(t[r])===!0)return r;return-1}function Ii(t,e,r,n){let{normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=t,a={...e,event_id:e.event_id||r.event_id||F(),timestamp:e.timestamp||De()},s=r.integrations||t.integrations.map(d=>d.name);Jc(a,t),el(a,s),e.type===void 0&&Qc(a,t.stackParser);let c=n;r.captureContext&&(c=G.clone(c).update(r.captureContext));let l=w(a);if(c){if(c.getAttachments){let d=[...r.attachments||[],...c.getAttachments()];d.length&&(r.attachments=d)}l=c.applyToEvent(a,r)}return l.then(d=>typeof o=="number"&&o>0?tl(d,o,i):d)}function Jc(t,e){let{environment:r,release:n,dist:o,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?r:bt),t.release===void 0&&n!==void 0&&(t.release=n),t.dist===void 0&&o!==void 0&&(t.dist=o),t.message&&(t.message=je(t.message,i));let a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=je(a.value,i));let s=t.request;s&&s.url&&(s.url=je(s.url,i))}var Ni=new WeakMap;function Qc(t,e){let r=R._sentryDebugIds;if(!r)return;let n,o=Ni.get(e);o?n=o:(n=new Map,Ni.set(e,n));let i=Object.keys(r).reduce((c,l)=>{let d,f=n.get(l);f?d=f:(d=e(l),n.set(l,d));for(let m=d.length-1;m>=0;m--){let p=d[m];if(p.filename){c[p.filename]=r[l];break}}return c},{}),a=new Set;try{t.exception.values.forEach(c=>{c.stacktrace.frames.forEach(l=>{l.filename&&a.add(l.filename)})})}catch{}t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let s=t.debug_meta.images;a.forEach(c=>{i[c]&&s.push({type:"sourcemap",code_file:c,debug_id:i[c]})})}function el(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function tl(t,e,r){if(!t)return null;let n={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:ne(o.data,e,r)}}))},...t.user&&{user:ne(t.user,e,r)},...t.contexts&&{contexts:ne(t.contexts,e,r)},...t.extra&&{extra:ne(t.extra,e,r)}};return t.contexts&&t.contexts.trace&&n.contexts&&(n.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(n.contexts.trace.data=ne(t.contexts.trace.data,e,r))),t.spans&&(n.spans=t.spans.map(o=>(o.data&&(o.data=ne(o.data,e,r)),o))),n}var Oi="Not capturing exception because it's already been captured.",se=class{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(se.prototype.__init.call(this),se.prototype.__init2.call(this),se.prototype.__init3.call(this),se.prototype.__init4.call(this),se.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=Sr(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("No DSN provided, client will not do anything."),this._dsn){let r=bi(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}}captureException(e,r,n){if(Pr(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(Oi);return}let o=r&&r.event_id;return this._process(this.eventFromException(e,r).then(i=>this._captureEvent(i,r,n)).then(i=>{o=i})),o}captureMessage(e,r,n,o){let i=n&&n.event_id,a=ht(e)?this.eventFromMessage(String(e),r,n):this.eventFromException(e,n);return this._process(a.then(s=>this._captureEvent(s,n,o)).then(s=>{i=s})),i}captureEvent(e,r,n){if(r&&r.originalException&&Pr(r.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(Oi);return}let o=r&&r.event_id;return this._process(this._captureEvent(e,r,n).then(i=>{o=i})),o}captureSession(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("SDK not enabled, will not capture session.");return}typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ae(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let r=this._transport;return r?this._isClientDoneProcessing(e).then(n=>r.flush(e).then(o=>n&&o)):w(!0)}close(e){return this.flush(e).then(r=>(this.getOptions().enabled=!1,r))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=xi(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){eo(e,this._integrations)}sendEvent(e,r={}){if(this._dsn){let n=Ci(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of r.attachments||[])n=Hn(n,$n(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let o=this._sendEnvelope(n);o&&o.then(i=>this.emit("afterSendEvent",e,i),null)}}sendSession(e){if(this._dsn){let r=Ti(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(r)}}recordDroppedEvent(e,r,n){if(this._options.sendClientReports){let o=`${e}:${r}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`Adding outcome: "${o}"`),this._outcomes[o]=this._outcomes[o]+1||1}}on(e,r){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(r)}emit(e,...r){this._hooks[e]&&this._hooks[e].forEach(n=>n(...r))}_updateSessionFromEvent(e,r){let n=!1,o=!1,i=r.exception&&r.exception.values;if(i){o=!0;for(let c of i){let l=c.mechanism;if(l&&l.handled===!1){n=!0;break}}}let a=e.status==="ok";(a&&e.errors===0||a&&n)&&(Ae(e,{...n&&{status:"crashed"},errors:e.errors||Number(o||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new b(r=>{let n=0,o=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),r(!0)):(n+=o,e&&n>=e&&(clearInterval(i),r(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,r,n){let o=this.getOptions(),i=Object.keys(this._integrations);return!r.integrations&&i.length>0&&(r.integrations=i),Ii(o,e,r,n)}_captureEvent(e,r={},n){return this._processEvent(e,r,n).then(o=>o.event_id,o=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=o;i.logLevel==="log"?u.log(i.message):u.warn(i)}})}_processEvent(e,r,n){let o=this.getOptions(),{sampleRate:i}=o;if(!this._isEnabled())return qe(new D("SDK not enabled, will not capture event.","log"));let a=Di(e),s=Pi(e),c=e.type||"error",l=`before send for type \`${c}\``;if(s&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),qe(new D(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let d=c==="replay_event"?"replay":c;return this._prepareEvent(e,r,n).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",d,e),new D("An event processor returned `null`, will not send event.","log");if(r.data&&r.data.__sentry__===!0)return f;let p=nl(o,f,r);return rl(p,l)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",d,e),new D(`${l} returned \`null\`, will not send event.`,"log");let m=n&&n.getSession();!a&&m&&this._updateSessionFromEvent(m,f);let p=f.transaction_info;if(a&&p&&f.transaction!==e.transaction){let y="custom";f.transaction_info={...p,source:y}}return this.sendEvent(f,r),f}).then(null,f=>{throw f instanceof D?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new D(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
12
+ Reason: ${f}`))})}_process(e){this._numProcessing++,e.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,r=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.error("Error while sending event:",r)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(r=>{let[n,o]=r.split(":");return{reason:n,category:o,quantity:e[r]}})}};function rl(t,e){let r=`${e} must return \`null\` or a valid event.`;if(st(t))return t.then(n=>{if(!Q(n)&&n!==null)throw new D(r);return n},n=>{throw new D(`${e} rejected with ${n}`)});if(!Q(t)&&t!==null)throw new D(r);return t}function nl(t,e,r){let{beforeSend:n,beforeSendTransaction:o}=t;return Pi(e)&&n?n(e,r):Di(e)&&o?o(e,r):e}function Pi(t){return t.type===void 0}function Di(t){return t.type==="transaction"}function to(t,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?u.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let r=_();r.getScope().update(e.initialScope);let o=new t(e);r.bindClient(o)}var ol=30;function It(t,e,r=wn(t.bufferSize||ol)){let n={},o=a=>r.drain(a);function i(a){let s=[];if(Mr(a,(f,m)=>{let p=kr(m);if(jn(n,p)){let y=Ai(f,m);t.recordDroppedEvent("ratelimit_backoff",p,y)}else s.push(f)}),s.length===0)return w();let c=ge(a[0],s),l=f=>{Mr(c,(m,p)=>{let y=Ai(m,p);t.recordDroppedEvent(f,kr(p),y)})},d=()=>e({body:Yn(c,t.textEncoder)}).then(f=>(f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),n=zn(n,f),f),f=>{throw l("network_error"),f});return r.add(d).then(f=>f,f=>{if(f instanceof D)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.error("Skipped sending event because buffer is full."),l("queue_overflow"),w();throw f})}return i.__sentry__baseTransport__=!0,{send:i,flush:o}}function Ai(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}var rr="7.54.0";var ft={};yn(ft,{FunctionToString:()=>Me,InboundFilters:()=>Se});var Mi,Me=class{constructor(){Me.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Me.id}setupOnce(){Mi=Function.prototype.toString;try{Function.prototype.toString=function(...e){let r=lt(this)||this;return Mi.apply(r,e)}}catch{}}};Me.__initStatic();var il=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],al=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/],Se=class{static __initStatic(){this.id="InboundFilters"}__init(){this.name=Se.id}constructor(e={}){this._options=e,Se.prototype.__init.call(this)}setupOnce(e,r){let n=o=>{let i=r();if(i){let a=i.getIntegration(Se);if(a){let s=i.getClient(),c=s?s.getOptions():{},l=sl(a._options,c);return cl(o,l)?null:o}}return o};n.id=this.name,e(n)}};Se.__initStatic();function sl(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:il],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:al],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function cl(t,e){return e.ignoreInternal&&ml(t)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Event dropped due to being internal Sentry Error.
13
+ Event: ${re(t)}`),!0):ll(t,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
14
+ Event: ${re(t)}`),!0):dl(t,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
15
+ Event: ${re(t)}`),!0):fl(t,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Event dropped due to being matched by \`denyUrls\` option.
16
+ Event: ${re(t)}.
17
+ Url: ${$r(t)}`),!0):ul(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`Event dropped due to not being matched by \`allowUrls\` option.
18
+ Event: ${re(t)}.
19
+ Url: ${$r(t)}`),!0)}function ll(t,e){return t.type||!e||!e.length?!1:pl(t).some(r=>ze(r,e))}function dl(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?ze(r,e):!1}function fl(t,e){if(!e||!e.length)return!1;let r=$r(t);return r?ze(r,e):!1}function ul(t,e){if(!e||!e.length)return!0;let r=$r(t);return r?ze(r,e):!0}function pl(t){if(t.message)return[t.message];if(t.exception){let{values:e}=t.exception;try{let{type:r="",value:n=""}=e&&e[e.length-1]||{};return[`${n}`,`${r}: ${n}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.error(`Cannot extract message for event ${re(t)}`),[]}}return[]}function ml(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function _l(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function $r(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?_l(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.error(`Cannot extract url for event ${re(t)}`),null}}var h=R,ro=0;function no(){return ro>0}function Rl(){ro++,setTimeout(()=>{ro--})}function Xe(t,e={},r){if(typeof t!="function")return t;try{let o=t.__sentry_wrapped__;if(o)return o;if(lt(t))return t}catch{return t}let n=function(){let o=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let i=o.map(a=>Xe(a,e));return t.apply(this,i)}catch(i){throw Rl(),Yr(a=>{a.addEventProcessor(s=>(e.mechanism&&(vt(s,void 0,void 0),Oe(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Nt(i)}),i}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}catch{}Er(n,t),Et(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function ao(t,e){let r=so(t,e),n={type:e&&e.name,value:Ol(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function xl(t,e,r,n){let i=_().getClient(),a=i&&i.getOptions().normalizeDepth,s={exception:{values:[{type:St(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:`Non-Error ${n?"promise rejection":"exception"} captured with keys: ${In(e)}`}]},extra:{__serialized__:Ar(e,a)}};if(r){let c=so(t,r);c.length&&(s.exception.values[0].stacktrace={frames:c})}return s}function oo(t,e){return{exception:{values:[ao(t,e)]}}}function so(t,e){let r=e.stacktrace||e.stack||"",n=Il(e);try{return t(r,n)}catch{}return[]}var Nl=/Minified React error #\d+;/i;function Il(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(Nl.test(t.message))return 1}return 0}function Ol(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function ki(t,e,r,n){let o=r&&r.syntheticException||void 0,i=Wr(t,e,o,n);return Oe(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),w(i)}function Bi(t,e,r="info",n,o){let i=n&&n.syntheticException||void 0,a=io(t,e,i,o);return a.level=r,n&&n.event_id&&(a.event_id=n.event_id),w(a)}function Wr(t,e,r,n,o){let i;if(jt(e)&&e.error)return oo(t,e.error);if(mr(e)||En(e)){let a=e;if("stack"in e)i=oo(t,e);else{let s=a.name||(mr(a)?"DOMError":"DOMException"),c=a.message?`${s}: ${a.message}`:s;i=io(t,c,r,n),vt(i,c)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return Vt(e)?oo(t,e):Q(e)||St(e)?(i=xl(t,e,r,o),Oe(i,{synthetic:!0}),i):(i=io(t,e,r,n),vt(i,`${e}`,void 0),Oe(i,{synthetic:!0}),i)}function io(t,e,r,n){let o={message:e};if(n&&r){let i=so(t,r);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]})}return o}var Vr=1024,co="Breadcrumbs",ye=class{static __initStatic(){this.id=co}__init(){this.name=ye.id}constructor(e){ye.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&N("console",Dl),this.options.dom&&N("dom",Pl(this.options.dom)),this.options.xhr&&N("xhr",Al),this.options.fetch&&N("fetch",Ml),this.options.history&&N("history",kl)}addSentryBreadcrumb(e){this.options.sentry&&_().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:re(e)},{event:e})}};ye.__initStatic();function Pl(t){function e(r){let n,o=typeof t=="object"?t.serializeAttribute:void 0,i=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;i&&i>Vr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`\`dom.maxStringLength\` cannot exceed ${Vr}, but a value of ${i} was configured. Sentry will use ${Vr} instead.`),i=Vr),typeof o=="string"&&(o=[o]);try{let a=r.event;n=Bl(a)?me(a.target,{keyAttrs:o,maxStringLength:i}):me(a,{keyAttrs:o,maxStringLength:i})}catch{n="<unknown>"}n.length!==0&&_().addBreadcrumb({category:`ui.${r.name}`,message:n},{event:r.event,name:r.name,global:r.global})}return e}function Dl(t){for(let r=0;r<t.args.length;r++)if(t.args[r]==="ref=Ref<"){t.args[r+1]="viewRef";break}let e={category:"console",data:{arguments:t.args,logger:"console"},level:Ln(t.level),message:yr(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)e.message=`Assertion failed: ${yr(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1);else return;_().addBreadcrumb(e,{input:t.args,level:t.level})}function Al(t){let{startTimestamp:e,endTimestamp:r}=t,n=t.xhr[Ie];if(!e||!r||!n)return;let{method:o,url:i,status_code:a,body:s}=n,c={method:o,url:i,status_code:a},l={xhr:t.xhr,input:s,startTimestamp:e,endTimestamp:r};_().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function Ml(t){let{startTimestamp:e,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"))if(t.error){let n=t.fetchData,o={data:t.error,input:t.args,startTimestamp:e,endTimestamp:r};_().addBreadcrumb({category:"fetch",data:n,level:"error",type:"http"},o)}else{let n={...t.fetchData,status_code:t.response&&t.response.status},o={input:t.args,response:t.response,startTimestamp:e,endTimestamp:r};_().addBreadcrumb({category:"fetch",data:n,type:"http"},o)}}function kl(t){let e=t.from,r=t.to,n=Xt(h.location.href),o=Xt(e),i=Xt(r);o.path||(o=n),n.protocol===i.protocol&&n.host===i.host&&(r=i.relative),n.protocol===o.protocol&&n.host===o.host&&(e=o.relative),_().addBreadcrumb({category:"navigation",data:{from:e,to:r}})}function Bl(t){return t&&!!t.target}function wi(t,{metadata:e,tunnel:r,dsn:n}){let o={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!r&&!!n&&{dsn:_e(n)}},i=wl(t);return ge(o,[i])}function wl(t){return[{type:"user_report"},t]}var jr=class extends se{constructor(e){let r=h.SENTRY_SDK_SOURCE||Bn();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${r}:@sentry/browser`,version:rr}],version:rr},super(e),e.sendClientReports&&h.document&&h.document.addEventListener("visibilitychange",()=>{h.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,r){return ki(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return Bi(this._options.stackParser,e,r,n,this._options.attachStacktrace)}sendEvent(e,r){let n=this.getIntegrationById(co);n&&n.addSentryBreadcrumb&&n.addSentryBreadcrumb(e),super.sendEvent(e,r)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("SDK not enabled, will not capture user feedback.");return}let r=wi(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(r)}_prepareEvent(e,r,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("Sending outcomes:",e);let r=Vn(e,this._options.tunnel&&_e(this._dsn));this._sendEnvelope(r)}};var nr;function Li(){if(nr)return nr;if(qt(h.fetch))return nr=h.fetch.bind(h);let t=h.document,e=h.fetch;if(t&&typeof t.createElement=="function")try{let r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r);let n=r.contentWindow;n&&n.fetch&&(e=n.fetch),t.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return nr=e.bind(h)}function Fi(){nr=void 0}function Gi(t,e=Li()){let r=0,n=0;function o(i){let a=i.body.length;r+=a,n++;let s={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15,...t.fetchOptions};try{return e(t.url,s).then(c=>(r-=a,n--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return Fi(),r-=a,n--,qe(c)}}return It(t,o)}var Ll=4;function Ui(t){function e(r){return new b((n,o)=>{let i=new XMLHttpRequest;i.onerror=o,i.onreadystatechange=()=>{i.readyState===Ll&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",t.url);for(let a in t.headers)Object.prototype.hasOwnProperty.call(t.headers,a)&&i.setRequestHeader(a,t.headers[a]);i.send(r.body)})}return It(t,e)}var zr="?";var Fl=30,Gl=40,Ul=50;function lo(t,e,r,n){let o={filename:t,function:e,in_app:!0};return r!==void 0&&(o.lineno=r),n!==void 0&&(o.colno=n),o}var Hl=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Yl=/\((\S*)(?::(\d+))(?::(\d+))\)/,$l=t=>{let e=Hl.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){let i=Yl.exec(e[2]);i&&(e[2]=i[1],e[3]=i[2],e[4]=i[3])}let[n,o]=Yi(e[1]||zr,e[2]);return lo(o,n,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},Wl=[Fl,$l],Vl=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zl=t=>{let e=Vl.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=jl.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],o=e[1]||zr;return[o,n]=Yi(o,n),lo(n,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},ql=[Ul,zl],Zl=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Kl=t=>{let e=Zl.exec(t);return e?lo(e[2],e[1]||zr,+e[3],e[4]?+e[4]:void 0):void 0},Xl=[Gl,Kl];var Jl=[Wl,ql,Xl],Hi=br(...Jl),Yi=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:zr,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var U=class{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=U.id}__init2(){this._installFunc={onerror:Ql,onunhandledrejection:ed}}constructor(e){U.prototype.__init.call(this),U.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let r in e){let n=this._installFunc[r];n&&e[r]&&(nd(r),n(),this._installFunc[r]=void 0)}}};U.__initStatic();function Ql(){N("error",t=>{let[e,r,n]=Vi();if(!e.getIntegration(U))return;let{msg:o,url:i,line:a,column:s,error:c}=t;if(no()||c&&c.__sentry_own_request__)return;let l=c===void 0&&B(o)?rd(o,i,a,s):$i(Wr(r,c||o,void 0,n,!1),i,a,s);l.level="error",Wi(e,c,l,"onerror")})}function ed(){N("unhandledrejection",t=>{let[e,r,n]=Vi();if(!e.getIntegration(U))return;let o=t;try{"reason"in t?o=t.reason:"detail"in t&&"reason"in t.detail&&(o=t.detail.reason)}catch{}if(no()||o&&o.__sentry_own_request__)return!0;let i=ht(o)?td(o):Wr(r,o,void 0,n,!0);i.level="error",Wi(e,o,i,"onunhandledrejection")})}function td(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function rd(t,e,r,n){let o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=jt(t)?t.message:t,a="Error",s=i.match(o);return s&&(a=s[1],i=s[2]),$i({exception:{values:[{type:a,value:i}]}},e,r,n)}function $i(t,e,r,n){let o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(n,10))?void 0:n,d=isNaN(parseInt(r,10))?void 0:r,f=B(e)&&e.length>0?e:Cn();return c.length===0&&c.push({colno:l,filename:f,function:"?",in_app:!0,lineno:d}),t}function nd(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`Global Handler attached: ${t}`)}function Wi(t,e,r,n){Oe(r,{handled:!1,type:n}),t.captureEvent(r,{originalException:e})}function Vi(){let t=_(),e=t.getClient(),r=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,r.stackParser,r.attachStacktrace]}var od=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Ee=class{static __initStatic(){this.id="TryCatch"}__init(){this.name=Ee.id}constructor(e){Ee.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&x(h,"setTimeout",ji),this._options.setInterval&&x(h,"setInterval",ji),this._options.requestAnimationFrame&&x(h,"requestAnimationFrame",id),this._options.XMLHttpRequest&&"XMLHttpRequest"in h&&x(XMLHttpRequest.prototype,"send",ad);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:od).forEach(sd)}};Ee.__initStatic();function ji(t){return function(...e){let r=e[0];return e[0]=Xe(r,{mechanism:{data:{function:z(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function id(t){return function(e){return t.apply(this,[Xe(e,{mechanism:{data:{function:"requestAnimationFrame",handler:z(t)},handled:!0,type:"instrument"}})])}}function ad(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in r&&typeof r[o]=="function"&&x(r,o,function(i){let a={mechanism:{data:{function:o,handler:z(i)},handled:!0,type:"instrument"}},s=lt(i);return s&&(a.mechanism.data.handler=z(s)),Xe(i,a)})}),t.apply(this,e)}}function sd(t){let e=h,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(x(r,"addEventListener",function(n){return function(o,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=Xe(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:z(i),target:t},handled:!0,type:"instrument"}}))}catch{}return n.apply(this,[o,Xe(i,{mechanism:{data:{function:"addEventListener",handler:z(i),target:t},handled:!0,type:"instrument"}}),a])}}),x(r,"removeEventListener",function(n){return function(o,i,a){let s=i;try{let c=s&&s.__sentry_wrapped__;c&&n.call(this,o,c,a)}catch{}return n.call(this,o,s,a)}}))}var cd="cause",ld=5,ce=class{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=ce.id}constructor(e={}){ce.prototype.__init.call(this),this._key=e.key||cd,this._limit=e.limit||ld}setupOnce(){let e=_().getClient();e&&Ze((r,n)=>{let o=_().getIntegration(ce);return o?dd(e.getOptions().stackParser,o._key,o._limit,r,n):r})}};ce.__initStatic();function dd(t,e,r,n,o){if(!n.exception||!n.exception.values||!o||!j(o.originalException,Error))return n;let i=zi(t,r,o.originalException,e);return n.exception.values=[...i,...n.exception.values],n}function zi(t,e,r,n,o=[]){if(!j(r[n],Error)||o.length+1>=e)return o;let i=ao(t,r[n]);return zi(t,e,r[n],n,[i,...o])}var le=class{constructor(){le.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=le.id}setupOnce(){Ze(e=>{if(_().getIntegration(le)){if(!h.navigator&&!h.location&&!h.document)return e;let r=e.request&&e.request.url||h.location&&h.location.href,{referrer:n}=h.document||{},{userAgent:o}=h.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...o&&{"User-Agent":o}},a={...e.request,...r&&{url:r},headers:i};return{...e,request:a}}return e})}};le.__initStatic();var de=class{constructor(){de.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=de.id}setupOnce(e,r){let n=o=>{if(o.type)return o;let i=r().getIntegration(de);if(i){try{if(fd(o,i._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return i._previousEvent=o}return i._previousEvent=o}return o};n.id=this.name,e(n)}};de.__initStatic();function fd(t,e){return e?!!(ud(t,e)||pd(t,e)):!1}function ud(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Xi(t,e)||!Ki(t,e))}function pd(t,e){let r=qi(e),n=qi(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Xi(t,e)||!Ki(t,e))}function Ki(t,e){let r=Zi(t),n=Zi(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let o=0;o<n.length;o++){let i=n[o],a=r[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function Xi(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function qi(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Zi(t){let e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}var Qi=[new ft.InboundFilters,new ft.FunctionToString,new Ee,new ye,new U,new ce,new de,new le];function fo(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=Qi),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),h.SENTRY_RELEASE&&h.SENTRY_RELEASE.id&&(t.release=h.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);let e={...t,stackParser:Pn(t.stackParser||Hi),integrations:Qn(t),transport:t.transport||(Tr()?Gi:Ui)};to(jr,e),t.autoSessionTracking&&md()}function Ji(t){t.startSession({ignoreDuration:!0}),t.captureSession()}function md(){if(typeof h.document>"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}let t=_();t.captureSession&&(Ji(t),N("history",({from:e,to:r})=>{e===void 0||e===r||Ji(_())}))}var uo={};yn(uo,{Breadcrumbs:()=>ye,Dedupe:()=>de,GlobalHandlers:()=>U,HttpContext:()=>le,LinkedErrors:()=>ce,TryCatch:()=>Ee});var S=R;function ea(){S&&S.document?S.document.addEventListener("visibilitychange",()=>{let t=ae();if(S.document.hidden&&t){let e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Ot=(t,e,r)=>{let n,o;return i=>{e.value>=0&&(i||r)&&(o=e.value-(n||0),(o||n===void 0)&&(n=e.value,e.delta=o,t(e)))}};var ta=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var _d=()=>{let t=S.performance.timing,e=S.performance.navigation.type,r={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(let n in t)n!=="navigationStart"&&n!=="toJSON"&&(r[n]=Math.max(t[n]-t.navigationStart,0));return r},qr=()=>S.__WEB_VITALS_POLYFILL__?S.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||_d()):S.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];var Zr=()=>{let t=qr();return t&&t.activationStart||0};var Pt=(t,e)=>{let r=qr(),n="navigate";return r&&(S.document.prerendering||Zr()>0?n="prerender":n=r.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:ta(),navigationType:n}};var ke=(t,e,r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let n=new PerformanceObserver(o=>{e(o.getEntries())});return n.observe(Object.assign({type:t,buffered:!0},r||{})),n}}catch{}};var Je=(t,e)=>{let r=n=>{(n.type==="pagehide"||S.document.visibilityState==="hidden")&&(t(n),e&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)};var ra=t=>{let e=Pt("CLS",0),r,n=0,o=[],i=s=>{s.forEach(c=>{if(!c.hadRecentInput){let l=o[0],d=o[o.length-1];n&&o.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-l.startTime<5e3?(n+=c.value,o.push(c)):(n=c.value,o=[c]),n>e.value&&(e.value=n,e.entries=o,r&&r())}})},a=ke("layout-shift",i);if(a){r=Ot(t,e);let s=()=>{i(a.takeRecords()),r(!0)};return Je(s),s}};var Kr=-1,gd=()=>S.document.visibilityState==="hidden"&&!S.document.prerendering?0:1/0,hd=()=>{Je(({timeStamp:t})=>{Kr=t},!0)},Dt=()=>(Kr<0&&(Kr=gd(),hd()),{get firstHiddenTime(){return Kr}});var na=t=>{let e=Dt(),r=Pt("FID"),n,o=s=>{s.startTime<e.firstHiddenTime&&(r.value=s.processingStart-s.startTime,r.entries.push(s),n(!0))},i=s=>{s.forEach(o)},a=ke("first-input",i);n=Ot(t,r),a&&Je(()=>{i(a.takeRecords()),a.disconnect()},!0)};var oa={},ia=t=>{let e=Dt(),r=Pt("LCP"),n,o=a=>{let s=a[a.length-1];if(s){let c=Math.max(s.startTime-Zr(),0);c<e.firstHiddenTime&&(r.value=c,r.entries=[s],n())}},i=ke("largest-contentful-paint",o);if(i){n=Ot(t,r);let a=()=>{oa[r.id]||(o(i.takeRecords()),i.disconnect(),oa[r.id]=!0,n(!0))};return["keydown","click"].forEach(s=>{addEventListener(s,a,{once:!0,capture:!0})}),Je(a,!0),a}};function Xr(t){return typeof t=="number"&&isFinite(t)}function ut(t,{startTimestamp:e,...r}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...r})}function O(t){return t/1e3}function sa(){return S&&S.addEventListener&&S.performance}var aa=0,T={},ve,or;function ca(){let t=sa();if(t&&ie){t.mark&&S.performance.mark("sentry-tracing-init"),Ed();let e=Sd(),r=yd();return()=>{e&&e(),r&&r()}}return()=>{}}function la(){ke("longtask",e=>{for(let r of e){let n=ae();if(!n)return;let o=O(ie+r.startTime),i=O(r.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:o,endTimestamp:o+i})}})}function da(){ke("event",e=>{for(let r of e){let n=ae();if(!n)return;if(r.name==="click"){let o=O(ie+r.startTime),i=O(r.duration);n.startChild({description:me(r.target),op:`ui.interaction.${r.name}`,startTimestamp:o,endTimestamp:o+i})}}},{durationThreshold:0})}function Sd(){return ra(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding CLS"),T.cls={value:t.value,unit:""},or=e)})}function yd(){return ia(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding LCP"),T.lcp={value:t.value,unit:"millisecond"},ve=e)})}function Ed(){na(t=>{let e=t.entries.pop();if(!e)return;let r=O(ie),n=O(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding FID"),T.fid={value:t.value,unit:"millisecond"},T["mark.fid"]={value:r+n,unit:"second"}})}function fa(t){let e=sa();if(!e||!S.performance.getEntries||!ie)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Tracing] Adding & adjusting spans using Performance API");let r=O(ie),n=e.getEntries(),o,i;if(n.slice(aa).forEach(a=>{let s=O(a.startTime),c=O(a.duration);if(!(t.op==="navigation"&&r+s<t.startTimestamp))switch(a.entryType){case"navigation":{bd(t,a,r),o=r+O(a.responseStart),i=r+O(a.requestStart);break}case"mark":case"paint":case"measure":{vd(t,a,s,c,r);let l=Dt(),d=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding FP"),T.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding FCP"),T.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{let l=a.name.replace(S.location.origin,"");Cd(t,a,l,s,c,r);break}}}),aa=Math.max(n.length-1,0),Rd(t),t.op==="pageload"){typeof o=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding TTFB"),T.ttfb={value:(o-t.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=o&&(T["ttfb.requestTime"]={value:(o-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(s=>{if(!T[s]||r>=t.startTimestamp)return;let c=T[s].value,l=r+O(c),d=Math.abs((l-t.startTimestamp)*1e3),f=d-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Measurements] Normalized ${s} from ${c} to ${d} (${f})`),T[s].value=d});let a=T["mark.fid"];a&&T.fid&&(ut(t,{description:"first input delay",endTimestamp:a.value+O(T.fid.value),op:"ui.action",startTimestamp:a.value}),delete T["mark.fid"]),"fcp"in T||delete T.cls,Object.keys(T).forEach(s=>{t.setMeasurement(s,T[s].value,T[s].unit)}),xd(t)}ve=void 0,or=void 0,T={}}function vd(t,e,r,n,o){let i=o+r,a=i+n;return ut(t,{description:e.name,endTimestamp:a,op:e.entryType,startTimestamp:i}),i}function bd(t,e,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{Jr(t,e,n,r)}),Jr(t,e,"secureConnection",r,"TLS/SSL","connectEnd"),Jr(t,e,"fetch",r,"cache","domainLookupStart"),Jr(t,e,"domainLookup",r,"DNS"),Td(t,e,r)}function Jr(t,e,r,n,o,i){let a=i?e[i]:e[`${r}End`],s=e[`${r}Start`];!s||!a||ut(t,{op:"browser",description:o||r,startTimestamp:n+O(s),endTimestamp:n+O(a)})}function Td(t,e,r){ut(t,{op:"browser",description:"request",startTimestamp:r+O(e.requestStart),endTimestamp:r+O(e.responseEnd)}),ut(t,{op:"browser",description:"response",startTimestamp:r+O(e.responseStart),endTimestamp:r+O(e.responseEnd)})}function Cd(t,e,r,n,o,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let a={};"transferSize"in e&&(a["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(a["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(a["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus);let s=i+n,c=s+o;ut(t,{description:r,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",startTimestamp:s,data:a})}function Rd(t){let e=S.navigator;if(!e)return;let r=e.connection;r&&(r.effectiveType&&t.setTag("effectiveConnectionType",r.effectiveType),r.type&&t.setTag("connectionType",r.type),Xr(r.rtt)&&(T["connection.rtt"]={value:r.rtt,unit:"millisecond"})),Xr(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Xr(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function xd(t){ve&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding LCP Data"),ve.element&&t.setTag("lcp.element",me(ve.element)),ve.id&&t.setTag("lcp.id",ve.id),ve.url&&t.setTag("lcp.url",ve.url.trim().slice(0,200)),t.setTag("lcp.size",ve.size)),or&&or.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log("[Measurements] Adding CLS Data"),or.sources.forEach((e,r)=>t.setTag(`cls.source.${r+1}`,me(e.node))))}var po=["localhost",/^\/(?!\/)/],ir={traceFetch:!0,traceXHR:!0,tracingOrigins:po,tracePropagationTargets:po};function mo(t){let{traceFetch:e,traceXHR:r,tracePropagationTargets:n,tracingOrigins:o,shouldCreateSpanForRequest:i}={traceFetch:ir.traceFetch,traceXHR:ir.traceXHR,...t},a=typeof i=="function"?i:l=>!0,s=l=>Nd(l,n||o),c={};e&&N("fetch",l=>{Id(l,a,s,c)}),r&&N("xhr",l=>{Pd(l,a,s,c)})}function Nd(t,e){return ze(t,e||po)}function Id(t,e,r,n){if(!Ct()||!(t.fetchData&&e(t.fetchData.url)))return;if(t.endTimestamp){let s=t.fetchData.__span;if(!s)return;let c=n[s];if(c){if(t.response){c.setHttpStatus(t.response.status);let l=t.response&&t.response.headers&&t.response.headers.get("content-length"),d=parseInt(l);d>0&&c.setData("http.response_content_length",d)}else t.error&&c.setStatus("internal_error");c.finish(),delete n[s]}return}let o=_().getScope(),i=o&&o.getSpan(),a=i&&i.transaction;if(i&&a){let{method:s,url:c}=t.fetchData,l=i.startChild({data:{url:c,type:"fetch","http.method":s},description:`${s} ${c}`,op:"http.client"});t.fetchData.__span=l.spanId,n[l.spanId]=l;let d=t.args[0];t.args[1]=t.args[1]||{};let f=t.args[1];r(t.fetchData.url)&&(f.headers=Od(d,a.getDynamicSamplingContext(),l,f))}}function Od(t,e,r,n){let o=wr(e),i=r.toTraceparent(),a=typeof Request<"u"&&j(t,Request)?t.headers:n.headers;if(a)if(typeof Headers<"u"&&j(a,Headers)){let s=new Headers(a);return s.append("sentry-trace",i),o&&s.append(er,o),s}else if(Array.isArray(a)){let s=[...a,["sentry-trace",i]];return o&&s.push([er,o]),s}else{let s="baggage"in a?a.baggage:void 0,c=[];return Array.isArray(s)?c.push(...s):s&&c.push(s),o&&c.push(o),{...a,"sentry-trace":i,baggage:c.length>0?c.join(","):void 0}}else return{"sentry-trace":i,baggage:o}}function Pd(t,e,r,n){let o=t.xhr,i=o&&o[Ie];if(!Ct()||o&&o.__sentry_own_request__||!(o&&i&&e(i.url)))return;if(t.endTimestamp){let l=o.__sentry_xhr_span_id__;if(!l)return;let d=n[l];d&&(d.setHttpStatus(i.status_code),d.finish(),delete n[l]);return}let a=_().getScope(),s=a&&a.getSpan(),c=s&&s.transaction;if(s&&c){let l=s.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client"});if(o.__sentry_xhr_span_id__=l.spanId,n[o.__sentry_xhr_span_id__]=l,o.setRequestHeader&&r(i.url))try{o.setRequestHeader("sentry-trace",l.toTraceparent());let d=c.getDynamicSamplingContext(),f=wr(d);f&&o.setRequestHeader(er,f)}catch{}}}function ua(t,e=!0,r=!0){if(!S||!S.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn("Could not initialize routing instrumentation due to invalid location");return}let n=S.location.href,o;e&&(o=t({name:S.location.pathname,startTimestamp:ie?ie/1e3:void 0,op:"pageload",metadata:{source:"url"}})),r&&N("history",({to:i,from:a})=>{if(a===void 0&&n&&n.indexOf(i)!==-1){n=void 0;return}a!==i&&(n=void 0,o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Finishing current transaction with op: ${o.op}`),o.finish()),o=t({name:S.location.pathname,op:"navigation",metadata:{source:"url"}}))})}var ma="BrowserTracing",Dd={...xt,markBackgroundTransactions:!0,routingInstrumentation:ua,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...ir},Qe=class{__init(){this.name=ma}constructor(e){Qe.prototype.__init.call(this),Gr(),this.options={...Dd,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=ca(),this.options.enableLongTask&&la(),this.options._experiments.enableInteractions&&da()}setupOnce(e,r){this._getCurrentHub=r;let{routingInstrumentation:n,startTransactionOnLocationChange:o,startTransactionOnPageLoad:i,markBackgroundTransactions:a,traceFetch:s,traceXHR:c,tracePropagationTargets:l,shouldCreateSpanForRequest:d,_experiments:f}=this.options;n(m=>{let p=this._createRouteTransaction(m);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(p,m,r),p},i,o),a&&ea(),f.enableInteractions&&this._registerInteractionListener(),mo({traceFetch:s,traceXHR:c,tracePropagationTargets:l,shouldCreateSpanForRequest:d})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let{beforeNavigate:r,idleTimeout:n,finalTimeout:o,heartbeatInterval:i}=this.options,a=e.op==="pageload",s=a?pa("sentry-trace"):null,c=a?pa("baggage"):null,l=s?Qt(s):void 0,d=c?Zn(c):void 0,f={...e,...l,metadata:{...e.metadata,dynamicSamplingContext:l&&!d?{}:d},trimEnd:!0},m=typeof r=="function"?r(f):f,p=m===void 0?{...f,sampled:!1}:m;p.metadata=p.name!==f.name?{...p.metadata,source:"custom"}:p.metadata,this._latestRouteName=p.name,this._latestRouteSource=p.metadata&&p.metadata.source,p.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Will not send ${p.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.log(`[Tracing] Starting ${p.op} transaction on scope`);let y=this._getCurrentHub(),{location:A}=S,W=Fr(y,p,n,o,!0,{location:A},i);return W.registerBeforeFinishCallback(X=>{this._collectWebVitals(),fa(X)}),W}_registerInteractionListener(){let e,r=()=>{let{idleTimeout:n,finalTimeout:o,heartbeatInterval:i}=this.options,a="ui.action.click",s=ae();if(s&&s.op&&["navigation","pageload"].includes(s.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`[Tracing] Did not create ${a} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&u.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:l}=S,d={name:this._latestRouteName,op:a,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Fr(c,d,n,o,!0,{location:l},i)};["click"].forEach(n=>{addEventListener(n,r,{once:!1,capture:!0})})}};function pa(t){let e=Rn(`meta[name=${t}]`);return e?e.getAttribute("content"):null}var _a={};h.Sentry&&h.Sentry.Integrations&&(_a=h.Sentry.Integrations);var x1={..._a,...ft,...uo};var Ad=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ad.SENTRY_RELEASE={id:"react-3.0.3-canary"};var Sa=ha(),ya=!1;function kd(){fo({dsn:"https://903950caba7d4802afe6c1e985ad5ebd@o128085.ingest.sentry.io/4504854496149504",release:`${Sa.name}@${Sa.version}`,integrations:[new Qe],tracesSampleRate:1}),ya=!0}var M=(t,e)=>(ya||kd(),Ur(r=>{t.message&&r.setFingerprint([t.message]),e&&Object.entries(e).forEach(([n,o])=>r.setExtra(n,o))}),Nt(t));var At=t=>t.reduce((e,{id:r,total_amount:n,total_currency:o})=>({[r]:{total_amount:n,total_currency:o},...e}),{});var et=(t,e,r)=>{if(!t||e.length===0)return 0;let n=At(t.available_services);return ar(n,e,r)},ar=(t,e,r)=>e.reduce((n,{quantity:o,id:i})=>{let a=n;return i in t?a+=o*+t[i].total_amount:r?a+=o*Bd(i,r):M(new Error(`The service id provided could not be found in neither the offer nor the seat maps. Service id: ${i}`)),a},0),Bd=(t,e)=>{for(let r of e)for(let n of r.cabins)for(let o of n.rows)for(let i of o.sections)for(let a of i.elements)if(a.type==="seat"&&Array.isArray(a.available_services)){let s=a.available_services.find(c=>c.id===t);if(s)return+s.total_amount}return 0};var Ea=({baggageSelectedServices:t,seatSelectedServices:e,cfarSelectedServices:r,offer:n,seatMaps:o,passengers:i})=>{let a=[...t,...e,...r],s=+n.total_amount+et(n,a,o);return{...n&&{selected_offers:[n.id]},passengers:i,services:wd(a),...n&&{payments:[{type:"balance",amount:`${s}`,currency:n.total_currency}]},type:"instant",metadata:{source:"duffel-ancillaries@3.0.3-canary"}}},wd=t=>Array.isArray(t)?t.filter(({quantity:e})=>e>0).map(({id:e,quantity:r})=>({id:e,quantity:r})):[];var _o=t=>(e,r)=>{let{rate:n,amount:o}=t;return{amount:e*(1+n)+o,currency:r}},go="You cannot supply both markup and priceFormatters for the same service.",va=(t,e)=>{let r={};if(e&&(e.bags&&(r.bags=e.bags),e.seats&&(r.seats=e.seats),e.cancel_for_any_reason&&(r.cancel_for_any_reason=e.cancel_for_any_reason)),t){if(t.bags){if(e&&e.bags)throw new Error(go);r.bags=_o(t.bags)}if(t.seats){if(e&&e.seats)throw new Error(go);r.seats=_o(t.seats)}if(t.cancel_for_any_reason){if(e&&e.cancel_for_any_reason)throw new Error(go);r.cancel_for_any_reason=_o(t.cancel_for_any_reason)}}return r};var Qr=t=>t.type==="baggage";var Mt=t=>t.type==="cancel_for_any_reason";var Ld=(t,e)=>`${t} must all have the same currency, but they have ${e.size} different currencies (${[...e].join(", ")}). Check the price formatters passed into the component's render function.`,ba=(t,e)=>{if(!e)return t;let r=t.available_services,n=new Set,o={baggage:e?.bags,cancel_for_any_reason:e?.cancel_for_any_reason},i=r.map(a=>{let s={...a};if(a.type in o&&o[a.type]){let{total_amount:c,total_currency:l}=a;if(Qr(a)){let{amount:d,currency:f}=o[a.type](+a.total_amount,a.total_currency,a);c=d.toString(),f&&(l=f)}if(Mt(a)){let{amount:d,currency:f}=o[a.type](+a.total_amount,a.total_currency,a);c=d.toString(),f&&(l=f)}if(n.add(l),n.size>1)throw new Error(Ld(a.type,n));s.total_amount=c,s.total_currency=l}return s});return{...t,available_services:i}};function en(t){return t.type==="seat"}var Fd=t=>`Seats must all have the same currency, but they have ${t.size} different currencies (${[...t].join(", ")}). Check the price formatters passed into the component's render function.`,Gd=(t,e,r)=>{let n={...t};if(en(n)&&n.available_services.length>0){let o=n.available_services.map(i=>{let a={...i},{amount:s,currency:c}=e(+i.total_amount,i.total_currency,i);if(a.total_amount=s.toString(),c&&(a.total_currency=c,r.add(c),r.size>1))throw new Error(Fd(r));return a});n.available_services=o}return n},Ta=(t,e)=>{if(!e)return t;let r=new Set;return t.map(o=>{let i=o.cabins.map(a=>{let s=a.rows.map(c=>{let l=c.sections.map(d=>{let f=d.elements.map(m=>Gd(m,e,r));return{...d,elements:f}});return{...c,sections:l}});return{...a,rows:s}});return{...o,cabins:i}})};var Ca=t=>"selected_offers"in t&&"passengers"in t&&"services"in t&&"payments"in t&&"type"in t&&"metadata"in t;var ho=require("react");var So=t=>{t&&Ra(`
20
+
21
+ Debug mode is enabled. Information about your setup will be printed to the console.
22
+
23
+ If you do not want to enable debug mode (for example in a production environment), pass "debug: false" when initializing this component.
24
+
25
+ Learn more about the Ancillaries component:
26
+ http://duffel.com/docs/guides/ancillaries-component`);let e=()=>{};return{log:t?Ra:e,logGroup:t?Ud:e}},xa="[Duffel Ancillaries] ",Ra=t=>{console.log(xa,t)};function Ud(t,e){console.groupCollapsed(xa,t);let r=[];Array.isArray(e)?r=e:r=Object.entries(e).map(([n,o])=>({property:n,value:o})),r.forEach(n=>{console.log(n)}),console.groupEnd()}var Na=(0,ho.createContext)(So(!1));var Ia=t=>t.expires_at&&new Date(t.expires_at)<new Date;var Oa="https://assets.duffel.com/components/ancillaries/3.0.3-canary",Pa=async t=>await(await fetch(Oa+`/fixtures/offers/${t}.json`)).json(),Da=async t=>await(await fetch(Oa+`/fixtures/seat-maps/${t}.json`)).json();var tn=t=>t.startsWith("fixture_off_");var Hd="https://api.duffel.com",Yd="3.0.3-canary";async function rn(t,e,r="GET",n){return await(await fetch(`${Hd}/ancillaries-component/${e}`,{method:r,body:n,headers:{"Duffel-Version":"v1",Authorization:`Bearer ${t}`,"User-Agent":`Duffel/ancillaries-component@${Yd}`}})).json()}async function Aa(t,e){return(await rn(e,`offers/${t}?return_available_services=true`)).data}async function Ma(t,e,r,n,o){n(!0);let i=tn(t);if(t=i?t.replace("fixture_",""):t,i)return Pa(t).then(a=>{n(!1),o(a)});if(!e)throw new Error("Attemptted to retrieve seat maps but the client key is missing");try{let a=await Aa(t,e);return o(a)}catch(a){let s="An unknown error occurred while retrieving the offer.";a instanceof Error?(s=a.message,a.message.includes("ECONNREFUSED")&&(s="The Duffel API is not available. Please try again later."),M(a,{offer_id:t})):M(new Error(s),{offer_id:t}),r(s)}finally{n(!1)}}async function ka(t,e){return(await rn(e,`offers/${t}/seat_maps`)).data}async function Ba(t,e,r,n,o){n(!0);let i=tn(t);if(t=i?t.replace("fixture_",""):t,i)return Da(t).then(a=>{n(!1),o(a)});if(!e)throw new Error("Attemptted to retrieve seat maps but the client key is missing");try{let a=await ka(t,e);o(a)}catch(a){let s="An unknown error occurred while retrieving the offer.";a instanceof Error?(s=a.message,a.message.includes("ECONNREFUSED")&&(s="The Duffel API is not available. Please try again later."),M(a,{offer_id:t})):M(new Error(s),{offer_id:t}),r(s)}finally{n(!1)}}var yo=t=>$d(t)&&(Eo(t)||vo(t)||bo(t)||To(t)),$d=t=>"onPayloadReady"in t&&"passengers"in t&&"services"in t,Eo=t=>"offer_id"in t&&t.offer_id.startsWith("fixture_"),vo=t=>"offer_id"in t&&"client_key"in t,bo=t=>"offer"in t&&"seat_maps"in t,To=t=>"offer"in t&&"client_key"in t;var Y=C(require("react"));var Fa=C(require("react"));var g=require("react/jsx-runtime"),wa={add:(0,g.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}),arrow_forward:(0,g.jsx)("path",{d:"M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1z"}),arrow_left:(0,g.jsx)("path",{d:"M9 19L2 12L9 5L10.425 6.4L5.825 11H22V13H5.825L10.4 17.6L9 19Z"}),arrow_right:(0,g.jsx)("path",{d:"M15 19L13.6 17.6L18.2 13H2V11H18.2L13.6 6.4L15 5L22 12L15 19Z"}),autorenew:(0,g.jsx)("path",{d:"M5.69728 14.4104C5.49326 13.9833 5.32604 13.5257 5.19562 13.0374C5.06521 12.5492 5 12.0367 5 11.5C5 9.56481 5.69083 7.91679 7.07249 6.55591C8.45416 5.19504 10.147 4.53946 12.1511 4.58918H12.7613L11.0742 2.92359L12.0097 2L15.2869 5.23549L12.0097 8.47099L11.0742 7.54739L12.7613 5.88181H12.1511C10.5021 5.84866 9.11624 6.38632 7.99347 7.49479C6.87069 8.60326 6.30931 9.93833 6.30931 11.5C6.30931 11.8455 6.33804 12.1824 6.3955 12.5106C6.45296 12.8389 6.53915 13.1573 6.65407 13.4658L5.69728 14.4104ZM11.9903 21L8.71309 17.7645L11.9903 14.529L12.9258 15.4526L11.2387 17.1182H11.8489C13.4979 17.1513 14.8838 16.6137 16.0065 15.5052C17.1293 14.3967 17.6907 13.0617 17.6907 11.5C17.6907 11.1545 17.662 10.8176 17.6045 10.4894C17.547 10.1611 17.4609 9.84273 17.3459 9.53421L18.3027 8.58959C18.5067 9.01665 18.674 9.47431 18.8044 9.96256C18.9348 10.4508 19 10.9633 19 11.5C19 13.4186 18.3092 15.0625 16.9275 16.4317C15.5458 17.8008 13.853 18.4605 11.8489 18.4108H11.2387L12.9258 20.0764L11.9903 21Z"}),bassinet:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("path",{d:"M19 12C19 14.1217 18.1571 16.1566 16.6569 17.6569C15.1566 19.1571 13.1217 20 11 20C8.87827 20 6.84344 19.1571 5.34315 17.6569C3.84286 16.1566 3 14.1217 3 12L11 12H19Z"}),(0,g.jsx)("path",{d:"M16.1347 5.86529L11 11V4C12.0506 4 13.0909 4.20693 14.0615 4.60896C14.8136 4.92052 15.5125 5.34451 16.1347 5.86529ZM16.8602 6.55405L12.4142 11H18.9373C18.8482 10.293 18.6649 9.59962 18.391 8.93853C18.0264 8.05823 17.5077 7.25087 16.8602 6.55405Z"})]}),cabin_bag:(0,g.jsx)("path",{d:"M7.3077 20.5C6.81058 20.5 6.38502 20.323 6.03102 19.969C5.67701 19.615 5.5 19.1894 5.5 18.6923V8.25007C5.5 7.76417 5.67019 7.35103 6.01057 7.01065C6.35096 6.67027 6.7641 6.50007 7.25 6.50007H9.25V3.6924C9.25 3.43631 9.33622 3.22166 9.50865 3.04842C9.68108 2.87519 9.89773 2.78857 10.1586 2.78857H13.8414C14.1022 2.78857 14.3189 2.87519 14.4913 3.04842C14.6637 3.22166 14.75 3.43631 14.75 3.6924V6.50007H16.6922C17.1894 6.50007 17.6149 6.67708 17.9689 7.0311C18.3229 7.3851 18.5 7.81066 18.5 8.30777V18.6923C18.5 19.1894 18.3229 19.615 17.9689 19.969C17.6149 20.323 17.1894 20.5 16.6922 20.5C16.6922 20.7507 16.6074 20.9608 16.4377 21.1303C16.2681 21.2999 16.0578 21.3846 15.807 21.3846C15.5561 21.3846 15.3461 21.2999 15.1769 21.1303C15.0077 20.9608 14.923 20.7507 14.923 20.5H9.0769C9.0769 20.7513 8.99206 20.9615 8.82237 21.1308C8.65271 21.3 8.44246 21.3846 8.19162 21.3846C7.94079 21.3846 7.73076 21.2999 7.56153 21.1303C7.39231 20.9608 7.3077 20.7507 7.3077 20.5ZM10.4423 6.50007H13.5577V3.98085H10.4423V6.50007ZM7.3077 19H16.6922C16.782 19 16.8557 18.9712 16.9134 18.9135C16.9711 18.8558 17 18.7821 17 18.6923V8.30777C17 8.21802 16.9711 8.1443 16.9134 8.0866C16.8557 8.0289 16.782 8.00005 16.6922 8.00005H7.3077C7.21795 8.00005 7.14423 8.0289 7.08652 8.0866C7.02882 8.1443 6.99997 8.21802 6.99997 8.30777V18.6923C6.99997 18.7821 7.02882 18.8558 7.08652 18.9135C7.14423 18.9712 7.21795 19 7.3077 19ZM8.15382 17.1539C8.15382 17.3261 8.21009 17.4685 8.32262 17.5811C8.43514 17.6937 8.57744 17.75 8.74952 17.75C8.92161 17.75 9.06407 17.6937 9.1769 17.5811C9.28972 17.4685 9.34613 17.3261 9.34613 17.1539V9.8462C9.34613 9.67398 9.28986 9.53157 9.17732 9.41897C9.06481 9.30637 8.92251 9.25007 8.75043 9.25007C8.57834 9.25007 8.43588 9.30637 8.32305 9.41897C8.21023 9.53157 8.15382 9.67398 8.15382 9.8462V17.1539ZM11.4038 17.1539C11.4038 17.3261 11.4601 17.4685 11.5726 17.5811C11.6851 17.6937 11.8274 17.75 11.9995 17.75C12.1716 17.75 12.3141 17.6937 12.4269 17.5811C12.5397 17.4685 12.5961 17.3261 12.5961 17.1539V9.8462C12.5961 9.67398 12.5399 9.53157 12.4273 9.41897C12.3148 9.30637 12.1725 9.25007 12.0004 9.25007C11.8283 9.25007 11.6859 9.30637 11.5731 9.41897C11.4602 9.53157 11.4038 9.67398 11.4038 9.8462V17.1539ZM14.6538 17.1539C14.6538 17.3261 14.7101 17.4685 14.8226 17.5811C14.9351 17.6937 15.0774 17.75 15.2495 17.75C15.4216 17.75 15.5641 17.6937 15.6769 17.5811C15.7897 17.4685 15.8461 17.3261 15.8461 17.1539V9.8462C15.8461 9.67398 15.7899 9.53157 15.6773 9.41897C15.5648 9.30637 15.4225 9.25007 15.2504 9.25007C15.0783 9.25007 14.9359 9.30637 14.823 9.41897C14.7102 9.53157 14.6538 9.67398 14.6538 9.8462V17.1539Z"}),check:(0,g.jsx)("path",{d:"M10.3333 15.8646L7 12.5313L8.0625 11.4688L10.3333 13.7396L15.9375 8.13544L17 9.19794L10.3333 15.8646Z"}),checked_bag:(0,g.jsx)("path",{d:"M22 19H2V21H22V19M4 15C4 15.5 4.2 16 4.6 16.4C5 16.8 5.5 17 6 17V6C5.5 6 5 6.2 4.6 6.6C4.2 7 4 7.5 4 8V15M13.5 6H10.5C10.5 5.6 10.6 5.2 10.9 4.9C11.2 4.6 11.5 4.5 12 4.5C12.4 4.5 12.8 4.6 13.1 4.9C13.3 5.2 13.5 5.6 13.5 6M7 6V17H17V6H15C15 5.2 14.7 4.5 14.1 3.9S12.8 3 12 3C11.2 3 10.5 3.3 9.9 3.9C9.3 4.5 9 5.2 9 6H7M18 17C18.5 17 19 16.8 19.4 16.4C19.8 16 20 15.5 20 15V8C20 7.5 19.8 7 19.4 6.6C19 6.2 18.5 6 18 6V17Z"}),chevron:(0,g.jsx)("path",{d:"M5 13H16.17L11.29 17.88C10.9 18.27 10.9 18.91 11.29 19.3C11.68 19.69 12.31 19.69 12.7 19.3L19.29 12.71C19.68 12.32 19.68 11.69 19.29 11.3L12.71 4.7C12.32 4.31 11.69 4.31 11.3 4.7C10.91 5.09 10.91 5.72 11.3 6.11L16.17 11H5C4.45 11 4 11.45 4 12C4 12.55 4.45 13 5 13Z"}),close:(0,g.jsx)("path",{d:"M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}),closet:(0,g.jsx)("path",{d:"M12 4C11.0717 4 10.1815 4.36875 9.52513 5.02513C8.86875 5.6815 8.5 6.57174 8.5 7.5H10.5C10.5 7.10218 10.658 6.72064 10.9393 6.43934C11.2206 6.15804 11.6022 6 12 6C12.3978 6 12.7794 6.15804 13.0607 6.43934C13.342 6.72064 13.5 7.10218 13.5 7.5C13.5 7.89782 13.342 8.27936 13.0607 8.56066C12.7794 8.84196 12.3978 9 12 9C11.45 9 11 9.45 11 10V11.75L2.4 18.2C2.23209 18.3259 2.10807 18.5015 2.04549 18.7018C1.98291 18.9022 1.98495 19.1171 2.05132 19.3162C2.11769 19.5153 2.24502 19.6885 2.41529 19.8112C2.58556 19.934 2.79012 20 3 20H21C21.2099 20 21.4144 19.934 21.5847 19.8112C21.755 19.6885 21.8823 19.5153 21.9487 19.3162C22.0151 19.1171 22.0171 18.9022 21.9545 18.7018C21.8919 18.5015 21.7679 18.3259 21.6 18.2L13 11.75V10.85C13.7216 10.6349 14.3546 10.1927 14.805 9.58919C15.2554 8.98569 15.4991 8.25303 15.5 7.5C15.5 6.57174 15.1313 5.6815 14.4749 5.02513C13.8185 4.36875 12.9283 4 12 4ZM12 13.5L18 18H6L12 13.5Z"}),exit_row:(0,g.jsx)("path",{d:"M20 11H6.83001L9.71001 8.12001C10.1 7.73001 10.1 7.10001 9.71001 6.71001C9.32001 6.32001 8.69001 6.32001 8.30001 6.71001L3.71001 11.3C3.32001 11.69 3.32001 12.32 3.71001 12.71L8.30001 17.3C8.69001 17.69 9.32001 17.69 9.71001 17.3C10.1 16.91 10.1 16.28 9.71001 15.89L6.83001 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11Z"}),exit_row_right:(0,g.jsx)("path",{d:"M4 11H17.17L14.29 8.12001C13.9 7.73001 13.9 7.10001 14.29 6.71001C14.68 6.32001 15.31 6.32001 15.7 6.71001L20.29 11.3C20.68 11.69 20.68 12.32 20.29 12.71L15.7 17.3C15.31 17.69 14.68 17.69 14.29 17.3C13.9 16.91 13.9 16.28 14.29 15.89L17.17 13H4C3.45 13 3 12.55 3 12C3 11.45 3.45 11 4 11Z"}),expand_content:(0,g.jsx)("path",{d:"M5 19V13H7V17H11V19H5ZM17 11V7H13V5H19V11H17Z"}),flight_class:(0,g.jsx)("path",{d:"M14.2596 12.5C13.7737 12.5 13.3606 12.3298 13.0202 11.9894C12.6798 11.649 12.5096 11.2359 12.5096 10.75V6.25C12.5096 5.7641 12.6798 5.35096 13.0202 5.01058C13.3606 4.67019 13.7737 4.5 14.2596 4.5H15.75C16.2359 4.5 16.649 4.67019 16.9894 5.01058C17.3298 5.35096 17.5 5.7641 17.5 6.25V10.75C17.5 11.2359 17.3298 11.649 16.9894 11.9894C16.649 12.3298 16.2359 12.5 15.75 12.5H14.2596ZM14.2596 11H15.75C15.8205 11 15.8798 10.9759 15.9278 10.9279C15.9759 10.8798 16 10.8205 16 10.75V6.25C16 6.17948 15.9759 6.12018 15.9278 6.0721C15.8798 6.02402 15.8205 5.99998 15.75 5.99998H14.2596C14.1891 5.99998 14.1298 6.02402 14.0817 6.0721C14.0336 6.12018 14.0096 6.17948 14.0096 6.25V10.75C14.0096 10.8205 14.0336 10.8798 14.0817 10.9279C14.1298 10.9759 14.1891 11 14.2596 11ZM9.5673 17.5C9.21345 17.5 8.89678 17.398 8.6173 17.1942C8.33782 16.9903 8.14423 16.7198 8.03655 16.3827L5.5 8.02883V4.5H6.99997V7.99998L9.49997 16H17.7596V17.5H9.5673ZM8.25 20.5V19H17.75V20.5H8.25ZM14.2596 5.99998H16H14.0096H14.2596Z"}),galley:(0,g.jsx)("path",{d:"M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM4 19h16v2H4z"}),lavatory:(0,g.jsx)("path",{d:"M5.5 22v-7.5H4V9c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2v5.5H9.5V22h-4zM18 22v-6h3l-2.54-7.63C18.18 7.55 17.42 7 16.56 7h-.12c-.86 0-1.63.55-1.9 1.37L12 16h3v6h3zM7.5 6c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2zm9 0c1.11 0 2-.89 2-2s-.89-2-2-2-2 .89-2 2 .89 2 2 2z"}),lie_flat_seat:(0,g.jsx)("path",{d:"M6.16667 12.8333C6.81667 12.8333 7.45834 12.5833 7.95001 12.0833C8.91667 11.0916 8.90001 9.51659 7.91667 8.54992C7.42501 8.07492 6.79167 7.83325 6.16667 7.83325C5.51667 7.83325 4.87501 8.08325 4.38334 8.58325C3.41667 9.57492 3.43334 11.1499 4.41667 12.1166C4.90834 12.5916 5.54167 12.8333 6.16667 12.8333ZM5.57501 9.74992C5.73334 9.59159 5.94167 9.49992 6.16667 9.49992C6.38334 9.49992 6.59167 9.58325 6.75001 9.73325C7.08334 10.0583 7.08334 10.5749 6.76667 10.9083C6.60001 11.0749 6.39167 11.1666 6.16667 11.1666C5.95001 11.1666 5.74167 11.0833 5.58334 10.9333C5.25001 10.5999 5.25001 10.0833 5.57501 9.74992ZM17 7.83325H9.50001V12.8333H20.3333V11.1666C20.3333 9.32492 18.8417 7.83325 17 7.83325ZM11.1667 11.1666V9.49992H17C17.9167 9.49992 18.6667 10.2499 18.6667 11.1666H11.1667ZM3.66667 15.3333H8.66667V16.9999H15.3333V15.3333H20.3333V13.6666H3.66667V15.3333Z"}),minus:(0,g.jsx)("path",{d:"M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1z"}),no_airplane:(0,g.jsx)("path",{d:"M14.6674 10.0001V2.66675C14.6674 1.56008 13.7741 0.666748 12.6674 0.666748C11.5607 0.666748 10.6674 1.56008 10.6674 2.66675V7.57341L21.1074 18.0134L25.3341 19.3334V16.6667L14.6674 10.0001ZM1.33407 5.02675L7.9874 11.6801L0.000732422 16.6667V19.3334L10.6674 16.0001V23.3334L8.00073 25.3334V27.3334L12.6674 26.0001L17.3341 27.3334V25.3334L14.6674 23.3334V18.3601L22.3074 26.0001L24.0007 24.3067L3.0274 3.33341L1.33407 5.02675Z"}),no_bag:(0,g.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.8992 6.12037H14.9392V3.18101C14.9385 2.92148 14.8351 2.67278 14.6516 2.48926C14.4681 2.30574 14.2194 2.20234 13.9599 2.20166H10.0399C9.78034 2.20234 9.53163 2.30574 9.34811 2.48926C9.16459 2.67278 9.06119 2.92148 9.06051 3.18101V6.12037H8.20711L8.34715 6.25804L14.3973 12.0871V9.06102H15.9676V13.6L17.3022 14.8859L18.8592 16.4748V8.08037C18.8579 7.56096 18.6509 7.06322 18.2836 6.69594C17.9164 6.32867 17.4186 6.12173 16.8992 6.12037ZM5.14051 8.09559L3.77173 6.71825L5.00821 5.48945L7.16586 7.6606L13.9581 14.4953L15.8932 16.4426L19.7441 20.3175L20.2279 20.8043L18.9914 22.0331L17.635 20.6683C17.4035 20.7625 17.154 20.8126 16.8992 20.8133C16.904 20.945 16.8822 21.0763 16.8351 21.1993C16.788 21.3224 16.7166 21.4347 16.6251 21.5296C16.5336 21.6244 16.424 21.6999 16.3027 21.7514C16.1814 21.8029 16.051 21.8295 15.9192 21.8295C15.7874 21.8295 15.657 21.8029 15.5357 21.7514C15.4145 21.6999 15.3048 21.6244 15.2133 21.5296C15.1219 21.4347 15.0504 21.3224 15.0034 21.1993C14.9563 21.0763 14.9344 20.945 14.9392 20.8133H9.06051C9.06529 20.945 9.04348 21.0763 8.99638 21.1993C8.94929 21.3224 8.87787 21.4347 8.7864 21.5296C8.69492 21.6244 8.58527 21.6999 8.46399 21.7514C8.34271 21.8029 8.21229 21.8295 8.08051 21.8295C7.94874 21.8295 7.81832 21.8029 7.69703 21.7514C7.57575 21.6999 7.4661 21.6244 7.37463 21.5296C7.28316 21.4347 7.21174 21.3224 7.16464 21.1993C7.11754 21.0763 7.09573 20.945 7.10051 20.8133C6.58222 20.8119 6.08545 20.6059 5.71835 20.24C5.35126 19.8741 5.14357 19.378 5.14051 18.8597V8.09559ZM14.8632 17.8791L14.3973 17.4103V17.8791H14.8632ZM9.596 12.579V17.8791H8.03083V11.004L9.596 12.579ZM10.5302 3.67134H13.4695V6.12295H10.5302V3.67134Z"}),no_seat:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("path",{d:"M25.1667 21.9733L23.4733 23.6667L2.5 2.69333L4.19333 1L7.16667 3.97333L16.5267 13.3333L19.1933 16L24.5 21.3067L25.1667 21.9733Z"}),(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.16667 24H3.16667V16H19.1933L24.5 21.3067V24H20.5V20H7.16667V24ZM27.1667 9.33333H23.1667V13.3333H27.1667V9.33333ZM4.5 9.33333H0.5V13.3333H4.5V9.33333ZM20.3333 13.3333H20.5V2.66667C20.5 1.2 19.3 0 17.8333 0H9.83333C9.05784 0 8.3569 0.335483 7.86848 0.868484L20.3333 13.3333ZM16.5267 13.3333L7.16667 3.97333V13.3333H16.5267Z"})]}),north_east:(0,g.jsx)("path",{d:"M4.69999 19.3C4.51665 19.1167 4.42499 18.8833 4.42499 18.6C4.42499 18.3167 4.51665 18.0833 4.69999 17.9L15.6 7H9.99999C9.71665 7 9.47915 6.90417 9.28749 6.7125C9.09582 6.52083 8.99999 6.28333 8.99999 6C8.99999 5.71667 9.09582 5.47917 9.28749 5.2875C9.47915 5.09583 9.71665 5 9.99999 5H18C18.2833 5 18.5208 5.09583 18.7125 5.2875C18.9042 5.47917 19 5.71667 19 6V14C19 14.2833 18.9042 14.5208 18.7125 14.7125C18.5208 14.9042 18.2833 15 18 15C17.7167 15 17.4792 14.9042 17.2875 14.7125C17.0958 14.5208 17 14.2833 17 14V8.4L6.09999 19.3C5.91665 19.4833 5.68332 19.575 5.39999 19.575C5.11665 19.575 4.88332 19.4833 4.69999 19.3Z"}),seat:(0,g.jsx)("path",{d:"M7.59 5.41012C6.81 4.63012 6.81 3.36012 7.59 2.58012C8.37 1.80012 9.64 1.80012 10.42 2.58012C11.2 3.36012 11.2 4.63012 10.42 5.41012C9.63 6.20012 8.37 6.20012 7.59 5.41012ZM6 16.0001V8.00012C6 7.45012 5.55 7.00012 5 7.00012C4.45 7.00012 4 7.45012 4 8.00012V16.0001C4 18.7601 6.24 21.0001 9 21.0001H14C14.55 21.0001 15 20.5501 15 20.0001C15 19.4501 14.55 19.0001 14 19.0001H9C7.34 19.0001 6 17.6601 6 16.0001ZM19.28 19.3501L15.51 15.5801C15.14 15.2101 14.63 15.0001 14.1 15.0001H11.5V11.3201C12.59 12.2101 14.16 13.0201 15.7 13.3401C16.37 13.4801 17 12.9801 17 12.3001C17 11.7701 16.61 11.3401 16.08 11.2501C14.66 11.0101 13.2 10.2401 12.33 9.28012L10.93 7.73012C10.74 7.52012 10.5 7.35012 10.24 7.23012C9.95 7.09012 9.62 7.00012 9.28 7.00012H9.25C8.01 7.00012 7 8.01012 7 9.25012V15.0001C7 16.6601 8.34 18.0001 10 18.0001H15.07L17.85 20.7801C18.24 21.1701 18.89 21.1701 19.28 20.7801C19.68 20.3901 19.68 19.7501 19.28 19.3501Z"}),seat_paid_indicator:(0,g.jsx)("path",{d:"M11.7686 0.731368C12.7766 -0.276576 14.5 0.437294 14.5 1.86274V10.8C14.5 12.5673 13.0673 14 11.3 14H2.36274C0.937294 14 0.223427 12.2766 1.23137 11.2686L11.7686 0.731368Z"}),shield_with_moon:(0,g.jsx)("path",{d:"M12.525 15.75C13.0814 15.75 13.6269 15.6408 14.1615 15.4222C14.6961 15.2036 15.166 14.8757 15.5711 14.4385C15.6749 14.3244 15.7032 14.2033 15.6557 14.0751C15.6083 13.9469 15.5077 13.8629 15.3538 13.8232C14.7269 13.6783 14.1477 13.4183 13.6163 13.0433C13.0849 12.6683 12.6474 12.1789 12.3038 11.5751C11.9769 11.0046 11.7682 10.393 11.6778 9.74048C11.5874 9.08791 11.6589 8.45458 11.8923 7.84048C11.9525 7.68663 11.9301 7.55586 11.8249 7.44817C11.7198 7.34049 11.5916 7.30332 11.4403 7.33665C10.4442 7.59177 9.65927 8.1142 9.08555 8.90395C8.51185 9.69368 8.225 10.5591 8.225 11.5001C8.225 12.6796 8.64519 13.6828 9.48558 14.5097C10.3259 15.3366 11.3391 15.75 12.525 15.75ZM12 21.4808C9.83716 20.8911 8.04646 19.618 6.62787 17.6616C5.20929 15.7052 4.5 13.518 4.5 11.1001V5.34625L12 2.53857L19.5 5.34625V11.1001C19.5 13.518 18.7907 15.7052 17.3721 17.6616C15.9535 19.618 14.1628 20.8911 12 21.4808ZM12 19.9001C13.7333 19.3501 15.1666 18.2501 16.3 16.6001C17.4333 14.9501 18 13.1167 18 11.1001V6.37507L12 4.1347L5.99997 6.37507V11.1001C5.99997 13.1167 6.56664 14.9501 7.69997 16.6001C8.83331 18.2501 10.2666 19.3501 12 19.9001Z"}),stairs:(0,g.jsx)("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M18,8h-2.42v3.33H13v3.33h-2.58 V18H6v-2h2.42v-3.33H11V9.33h2.58V6H18V8z"}),wifi:(0,g.jsx)("path",{d:"M2.83333 9.50005L4.49999 11.1667C8.64166 7.02505 15.3583 7.02505 19.5 11.1667L21.1667 9.50005C16.1083 4.44172 7.89999 4.44172 2.83333 9.50005ZM9.49999 16.1667L12 18.6667L14.5 16.1667C13.125 14.7834 10.8833 14.7834 9.49999 16.1667ZM6.16666 12.8334L7.83333 14.5C10.1333 12.2 13.8667 12.2 16.1667 14.5L17.8333 12.8334C14.6167 9.61672 9.39166 9.61672 6.16666 12.8334Z"})},Wd=t=>t in wa?wa[t]:(console.warn(`The icon "${t}" is missing from ICON_MAP`),null),E=({name:t,size:e,className:r,viewBox:n,style:o})=>(0,g.jsx)("svg",{className:r,width:e||24,height:e||24,viewBox:n||"0 0 24 24","aria-label":t,"data-testid":t,style:{display:"block",fill:"currentColor",...o},children:Wd(t)});var La=C(fe());var on=require("react/jsx-runtime"),Vd={primary:"button--primary",outlined:"button--outlined",destructive:"button--destructive"},jd={32:"button--32",40:"button--40",48:"button--48"},H=({iconBefore:t,variant:e="primary",size:r=40,children:n,className:o,...i})=>(0,on.jsxs)("button",{type:"button",className:(0,La.default)("button",Vd[e],jd[r],o),...i,children:[t&&(0,on.jsx)(E,{className:"duffel-button__icon duffel-button__icon--before",name:t}),n]});var Co=require("react/jsx-runtime"),kt=({style:t,children:e})=>(0,Co.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",border:"dashed 1px var(--GREY-300)",borderRadius:"4px",paddingBlock:"32px",...t},children:(0,Co.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"470px"},children:e})});var pt=require("react/jsx-runtime"),an=class extends Fa.default.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){M(e,r)}render(){return this.state.hasError?(0,pt.jsxs)(kt,{children:[(0,pt.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"We ran into an error"}),(0,pt.jsx)("p",{className:"p1--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:"Please try reloading. If the problem persists reach out to our support team."}),(0,pt.jsx)("div",{children:(0,pt.jsx)(H,{variant:"outlined",iconBefore:"autorenew",onClick:()=>location.reload(),children:"Try again"})})]}):this.props.children}};var mt=require("react/jsx-runtime"),Ga=({height:t,message:e})=>(0,mt.jsxs)(kt,{style:{minHeight:t},children:[(0,mt.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"Failed to load extras"}),(0,mt.jsx)("p",{className:"p2--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:e||"Please try reloading. If the problem persists reach out to our support team."}),(0,mt.jsx)("div",{children:(0,mt.jsx)(H,{variant:"outlined",onClick:()=>location.reload(),iconBefore:"autorenew",children:"Try again"})})]});var Bt=(t,e)=>{if(t.available_services.length===0)throw new Error("No services available");let r=t.available_services.find(n=>n.type===e);if(!r)throw new Error(`No ${e} services available`);return r.total_currency};var be=t=>t.reduce((e,{quantity:r})=>e+r,0);var zd={baggage:Qr,cancel_for_any_reason:Mt},wt=(t,e)=>{let r=zd[e];if(!r)throw new Error(`Unknown service type: ${e}`);return t&&Array.isArray(t.available_services)&&t.available_services.some(n=>r(n)&&n.maximum_quantity>0)};var I=(t,e="en-GB",r={})=>n=>{try{let i=new Intl.NumberFormat(e,{style:"currency",currency:t,...r}).format(n);return r&&r.signDisplay&&(r.signDisplay==="always"||r.signDisplay==="exceptZero"&&n!==0)?i.replace(/^([+-])/,"$1 "):i}catch{return`${n} ${t}`}};var ue=(t,e,r)=>t==1?`${t} ${e}`:`${t} ${r}`;var is=C(require("react"));var Ua=require("react/jsx-runtime"),Lt=()=>(0,Ua.jsx)("span",{className:"textual-loading-indicator","aria-hidden":"true"});var Ha=C(fe()),Ya=C(require("react"));var K=require("react/jsx-runtime"),Ft=({buttonTitle:t,title:e,icon:r,copy:n,onClick:o,children:i,isLoading:a,disabled:s,isSelected:c})=>{let l=Ya.Children.toArray(i).length>0;return(0,K.jsxs)("button",{title:t,...o&&{onClick:o},disabled:s,className:(0,Ha.default)("ancillary-card",a&&"ancillary-card--loading"),style:{cursor:"pointer",background:"transparent",color:"var(--GREY-900)",border:"solid 1px rgba(226, 226, 232, 1)",display:"flex",rowGap:"4px",padding:"20px",borderRadius:"8px",justifyContent:"space-between",flexWrap:"wrap",flexDirection:"column",width:"100%",boxSizing:"border-box",fontSize:"16px",fontWeight:"400",lineHeight:"24px",letterSpacing:"0em",transition:"border-color 0.3s var(--TRANSITION-CUBIC-BEZIER) background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)"},children:[(0,K.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",marginBlock:"0",textAlign:"start",marginTop:"2px",columnGap:"12px",width:"100%"},children:[(0,K.jsx)("div",{children:c?(0,K.jsx)(E,{name:"check",className:"ancillary-card__selected-icon"}):(0,K.jsx)(E,{name:r})}),(0,K.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",width:"100%"},children:[(0,K.jsx)("p",{className:"p1--semibold",style:{marginBlock:"0"},children:e}),(0,K.jsx)("div",{className:"ancillary-card__children",children:l?i:(0,K.jsx)(E,{name:"expand_content",className:"ancillary-card__expand-icon"})})]})]}),(0,K.jsx)("p",{className:"p1--regular",style:{textAlign:"start",color:"var(--GREY-600)",marginLeft:"34px",marginBlock:"0"},children:n})]})};var $a=require("react/jsx-runtime"),Be=({backgroundColor:t,color:e,children:r})=>(0,$a.jsx)("div",{style:{backgroundColor:t,color:e,padding:"2px 8px",whiteSpace:"nowrap",borderRadius:"4px",fontWeight:"600",fontSize:"14px",lineHeight:"20px",textAlign:"center"},children:r});var sn=t=>t.reduce((e,r)=>({[r.id]:r,...e}),{});var cn=t=>t.slices.reduce((e,r)=>[...e,...r.segments],new Array);var fn=C(require("react"));var Ro=t=>{t?document.body.style.overflow="":document.body.style.overflow="hidden"};var Va=C(fe()),ja=C(require("react"));var Wa=C(fe());var xo=require("react/jsx-runtime"),qd={primary:"icon-button--primary",outlined:"icon-button--outlined"},sr=({icon:t,variant:e="primary",className:r,...n})=>(0,xo.jsx)("button",{type:"button",className:(0,Wa.default)("icon-button",qd[e],r),...n,children:(0,xo.jsx)(E,{name:t})});var Gt=require("react/jsx-runtime"),Ut=({children:t,onClose:e,isOpen:r})=>(ja.useEffect(()=>(Ro(!r),()=>Ro(!0)),[r]),(0,Gt.jsx)("div",{className:(0,Va.default)("modal",r&&"modal--open"),children:(0,Gt.jsxs)("div",{role:"presentation",className:"modal--content",children:[t,(0,Gt.jsx)(sr,{icon:"close",onClick:e,title:"Close modal",className:"modal--close-button"})]})})),Ht=({children:t})=>(0,Gt.jsx)("div",{className:"modal-body",children:t});var ln=(t,e,r)=>t.given_name&&t.family_name?`${t.given_name} ${t.family_name}`:t.given_name?t.given_name:t.family_name?t.family_name:e?.given_name&&e?.family_name?`${e.given_name} ${e.family_name}`:e?.given_name?e.given_name:e?.family_name?e.family_name:`Passenger ${r}`;var za=t=>{if(!t)return M(new Error("getBaggageServiceDescription was not given any metadata"),{metadata:t}),null;if(!t.maximum_weight_kg&&!t.maximum_length_cm&&!t.maximum_height_cm&&!t.maximum_depth_cm)return M(new Error("getBaggageServiceDescription metadata doesn't have any data"),{metadata:t}),null;let e=t.maximum_length_cm&&t.maximum_height_cm&&t.maximum_depth_cm,r="";e&&(r=` / ${t.maximum_height_cm} x ${t.maximum_length_cm} x ${t.maximum_depth_cm} cm`);let n="";return t.maximum_weight_kg&&(n=`Up to ${t.maximum_weight_kg}kg`),`${n}${r}`};var qa=(t,e,r,n)=>t.some(o=>o.id===n.id||o.serviceInformation?.type!=="carry_on"&&o.serviceInformation?.type!=="checked"||o.serviceInformation?.segmentId!==e||o.serviceInformation?.passengerId!==r?!1:o.serviceInformation?.type===n.metadata.type);var Yt=require("react/jsx-runtime"),Za=({id:t,min:e,max:r,value:n,onChange:o})=>(0,Yt.jsxs)("div",{className:"counter",id:t,children:[(0,Yt.jsx)(sr,{icon:"minus",title:"Remove one",id:`${t}-minus`,"data-testid":`${t}-minus`,variant:"outlined",disabled:n<=e,onClick:()=>o(Math.max(n-1,e))}),(0,Yt.jsx)("div",{className:"counter__count-label",children:n}),(0,Yt.jsx)(sr,{icon:"add",title:"Add one",id:`${t}-plus`,"data-testid":`${t}-plus`,variant:"outlined",disabled:n>=r,onClick:()=>o(Math.min(n+1,r))})]});var we=require("react/jsx-runtime"),Ka=({segmentId:t,passengerId:e,availableService:r,quantity:n,onQuantityChanged:o,selectedServices:i})=>{let a=r.metadata.type==="carry_on"?"Cabin bag":"Checked bag",s=I(r.total_currency)(+r.total_amount),c=za(r.metadata),l=qa(i,t,e,r);return(0,we.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,we.jsxs)("div",{children:[(0,we.jsxs)("p",{style:{margin:0},className:"p2--regular",children:[a,(0,we.jsx)("span",{style:{marginInline:"4px",color:"var(--GREY-400)"},children:"\u2022"}),(0,we.jsx)("span",{className:"p2--semibold","data-testid":`price-label--${r.id}--${e}`,children:s})]}),(0,we.jsx)("p",{style:{margin:0,color:"var(--GREY-600)"},className:"p3--regular",children:c})]}),(0,we.jsx)(Za,{id:`counter--${r.id}--${e}`,min:0,value:n,onChange:o,max:l?0:r.maximum_quantity})]})};var Ja=require("react/jsx-runtime"),Xa=({includedBaggage:t})=>{let{carryOnBagsQuantity:e,checkedBagsQuantity:r}=t.reduce((o,{type:i,quantity:a})=>({carryOnBagsQuantity:o.carryOnBagsQuantity+(i==="carry_on"?a:0),checkedBagsQuantity:o.checkedBagsQuantity+(i==="checked"?a:0)}),{carryOnBagsQuantity:0,checkedBagsQuantity:0}),n=new Array;return e>0&&n.push(ue(e,"cabin bag","cabin bags")),r>0&&n.push(ue(r,"checked bag","checked bags")),(0,Ja.jsxs)("div",{style:{marginBlock:"8px",padding:"8px 12px",color:" var(--GREEN-300)",backgroundColor:" var(--GREEN-100)",borderRadius:"6px"},className:"p2--regular",children:[n.join(" and ")," included with ticket"]})};var tt=require("react/jsx-runtime"),Qa=({segmentId:t,passengerId:e,passengerName:r,includedBaggage:n,passengerServicesForSegment:o,selectedServices:i,setSelectedServices:a})=>{let s=n.reduce((c,l)=>c+l.quantity,0);return(0,tt.jsxs)("div",{style:{marginTop:"24px"},children:[(0,tt.jsx)("h3",{style:{margin:0},className:"p1--semibold",children:r}),s&&(0,tt.jsx)(Xa,{includedBaggage:n}),(0,tt.jsx)("div",{style:{display:"flex",rowGap:"8px",flexDirection:"column"},children:o.map(c=>(0,tt.jsx)(Ka,{passengerId:e,segmentId:t,availableService:c,selectedServices:i,quantity:i.find(({id:l})=>l==c.id)?.quantity||0,onQuantityChanged:l=>Zd(l,t,e,r,c,i,a)},c.id))}),o.length===0&&(0,tt.jsx)("p",{style:{color:"var(--GREY-700)",margin:0},children:"Extra baggage is not available for this passenger on this flight"})]})},Zd=(t,e,r,n,o,i,a)=>{let s=i.findIndex(({id:l})=>o.id===l),c=Array.from(i);s<0?c.push({id:o.id,quantity:t,serviceInformation:{segmentId:e,passengerId:r,passengerName:n,total_amount:o.total_amount,total_currency:o.total_currency,...o.metadata}}):c[s].quantity=t,a(c.filter(({quantity:l})=>l!==0))};var No=require("react/jsx-runtime"),es=({offer:t,segment:e,passengersById:r,selectedServices:n,setSelectedServices:o})=>(0,No.jsx)(Ht,{children:e.passengers.map(({passenger_id:i,baggages:a},s)=>(0,No.jsx)(Qa,{segmentId:e.id,passengerId:i,passengerName:ln(r[i],t.passengers.find(({id:c})=>c===i),s+1),includedBaggage:a,passengerServicesForSegment:t.available_services.filter(({type:c,passenger_ids:l,segment_ids:d})=>c==="baggage"&&l.includes(i)&&d.includes(e.id)),selectedServices:n,setSelectedServices:o},i))});var Le=require("react/jsx-runtime"),ts=({selectedServices:t,servicePrices:e,currency:r,isFirstSegment:n,isLastSegment:o,onNextSegmentButtonClicked:i,onPreviousSegmentButtonClicked:a,onClose:s})=>{let c=be(t),l=ar(e,t),d=I(r)(l);return(0,Le.jsxs)("div",{style:{padding:"16px 24px 24px"},children:[(0,Le.jsxs)("div",{className:"flex--space-between",children:[(0,Le.jsxs)("div",{children:["Price for ",ue(c,"extra bag","extra bags")]}),(0,Le.jsxs)("div",{className:"h3--semibold","data-testid":"baggage-total-amount-label",children:["+ ",d]})]}),(0,Le.jsxs)("div",{style:{marginTop:"16px",display:"grid",columnGap:"12px",gridTemplateColumns:"repeat(2, 1fr)"},children:[(0,Le.jsx)(H,{size:48,variant:"outlined",disabled:n,onClick:()=>a(),children:"Back"}),(0,Le.jsx)(H,{size:48,"data-testid":"confirm-selection-for-baggage",onClick:()=>o?s():i(),children:o?"Confirm":"Next"})]})]})};var dn=t=>{let e=new Date(t);if(isNaN(e.valueOf()))M(new Error("formatDateString attempted to parse an invalid date string"),{dateString:t});else return Kd(e)},Kd=t=>{let{format:e}=new Intl.DateTimeFormat(void 0,{dateStyle:"medium"});return e(t)};var Te=require("react/jsx-runtime"),rs=({segmentCount:t,currentSegmentIndex:e,currentSegment:r,setCurrentSegmentIndex:n})=>(0,Te.jsxs)("div",{style:{padding:"24px 24px 16px"},children:[(0,Te.jsx)("div",{style:{display:"flex",columnGap:"4px"},children:Array(t).fill(0).map((o,i)=>i===e?(0,Te.jsx)(Xd,{},`segment_${i}`):(0,Te.jsx)(ns,{onClick:()=>n(i)},`segment_${i}`))}),(0,Te.jsxs)("h2",{className:"h3--semibold",style:{marginTop:"12px"},children:["Flight to ",r.destination.iata_code,(0,Te.jsx)("span",{className:"p2--regular",style:{color:"var(--GREY-600)",marginLeft:"8px"},children:dn(r.departing_at)})]})]}),ns=({onClick:t,style:e})=>(0,Te.jsx)("button",{onClick:t,style:{border:"none",width:"4px",height:"4px",padding:"0",borderRadius:"4px",backgroundColor:"rgba(var(--ACCENT), var(--ACCENT-LIGHT-200))",transition:"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)",...e}}),Xd=()=>(0,Te.jsx)(ns,{onClick:void 0,style:{backgroundColor:"rgb(var(--ACCENT))"}});var $t=require("react/jsx-runtime"),os=({isOpen:t,offer:e,passengers:r,onClose:n,selectedServices:o})=>{let[i,a]=(0,fn.useState)(0),[s,c]=fn.default.useState(o);if(!e)return null;let l=cn(e),d=l[i],f=sn(r),m=At(e.available_services),p=e.base_currency;return wt(e,"baggage")&&(p=Bt(e,"baggage")),(0,$t.jsxs)(Ut,{isOpen:t,onClose:()=>n(s),children:[(0,$t.jsx)(rs,{segmentCount:l.length,currentSegment:d,currentSegmentIndex:i,setCurrentSegmentIndex:y=>a(y)}),(0,$t.jsx)(es,{offer:e,selectedServices:s,passengersById:f,segment:d,setSelectedServices:c}),(0,$t.jsx)(ts,{currency:p,selectedServices:s,servicePrices:m,isFirstSegment:i===0,isLastSegment:i+1===l.length,onNextSegmentButtonClicked:()=>a(i+1),onPreviousSegmentButtonClicked:()=>a(i-1),onClose:()=>n(s)})]})};var Ce=require("react/jsx-runtime"),as=({isLoading:t,offer:e,passengers:r,selectedServices:n,setSelectedServices:o})=>{let[i,a]=is.default.useState(!1),s=wt(e,"baggage"),c=be(n),l=c>0,d=et(e,n),f=e?.base_currency||"";s&&(f=Bt(e,"baggage"));let m=e?I(f)(d):"0",p=s&&l?`${ue(c,"bag","bags")} added for ${m}`:"Add any extra baggage you need for your trip";return(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)(Ft,{buttonTitle:"Select extra baggage",title:"Extra baggage",copy:p,icon:"cabin_bag",onClick:s?()=>a(!0):null,isLoading:t,disabled:!t&&!s,isSelected:l,children:[t&&(0,Ce.jsxs)(Be,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,Ce.jsx)(Lt,{})]}),!t&&!s&&(0,Ce.jsx)(Be,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,Ce.jsx)(os,{isOpen:!!(i&&e),offer:e,passengers:r,onClose:y=>{o(y),a(!1)},selectedServices:n})]})};var fs=C(require("react"));var cr=require("react/jsx-runtime"),un=({children:t})=>(0,cr.jsxs)("li",{className:"cfar-modal-list-item",children:[(0,cr.jsx)(E,{name:"check"}),(0,cr.jsx)("p",{children:t})]});var Fe=require("react/jsx-runtime"),ss=({offerCurrency:t,service:e})=>(0,Fe.jsxs)(Ht,{children:[(0,Fe.jsxs)("ul",{style:{padding:0},children:[(0,Fe.jsx)(un,{children:"Cancel your trip for any reason"}),(0,Fe.jsxs)(un,{children:["Guaranteed refund of"," ",I(t)(+e.metadata.refund_amount)]}),(0,Fe.jsx)(un,{children:"Redeemable up to 24 hours before first flight departure"})]}),(0,Fe.jsxs)("a",{href:e.metadata.terms_and_conditions_url,rel:"noopener noreferrer",target:"_blank",className:"p2--regular",style:{color:"var(--GREY-600)"},children:["Terms and conditions",(0,Fe.jsx)(E,{name:"north_east",size:16,style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}})]})]});var rt=require("react/jsx-runtime"),cs=({service:t,selectedServices:e,onAddCfarService:r,onRemoveCfarService:n,onClose:o})=>{let i=e.some(({id:s})=>s==t.id),a=I(t.total_currency)(+t.total_amount);return(0,rt.jsxs)("div",{className:"cfar-modal-footer",children:[(0,rt.jsx)(H,{size:48,variant:i?"destructive":"outlined",onClick:i?n:o,children:i?"Remove protection":"Don\u2019t protect trip"}),!i&&(0,rt.jsxs)(H,{size:48,"data-testid":"confirm-selection-for-cfar",onClick:r,children:["Add protection for ",a]}),i&&(0,rt.jsx)(Jd,{})]})},Jd=()=>(0,rt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",columnGap:"8px",backgroundColor:"var(--GREY-100)",padding:"var(--space-12)",borderRadius:"var(--BUTTON-RADIUS)"},children:[(0,rt.jsx)(E,{size:20,name:"shield_with_moon",style:{fill:"rgb(var(--ACCENT))"}}),"Your trip is protected"]});var Io=require("react/jsx-runtime"),ls=()=>(0,Io.jsx)("div",{style:{padding:"24px 24px 16px"},children:(0,Io.jsx)("h2",{className:"h3--semibold",style:{marginBlock:0},children:"Cancel for any reason"})});var Ge=require("react/jsx-runtime"),ds=({isOpen:t,offerCurrency:e,service:r,onClose:n,selectedServices:o})=>(0,Ge.jsxs)(Ut,{isOpen:t,onClose:()=>n(o),children:[(0,Ge.jsx)(ls,{}),r&&e&&(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(ss,{service:r,offerCurrency:e}),(0,Ge.jsx)(cs,{service:r,selectedServices:o,onAddCfarService:()=>n([{id:r.id,quantity:1,serviceInformation:{type:"cancel_for_any_reason",total_amount:r.total_amount,total_currency:r.total_currency,...r.metadata}}]),onRemoveCfarService:()=>n([]),onClose:()=>n(o)})]})]});var Re=require("react/jsx-runtime"),us=({isLoading:t,offer:e,selectedServices:r,setSelectedServices:n})=>{let[o,i]=fs.default.useState(!1),a=wt(e,"cancel_for_any_reason"),c=be(r)>0,l=e?.base_currency||"";a&&(l=Bt(e,"cancel_for_any_reason"));let d=et(e,r),f=e?I(l)(d):"0",m=e?.available_services.find(Mt),p=a&&c?`Your trip is protected for ${f}`:"Protect your purchase if you decide to cancel";return(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsxs)(Ft,{buttonTitle:"Add cancel for any reason",title:"Cancel for any reason",copy:p,icon:"shield_with_moon",onClick:a?()=>i(!0):null,isLoading:t,disabled:!t&&!a,isSelected:c,children:[t&&(0,Re.jsxs)(Be,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,Re.jsx)(Lt,{})]}),!t&&!a&&(0,Re.jsx)(Be,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,Re.jsx)(ds,{isOpen:!!(o&&e&&m),offerCurrency:e?.base_currency,service:m,onClose:y=>{i(!1),n(y)},selectedServices:r})]})};var ps=(t,e)=>{for(let r of t)for(let n of r.cabins)for(let o of n.rows)for(let i of o.sections)for(let a of i.elements)if(e(a))return a};var pn=t=>ps(t,r=>r.type==="seat"&&r.available_services.length>0)?.available_services[0]?.total_currency;var zs=C(require("react"));var ms=t=>t.flatMap(e=>e.passengers.map((r,n)=>({passenger:r,passengerIndex:n,segment:e})));var ko=C(require("react"));var _s=(t,e)=>e.cabins.filter(r=>r.deck===t);var gs=t=>{let e=new Set;for(let r of t)for(let n of r.rows)for(let o of n.sections)for(let i of o.elements)i.type!=="seat"&&i.type!=="empty"&&e.add(i.type);return e};var hs=(t,e)=>!!(t.wings&&t.wings.first_row_index<=e&&t.wings.last_row_index>=e);var Gs=C(fe()),Us=C(require("react"));var Ss=C(fe());var Oo=require("react/jsx-runtime"),ys=({value:t,onChange:e,options:r})=>(0,Oo.jsx)("div",{className:"seat-map__tab-select",children:r.map(n=>(0,Oo.jsx)("button",{type:"button",className:(0,Ss.default)("seat-map__tab-select-option",{"seat-map__tab-select-option--selected":n===t}),onClick:()=>t!==n&&e(n),children:n},n))});var vs=require("react/jsx-runtime"),Es=({value:t,setValue:e})=>{let r=["Lower deck","Upper deck"];return(0,vs.jsx)(ys,{options:r,value:r[t],onChange:n=>e(r.indexOf(n))})};var k=require("react/jsx-runtime"),bs=({symbols:t})=>(0,k.jsxs)("div",{className:"seat-map__legend",children:[(0,k.jsxs)("span",{className:"seat-map__legend-item",children:[(0,k.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--fee-payable","aria-label":"Additional cost for seat",children:(0,k.jsx)(E,{name:"seat_paid_indicator",className:"seat-map__legend-seat--fee-payable-indicator",size:12})}),"Additional Cost"]}),(0,k.jsxs)("span",{className:"seat-map__legend-item",children:[(0,k.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--included","aria-label":"Included seat"}),"Included"]}),(0,k.jsxs)("span",{className:"seat-map__legend-item",children:[(0,k.jsx)("span",{className:"seat-map__legend-seat seat-map__legend-seat--selected","aria-label":"Selected seat"}),"Selected"]}),(0,k.jsxs)("span",{className:"seat-map__legend-item",children:[(0,k.jsx)("span",{className:"seat-map__legend-seat","aria-label":"Unavailable seat",children:(0,k.jsx)(E,{name:"close",size:14})}),"Unavailable"]}),[...t].map(e=>(0,k.jsxs)("span",{className:"seat-map__legend-item seat-map__legend-item--symbol",children:[(0,k.jsx)(E,{name:e,size:20}),e.split("_")[0]]},e))]});var Ts=t=>{let e=Object.values(t.sections).map(r=>r.elements).reduce((r,n)=>r.concat(n),[]).filter(r=>r.type==="seat");return e.length>0?e[0].designator.substring(0,e[0].designator.length-1):null};var Bs=C(fe()),Ao=C(require("react"));var Cs=C(fe());var Po=require("react/jsx-runtime"),Qd=["bassinet","exit_row"],Rs=({type:t})=>(0,Po.jsx)("div",{className:(0,Cs.default)("map-element map-element--amenity",{"map-element--wrapped":!Qd.includes(t)}),"aria-label":t.toString(),children:(0,Po.jsx)(E,{name:t,size:16})});var xs=require("react/jsx-runtime"),lr=()=>(0,xs.jsx)("div",{className:"map-element map-element--empty"});var Ns=C(fe());var mn=require("react/jsx-runtime"),Is=({isRight:t})=>(0,mn.jsx)("div",{className:(0,Ns.default)("map-element map-element--exit",{"map-element--exit--right":t}),children:t?(0,mn.jsx)(E,{name:"exit_row_right"}):(0,mn.jsx)(E,{name:"exit_row"})});var Os=(t="")=>t.split(" ").map(e=>e[0]).slice(0,2).join("");var As=C(fe());var nt=require("react/jsx-runtime"),Ps=({seat:t,service:e})=>{let r=e?I(e.total_currency)(+e.total_amount):"";return(0,nt.jsxs)("div",{className:"seat-info",children:[(0,nt.jsxs)("div",{className:"seat-info__details",children:[(0,nt.jsx)("strong",{children:t?.designator}),(0,nt.jsxs)("span",{children:[t?.name||"Seat"," "]}),(0,nt.jsx)("strong",{children:r})]}),t?.disclosures.map((n,o)=>(0,nt.jsx)("div",{className:"seat-info__disclosure",children:n},o))]})};var Do=require("react/jsx-runtime"),Ds=({seat:t})=>(0,Do.jsx)("span",{className:"map-element map-element__seat","aria-label":`${t.designator} ${t.name||"Seat"} Unavailable`,children:(0,Do.jsx)(E,{name:"close",size:14})});var Ue=require("react/jsx-runtime"),Ms=({element:t,currentPassengerId:e,currentSegmentId:r,currentPassengerName:n,onSeatToggled:o,selectedServicesMap:i})=>{let a=t.available_services.find(W=>W.passenger_id===e);if(!a)return(0,Ue.jsx)(Ds,{seat:t});let s=Object.values(i).find(W=>W.serviceInformation?.designator===t.designator&&W.serviceInformation?.segmentId===r),c=s!=null,l=c?Os(s.serviceInformation?.passengerName):t.designator.charAt(t.designator.length-1),d=!isNaN(+a?.total_amount)&&+a?.total_amount!=0,f=!c&&a.passenger_id===e,m=!c||c&&r===s.serviceInformation?.segmentId&&e===s.serviceInformation?.passengerId,p=(0,As.default)("map-element","map-element__seat",{"map-element--available":f,"map-element--selected":c,"map-element--actionable":m}),y=I(a.total_currency)(+a.total_amount),A=c&&r===s.serviceInformation?.segmentId&&e===s.serviceInformation?.passengerId;return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsxs)("button",{"data-testid":`seat-${t.designator}`,id:t.designator,className:p,onClick:()=>{m&&o({quantity:c?0:1,id:a.id,serviceInformation:{type:"seat",segmentId:r,passengerId:e,passengerName:n,designator:t.designator,disclosures:t.disclosures,total_amount:a.total_amount,total_currency:a.total_currency}})},"aria-label":`${t.designator} ${t.name||"Seat"} ${y}`,children:[d&&(0,Ue.jsx)(E,{name:"seat_paid_indicator",className:"map-element--fee-payable",size:16}),l]}),A&&(0,Ue.jsx)(Ps,{seat:t,service:a})]})};var ot=require("react/jsx-runtime"),ks=({element:t,elementIndex:e,sectionIndex:r,onSeatToggled:n,selectedServicesMap:o,currentPassengerId:i,currentSegmentId:a,currentPassengerName:s})=>(0,ot.jsx)(ot.Fragment,{children:en(t)?(0,ot.jsx)(Ms,{currentSegmentId:a,currentPassengerId:i,currentPassengerName:s,selectedServicesMap:o,element:t,onSeatToggled:n},e):t.type==="empty"?(0,ot.jsx)(lr,{},e):t.type==="exit_row"?(0,ot.jsx)(Is,{isRight:r>0},e):(0,ot.jsx)(Rs,{type:t.type},e)});var He=require("react/jsx-runtime"),ws=({row:t,rowNumber:e,hasWings:r,section:n,sectionIndex:o,onSeatToggled:i,selectedServicesMap:a,currentPassengerId:s,currentPassengerName:c,currentSegmentId:l})=>{let d=Object.keys(t.sections).length,f=d===1;return(0,He.jsxs)(Ao.Fragment,{children:[(0,He.jsx)("div",{className:(0,Bs.default)("map-section",{"map-section--left":o===0,"map-section--right":f?!1:o===d-1,"map-section--wing":r}),children:n.elements.length>0?n.elements.map((m,p)=>(0,He.jsx)(Ao.Fragment,{children:(0,He.jsx)(ks,{sectionIndex:o,elementIndex:p,element:m,selectedServicesMap:a,onSeatToggled:i,currentPassengerId:s,currentSegmentId:l,currentPassengerName:c})},p)):(0,He.jsx)(lr,{})}),(o<d-1||f&&o<d)&&(0,He.jsx)("span",{className:"map-section__aisle",children:e}),f&&o===t.sections.length-1&&(0,He.jsx)(lr,{})]},o)};var dr=require("react/jsx-runtime"),Ls=({row:t,hasWings:e,onSeatToggled:r,selectedServicesMap:n,currentPassengerId:o,currentPassengerName:i,currentSegmentId:a})=>{let s=Ts(t);return(0,dr.jsx)(dr.Fragment,{children:t.sections.map((c,l)=>(0,dr.jsx)(ws,{row:t,rowNumber:s,hasWings:e,section:c,sectionIndex:l,selectedServicesMap:n,onSeatToggled:r,currentPassengerId:o,currentPassengerName:i,currentSegmentId:a},l))})};var fr=require("react/jsx-runtime"),Fs=()=>(0,fr.jsxs)(kt,{children:[(0,fr.jsx)("p",{style:{marginBlock:"0"},className:"p1--semibold",children:"Seat selection unavailable"}),(0,fr.jsx)("p",{className:"p1--regular",style:{color:"var(--GREY-600)",marginBlock:"12px",textAlign:"center"},children:"Unfortunately seat selection is not available for this flight. A seat will be allocated by the airline."})]});var Ye=require("react/jsx-runtime"),Hs=({seatMap:t,onSeatToggled:e,selectedServicesMap:r,currentPassengerId:n,currentPassengerName:o,currentSegmentId:i})=>{let[a,s]=Us.useState(0),c=_s(a,t),l=c.length!==t.cabins.length,d=t.cabins.some(m=>m.wings);if(!c||!c.length)return(0,Ye.jsx)(Fs,{});let f=gs(c);return(0,Ye.jsxs)("div",{className:(0,Gs.default)("seat-map",{"seat-map--wings":d}),children:[l&&(0,Ye.jsx)(Es,{value:a,setValue:m=>{s(m)}}),(0,Ye.jsx)("div",{className:"seat-map__legend-container",children:(0,Ye.jsx)(bs,{symbols:f})}),c.map((m,p)=>(0,Ye.jsx)("div",{className:"seat-map__map-container",style:{"--CABIN-AISLES":m.aisles},children:m.rows.map((y,A)=>(0,Ye.jsx)(Ls,{row:y,hasWings:hs(m,A),onSeatToggled:e,selectedServicesMap:r,currentPassengerId:n,currentPassengerName:o,currentSegmentId:i},A))},`cabin-${p}`))]})};var Mo=require("react/jsx-runtime"),Ys=t=>(0,Mo.jsx)(Ht,{children:(0,Mo.jsx)(Hs,{...t})});var $e=require("react/jsx-runtime"),$s=({selectedServices:t,servicePrices:e,currency:r,isFirstSegment:n,isLastSegment:o,onNextSegmentButtonClicked:i,onPreviousSegmentButtonClicked:a,onClose:s,seatMaps:c})=>{let l=be(t),d=ar(e,t,c),f=I(r)(d);return(0,$e.jsxs)("div",{style:{padding:"16px 24px 24px"},children:[(0,$e.jsxs)("div",{className:"flex--space-between",children:[(0,$e.jsxs)("div",{children:["Price for ",ue(l,"seat","seats")]}),(0,$e.jsxs)("div",{className:"h3--semibold",children:["+ ",f]})]}),(0,$e.jsxs)("div",{style:{marginTop:"16px",display:"grid",columnGap:"12px",gridTemplateColumns:"repeat(2, 1fr)"},children:[(0,$e.jsx)(H,{size:48,disabled:n,variant:"outlined",onClick:()=>a(),children:"Back"}),(0,$e.jsx)(H,{size:48,"data-testid":"confirm-selection-for-seats",onClick:()=>o?s():i(),children:o?"Confirm":"Next"})]})]})};var pe=require("react/jsx-runtime"),Ws=({segmentAndPassengerPermutationsCount:t,currentSegmentAndPassengerPermutationsIndex:e,currentSegment:r,currentPassengerName:n,setCurrentSegmentAndPassengerPermutationsIndex:o})=>(0,pe.jsxs)("div",{style:{padding:"24px 24px 16px"},children:[(0,pe.jsx)("div",{style:{display:"flex",columnGap:"4px"},children:Array(t).fill(0).map((i,a)=>a===e?(0,pe.jsx)(ef,{},`segment_${a}`):(0,pe.jsx)(Vs,{onClick:()=>o(a)},`segment_${a}`))}),(0,pe.jsxs)("h2",{className:"h3--semibold",style:{marginBlock:"12px 0px"},children:["Flight to ",r.destination.iata_code,(0,pe.jsx)("span",{className:"p2--regular",style:{color:"var(--GREY-600)",marginLeft:"8px"},children:dn(r.departing_at)})]}),(0,pe.jsx)("p",{className:"h3--semibold",style:{color:"var(--GREY-600)",marginBlock:"0 4px"},children:n})]}),Vs=({onClick:t,style:e})=>(0,pe.jsx)("button",{onClick:t,style:{border:"none",width:"4px",height:"4px",padding:"0",borderRadius:"4px",backgroundColor:"rgba(var(--ACCENT), var(--ACCENT-LIGHT-200))",transition:"background-color 0.3s var(--TRANSITION-CUBIC-BEZIER)",...e}}),ef=()=>(0,pe.jsx)(Vs,{onClick:void 0,style:{backgroundColor:"rgb(var(--ACCENT))"}});var Wt=require("react/jsx-runtime"),js=({isOpen:t,offer:e,passengers:r,seatMaps:n,selectedServices:o,onClose:i})=>{let[a,s]=ko.default.useState(0),[c,l]=ko.default.useState(o),d=c.reduce((V,J)=>({...V,[J.id]:J}),{});if(!e||!n)return null;let f=cn(e),m=sn(r),p=At(e.available_services),y=ms(f),{passenger:{passenger_id:A},passengerIndex:W,segment:{id:X}}=y[a],_t=f.find(({id:V})=>V===X),it=m[A],_n=n.find(V=>V.segment_id===X),We=ln(it,e.passengers[W],W+1),gn=V=>{let J=new Array;for(let Ve of c){let ur=Ve.id===V.id&&V.quantity===0,hn=Ve.serviceInformation?.segmentId===X&&Ve.serviceInformation?.passengerId===A;!ur&&!hn&&(J=[...J,Ve])}V.quantity>0&&(J=[...J,V]),l(J)},at=pn(n)??e.total_currency;return(0,Wt.jsxs)(Ut,{isOpen:t,onClose:()=>i(c),children:[(0,Wt.jsx)(Ws,{segmentAndPassengerPermutationsCount:y.length,currentSegment:_t,currentPassengerName:We,currentSegmentAndPassengerPermutationsIndex:a,setCurrentSegmentAndPassengerPermutationsIndex:s}),(0,Wt.jsx)(Ys,{selectedServicesMap:d,seatMap:_n,onSeatToggled:gn,currentPassengerId:A,currentPassengerName:We,currentSegmentId:X}),(0,Wt.jsx)($s,{seatMaps:n,currency:at,selectedServices:c,servicePrices:p,isFirstSegment:a===0,isLastSegment:a+1===y.length,onNextSegmentButtonClicked:()=>{s(a+1)},onPreviousSegmentButtonClicked:()=>{s(a-1)},onClose:()=>i(c)})]})};var xe=require("react/jsx-runtime"),qs=({isLoading:t,offer:e,seatMaps:r,passengers:n,selectedServices:o,setSelectedServices:i})=>{let[a,s]=zs.default.useState(!1),c=Array.isArray(r)&&r.length>0,l=be(o),d=l>0,f=et(e,o,r),m=e?.base_currency??"";r&&(m=pn(r)??m);let p=e?I(m)(f):"0",y=c&&d?`${ue(l,"seat","seats")} selected for ${p}`:"Specify where on the plane you\u2019d like to sit";return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsxs)(Ft,{buttonTitle:"Select seats",title:"Seat selection",copy:y,icon:"flight_class",onClick:c?()=>s(!0):null,isLoading:t,disabled:t&&!c,isSelected:d,children:[t&&(0,xe.jsxs)(Be,{color:"var(--GREY-900)",backgroundColor:"var(--GREY-100)",children:["Loading",(0,xe.jsx)(Lt,{})]}),!t&&!c&&(0,xe.jsx)(Be,{color:"var(--GREY-700)",backgroundColor:"var(--GREY-200)",children:"Not available"})]}),(0,xe.jsx)(js,{isOpen:!!(e&&r&&a),seatMaps:r,offer:e,passengers:n,selectedServices:o,onClose:A=>{i(A),s(!1)}})]})};var $=require("react/jsx-runtime"),tf="https://assets.duffel.com/components/ancillaries/3.0.3-canary",rf=`${tf}/global.css`,Zs=t=>{let e=So(t.debug||!1);if(e.logGroup("Properties passed into the component:",t),!yo(t))throw new Error(`The props (${Object.keys(t)}) passed to DuffelAncillaries are invalid. \`onPayloadReady\`, \`passengers\` and \`services\` are always required. Then, depending on your use case you may have one of the following combinations of required props: \`offer_id\` and \`client_key\`, \`offer\` and \`seat_maps\` or \`offer\` and \`client_key\`.Please refer to the documentation for more information and working examples: https://duffel.com/docs/guides/ancillaries-component`);if(t.services.length===0)throw new Error('You must provide at least one service in the "services" prop. Valid services: ["bags", "seats", "cancel_for_any_reason"]');let r=Eo(t),n=vo(t),o=bo(t),i=To(t),a=t.services.includes("seats")&&!("seat_maps"in t)&&(r||n||i),[s,c]=Y.useState(t.passengers),[l,d]=Y.useState(t.offer),[f,m]=Y.useState(n),[p,y]=Y.useState(o?t.seat_maps:void 0),[A,W]=Y.useState(a),[X,_t]=Y.useState(null),[it,_n]=Y.useState(new Array),[We,gn]=Y.useState(new Array),[at,V]=Y.useState(new Array),J=va(t.markup,t.priceFormatters),Ve=P=>{let Ne="This offer has expired.";if(Ia(P)){_t(Ne);return}else{let Lo=new Date(P.expires_at).getTime()-Date.now(),nc=1e3*60*60*24;Lo<nc&&setTimeout(()=>_t(Ne),Lo)}let Sn=ba(P,J);d(Sn)},ur=P=>{let Ne=Ta(P,J.seats);y(Ne)};if(Y.useEffect(()=>{Hr("props",{"props.services":t.services,"props.passengers.length":t.passengers.length,"props.offer_id":t.offer_id,"props.client_key":t.client_key,"props.offer?.id":t.offer?.id,"props.seat_maps?.[0]?.id":t.seat_maps?.[0]?.id}),(n||r)&&Ma(t.offer_id,r?null:t.client_key,_t,m,P=>{if(Ve(P),P.passengers.length!==s.length)throw new Error(`The number of passengers given to \`duffel-ancillaries\` (${t.passengers.length}) doesn't match the number of passengers on the given offer (${P.passengers.length}).`);r&&c(t.passengers.map((Ne,Sn)=>({...Ne,id:P.passengers[Sn].id})))}),a&&Ba(n||r?t.offer_id:t.offer.id,r?null:t.client_key,_t,W,ur),i&&Ve(t.offer),o&&(Ve(t.offer),ur(t.seat_maps))},[t.offer_id,t.client_key,t.offer?.id,t.seat_maps?.[0]?.id]),Y.useEffect(()=>{if(!l)return;let P=Ea({baggageSelectedServices:it,seatSelectedServices:We,cfarSelectedServices:at,offer:l,passengers:s,seatMaps:p});if(Ca(P)){let Ne={offer_total_amount:l.total_amount,offer_total_currency:l.total_currency,offer_tax_amount:l.tax_amount,offer_tax_currency:l.tax_currency,baggage_services:it,seat_services:We,cancel_for_any_reason_services:at};e.logGroup("Payload ready",{"Order creation payload":P,"Services metadata":Ne}),t.onPayloadReady(P,Ne)}},[it,We,at]),!yo(t))return null;let hn=`${72*t.services.length+32*(t.services.length-1)}px`,tc={display:"flex",width:"100%",flexDirection:"column",rowGap:"12px",...t.styles?.accentColor&&{"--ACCENT":t.styles.accentColor},...t.styles?.fontFamily&&{"--FONT-FAMILY":t.styles.fontFamily},...t.styles?.buttonCornerRadius&&{"--BUTTON-RADIUS":t.styles.buttonCornerRadius}},rc={isOfferLoading:f,isSeatMapLoading:A,baggageSelectedServices:it,seatSelectedServices:We,cfarSelectedServices:at,offer:l,seatMaps:p,error:X};return e.logGroup("Component's internal state:",rc),(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("link",{rel:"stylesheet",href:rf}),(0,$.jsx)(Na.Provider,{value:e,children:(0,$.jsx)("div",{className:"duffel-components",style:tc,children:(0,$.jsxs)(an,{children:[X&&(0,$.jsx)(Ga,{height:hn,message:X}),!X&&t.services.map(P=>{if(P==="bags")return(0,$.jsx)(as,{isLoading:f,offer:l,passengers:s,selectedServices:it,setSelectedServices:_n},"bags");if(P==="seats")return(0,$.jsx)(qs,{isLoading:f||A,seatMaps:p,offer:l,passengers:s,selectedServices:We,setSelectedServices:gn},"seats");if(P==="cancel_for_any_reason")return(0,$.jsx)(us,{isLoading:f,offer:l,selectedServices:at,setSelectedServices:V},"cancel_for_any_reason")})]})})})]})};var ec=require("react/jsx-runtime"),Bo="duffel-ancillaries",wo=class extends HTMLElement{root;connectedCallback(){let e=document.createElement("div");this.attachShadow({mode:"open"}).appendChild(e),this.root=(0,Ks.createRoot)(e)}render(e){if(!this.root)throw"It was not possible to render `duffel-ancillaries` because `this.root` is missing.";this.root.render((0,ec.jsx)(Zs,{...e,onPayloadReady:(r,n)=>{this.dispatchEvent(new CustomEvent("onPayloadReady",{detail:{data:r,metadata:n},composed:!0}))}}))}};window.customElements.get(Bo)||window.customElements.define(Bo,wo);function Xs(t){let e=document.querySelector(Bo);if(!e)throw new Error(`Could not find duffel-ancillaries element in the DOM. Maybe you need to call ${t} after 'window.onload'?`);return e}function Js(t){Xs("renderDuffelAncillariesCustomElement").render(t)}function Qs(t){let e=Xs("onDuffelAncillariesPayloadReady"),r=n=>{t(n.detail.data,n.detail.metadata)};e.addEventListener("onPayloadReady",r)}
27
+ /*! Bundled license information:
28
+
29
+ classnames/index.js:
30
+ (*!
31
+ Copyright (c) 2018 Jed Watson.
32
+ Licensed under the MIT License (MIT), see
33
+ http://jedwatson.github.io/classnames
34
+ *)
35
+ */
36
+ //# sourceMappingURL=custom-elements.js.map