@astropay/payments-lib 0.1.2 → 0.1.3
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.
- package/dist/astropay-payments-lib.es.js +1 -1
- package/dist/astropay-payments-lib.umd.js +4 -4
- package/dist/{main-DcyIcTY7.js → main-BcVhtQav.js} +10 -10
- package/dist/{profiler-DOjJT9RY.js → profiler-DiQDgm1N.js} +1 -1
- package/dist/{startRecording-CKIy7MKJ.js → startRecording-BDrOJilH.js} +1 -1
- package/package.json +1 -1
|
@@ -10,13 +10,13 @@ ${n}`:""}`;await Ts(r)}};function yr(e,t,n){return t.includes(e)?e:n}const At=cl
|
|
|
10
10
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[pa]=this[pa]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=zn(o);r[a]||(fp(s,o),r[a]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(ke.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),S.freezeMethods(ke);function Ds(e,t){const n=this||Vn,r=t||n,s=ke.from(r.headers);let i=r.data;return S.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ha(e){return!!(e&&e.__CANCEL__)}function en(e,t,n){F.call(this,e??"canceled",F.ERR_CANCELED,t,n),this.name="CanceledError"}S.inherits(en,F,{__CANCEL__:!0});function ga(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function hp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[i];o||(o=l),n[s]=c,r[s]=l;let d=i,f=0;for(;d!==s;)f+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function gp(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-d)))},()=>s&&o(s)]}const Lr=(e,t,n=3)=>{let r=0;const s=hp(50,250);return gp(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-r,l=s(c),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},ma=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ya=e=>(...t)=>S.asap(()=>e(...t)),mp=we.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,we.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(we.origin),we.navigator&&/(msie|trident)/i.test(we.navigator.userAgent)):()=>!0,yp=we.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];S.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),S.isString(r)&&o.push("path="+r),S.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function bp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ba(e,t,n){let r=!bp(t);return e&&(r||n==!1)?wp(e,t):t}const wa=e=>e instanceof ke?{...e}:e;function Ot(e,t){t=t||{};const n={};function r(l,u,d,f){return S.isPlainObject(l)&&S.isPlainObject(u)?S.merge.call({caseless:f},l,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function s(l,u,d,f){if(S.isUndefined(u)){if(!S.isUndefined(l))return r(void 0,l,d,f)}else return r(l,u,d,f)}function i(l,u){if(!S.isUndefined(u))return r(void 0,u)}function o(l,u){if(S.isUndefined(u)){if(!S.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,u,d)=>s(wa(l),wa(u),d,!0)};return S.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||s,f=d(e[u],t[u],u);S.isUndefined(f)&&d!==a||(n[u]=f)}),n}const Sa=e=>{const t=Ot({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=ke.from(o),t.url=la(ba(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(S.isFormData(n)){if(we.hasStandardBrowserEnv||we.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(we.hasStandardBrowserEnv&&(r&&S.isFunction(r)&&(r=r(t)),r||r!==!1&&mp(t.url))){const l=s&&i&&yp.read(i);l&&o.set(s,l)}return t},Sp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Sa(e);let i=s.data;const o=ke.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,u,d,f,h,p;function g(){h&&h(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function w(){if(!m)return;const b=ke.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:b,config:e,request:m};ga(function(y){n(y),g()},function(y){r(y),g()},k),m=null}"onloadend"in m?m.onloadend=w:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(w)},m.onabort=function(){m&&(r(new F("Request aborted",F.ECONNABORTED,e,m)),m=null)},m.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||da;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new F(_,k.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&S.forEach(o.toJSON(),function(_,k){m.setRequestHeader(k,_)}),S.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),a&&a!=="json"&&(m.responseType=s.responseType),l&&([f,p]=Lr(l,!0),m.addEventListener("progress",f)),c&&m.upload&&([d,h]=Lr(c),m.upload.addEventListener("progress",d),m.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=b=>{m&&(r(!b||b.type?new en(null,e,m):b),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const v=pp(s.url);if(v&&we.protocols.indexOf(v)===-1){r(new F("Unsupported protocol "+v+":",F.ERR_BAD_REQUEST,e));return}m.send(i||null)})},_p=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof F?u:new en(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new F(`timeout ${t} of ms exceeded`,F.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>S.asap(a),c}},vp=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Ep=async function*(e,t){for await(const n of Cp(e))yield*vp(n,t)},Cp=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},_a=(e,t,n,r)=>{const s=Ep(e,t);let i=0,o,a=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await s.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let f=i+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Nr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",va=Nr&&typeof ReadableStream=="function",xp=Nr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ea=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Tp=va&&Ea(()=>{let e=!1;const t=new Request(we.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ca=64*1024,Fs=va&&Ea(()=>S.isReadableStream(new Response("").body)),Mr={stream:Fs&&(e=>e.body)};Nr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Mr[t]&&(Mr[t]=S.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new F(`Response type '${t}' is not supported`,F.ERR_NOT_SUPPORT,r)})})})(new Response);const Ap=async e=>{if(e==null)return 0;if(S.isBlob(e))return e.size;if(S.isSpecCompliantForm(e))return(await new Request(we.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(S.isArrayBufferView(e)||S.isArrayBuffer(e))return e.byteLength;if(S.isURLSearchParams(e)&&(e=e+""),S.isString(e))return(await xp(e)).byteLength},Rp=async(e,t)=>{const n=S.toFiniteNumber(e.getContentLength());return n??Ap(t)},Bs={http:Yf,xhr:Sp,fetch:Nr&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Sa(e);l=l?(l+"").toLowerCase():"text";let h=_p([s,i&&i.toAbortSignal()],o),p;const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&Tp&&n!=="get"&&n!=="head"&&(m=await Rp(u,r))!==0){let k=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(S.isFormData(r)&&(x=k.headers.get("content-type"))&&u.setContentType(x),k.body){const[y,R]=ma(m,Lr(ya(c)));r=_a(k.body,Ca,y,R)}}S.isString(d)||(d=d?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:w?d:void 0});let v=await fetch(p);const b=Fs&&(l==="stream"||l==="response");if(Fs&&(a||b&&g)){const k={};["status","statusText","headers"].forEach(C=>{k[C]=v[C]});const x=S.toFiniteNumber(v.headers.get("content-length")),[y,R]=a&&ma(x,Lr(ya(a),!0))||[];v=new Response(_a(v.body,Ca,y,()=>{R&&R(),g&&g()}),k)}l=l||"text";let _=await Mr[S.findKey(Mr,l)||"text"](v,e);return!b&&g&&g(),await new Promise((k,x)=>{ga(k,x,{data:_,headers:ke.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:p})})}catch(w){throw g&&g(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,e,p),{cause:w.cause||w}):F.from(w,w&&w.code,e,p)}})};S.forEach(Bs,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xa=e=>`- ${e}`,Ip=e=>S.isFunction(e)||e===null||e===!1,Ta={getAdapter:e=>{e=S.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!Ip(n)&&(r=Bs[(o=String(n)).toLowerCase()],r===void 0))throw new F(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
11
11
|
`+i.map(xa).join(`
|
|
12
12
|
`):" "+xa(i[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Bs};function Us(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new en(null,e)}function Aa(e){return Us(e),e.headers=ke.from(e.headers),e.data=Ds.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ta.getAdapter(e.adapter||Vn.adapter)(e).then(function(r){return Us(e),r.data=Ds.call(e,e.transformResponse,r),r.headers=ke.from(r.headers),r},function(r){return ha(r)||(Us(e),r&&r.response&&(r.response.data=Ds.call(e,e.transformResponse,r.response),r.response.headers=ke.from(r.response.headers))),Promise.reject(r)})}const Ra="1.9.0",Dr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Dr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ia={};Dr.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Ra+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(t===!1)throw new F(s(o," has been removed"+(n?" in "+n:"")),F.ERR_DEPRECATED);return n&&!Ia[o]&&(Ia[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,a):!0}},Dr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function kp(e,t,n){if(typeof e!="object")throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const a=e[i],c=a===void 0||o(a,i,e);if(c!==!0)throw new F("option "+i+" must be "+c,F.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new F("Unknown option "+i,F.ERR_BAD_OPTION)}}const Fr={assertOptions:kp,validators:Dr},Qe=Fr.validators;let Pt=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ua,response:new ua}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
13
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ot(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Fr.assertOptions(r,{silentJSONParsing:Qe.transitional(Qe.boolean),forcedJSONParsing:Qe.transitional(Qe.boolean),clarifyTimeoutError:Qe.transitional(Qe.boolean)},!1),s!=null&&(S.isFunction(s)?n.paramsSerializer={serialize:s}:Fr.assertOptions(s,{encode:Qe.function,serialize:Qe.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fr.assertOptions(n,{baseUrl:Qe.spelling("baseURL"),withXsrfToken:Qe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&S.merge(i.common,i[n.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=ke.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let u,d=0,f;if(!c){const p=[Aa.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const p=a[d++],g=a[d++];try{h=p(h)}catch(m){g.call(this,m);break}}try{u=Aa.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Ot(this.defaults,t);const n=ba(t.baseURL,t.url,t.allowAbsoluteUrls);return la(n,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){Pt.prototype[t]=function(n,r){return this.request(Ot(r||{},{method:t,url:n,data:(r||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(Ot(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Pt.prototype[t]=n(),Pt.prototype[t+"Form"]=n(!0)});let Op=class kd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,a){r.reason||(r.reason=new en(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kd(function(s){t=s}),cancel:t}}};function Pp(e){return function(n){return e.apply(null,n)}}function Lp(e){return S.isObject(e)&&e.isAxiosError===!0}const $s={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($s).forEach(([e,t])=>{$s[t]=e});function ka(e){const t=new Pt(e),n=Go(Pt.prototype.request,t);return S.extend(n,Pt.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ka(Ot(e,s))},n}const se=ka(Vn);se.Axios=Pt,se.CanceledError=en,se.CancelToken=Op,se.isCancel=ha,se.VERSION=Ra,se.toFormData=Or,se.AxiosError=F,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=Pp,se.isAxiosError=Lp,se.mergeConfig=Ot,se.AxiosHeaders=ke,se.formToJSON=e=>fa(S.isHTMLForm(e)?new FormData(e):e),se.getAdapter=Ta.getAdapter,se.HttpStatusCode=$s,se.default=se;const{Axios:Dv,AxiosError:Fv,CanceledError:Bv,isCancel:Uv,CancelToken:$v,VERSION:Vv,all:zv,Cancel:Hv,isAxiosError:jv,spread:Wv,toFormData:qv,AxiosHeaders:Kv,HttpStatusCode:Gv,formToJSON:Yv,getAdapter:Jv,mergeConfig:Zv}=se,Hn=(e,t)=>e,Y=class Y{static getAxiosInstance(){if(!this.axiosInstance)throw new Error("AstroPay Payments Library: Not initialized.");return this.axiosInstance}};T(Y,"axiosInstance"),T(Y,"config"),T(Y,"init",t=>{Y.config=t,Y.axiosInstance=se.create({baseURL:t.baseURL,timeout:t.timeout??5e3,withCredentials:!0,headers:{"Accept-Language":te.getCurrent(),...t.headers}}),Y.setupInterceptors()}),T(Y,"GET",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().get(i,o)}),T(Y,"POST",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().post(i,n,o)}),T(Y,"PUT",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s}};return await Y.getAxiosInstance().put(i,n,o)}),T(Y,"PATCH",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().patch(i,n,o)}),T(Y,"DELETE",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().delete(i,o)}),T(Y,"setupInterceptors",()=>{Y.axiosInstance.interceptors.request.use(t=>{const{useQueryParams:n,...r}=t.params||{};return n?t.params={...r,data:Y.getEncodeParams()}:t.params=r,t.data&&(t.data=Ko(t.data,"camelCase-to-snake_case")),t}),Y.axiosInstance.interceptors.response.use(t=>Y.handleResponse(t),t=>Y.handleError(t))}),T(Y,"handleResponse",t=>{const n=t.status===202,r=Ko(t.data,"snake_case-to-camelCase");return n?{...r,statusCode:t.status}:r}),T(Y,"handleError",t=>{var r,s,i,o,a,c,l,u;const n={error:((s=(r=t.response)==null?void 0:r.data)==null?void 0:s.error)||"UNKNOWN_ERROR",internalTerm:((o=(i=t.response)==null?void 0:i.data)==null?void 0:o.internalTerm)||"",message:((c=(a=t.response)==null?void 0:a.data)==null?void 0:c.message)||te.translate("generic_error"),description:((u=(l=t.response)==null?void 0:l.data)==null?void 0:u.description)||"Network error"};return Promise.reject(n)}),T(Y,"getEncodeParams",()=>{const t={app_name:Y.config.appName,app_id:rt.getToken(),environment:Nn.getEnvironment(),platform:Wo(),version:"0.1.2"};return qo(t)});let mt=Y;const L={surface_dark:"#041311",surface_light:"#FFFFFF",neutral_lightest:"#FFFFFF",neutral_light:"#F3F6F6",neutral_lighter:"#E2E9E8",neutral_base:"#B4C5C3",neutral_darker:"#7C9995",neutral_dark:"#536663",neutral_darkest:"#151E1D",primary_lightest:"#DBFFFB",primary_light:"#AAF6EC",primary_base:"#00DBBF",primary_darker:"#0FC3AC",primary_dark:"#059986",primary_darkest:"#07544A",warning_light:"#FFEBA8",warning_darkest:"#755A00",error_lightest:"#FFDCD6",error_lighter:"#FF8470",error_base:"#FF2C0A",error_dark:"#A31600"},Br={matter:"Poppins"},Np=async()=>{try{const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap",e.rel="stylesheet",document.head.appendChild(e),await document.fonts.ready}catch(e){console.error("Font loading failed:",e)}},Mp={backgroundColor:L.surface_dark,primaryColor:L.primary_base,secondaryColor:L.primary_darkest,textPrimaryColor:L.neutral_lightest,textSecondaryColor:L.primary_lightest,fontFamily:Br.matter,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",apFontFamily:Br.matter,apWarningBgColor:L.warning_darkest,apWarningTxtColor:L.error_lightest,apPillBgColor:L.primary_darkest,apPillTxtColor:L.primary_light,apPillDisableBgColor:L.neutral_dark,apPillDisableTxtColor:L.neutral_light,apPrimaryColor:L.primary_base,apButtonPrimaryBgColor:L.primary_base,apButtonPrimaryTxtColor:L.neutral_darkest,apButtonSecondaryBgColor:L.primary_darkest,apButtonSecondaryTxtColor:L.primary_base,apButtonTextTxtColor:L.primary_base,apButtonDisableBgColor:L.neutral_base,apButtonDisableTextColor:L.neutral_dark,apInputBgColor:L.neutral_darkest,apInputTxtColor:L.neutral_lightest,apInputPlaceholderColor:L.neutral_darker,apInputBorderActiveColor:L.primary_base,apInputBorderErrorColor:L.error_base,apSelectBgHoverColor:L.neutral_dark,apSelectBorderColor:L.neutral_base,apErrorText:L.error_lighter,apSuccessText:L.primary_base},Oa={backgroundColor:L.surface_light,primaryColor:L.primary_base,secondaryColor:L.primary_lightest,textPrimaryColor:L.neutral_darkest,textSecondaryColor:L.primary_darker,fontFamily:Br.matter,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",apFontFamily:Br.matter,apWarningBgColor:L.warning_light,apWarningTxtColor:L.error_dark,apPillBgColor:L.primary_lightest,apPillTxtColor:L.primary_dark,apPillDisableBgColor:L.neutral_light,apPillDisableTxtColor:L.neutral_dark,apPrimaryColor:L.primary_base,apButtonPrimaryBgColor:L.primary_base,apButtonPrimaryTxtColor:L.neutral_darkest,apButtonSecondaryBgColor:L.primary_lightest,apButtonSecondaryTxtColor:L.primary_dark,apButtonTextTxtColor:L.primary_dark,apButtonDisableBgColor:L.neutral_base,apButtonDisableTextColor:L.neutral_dark,apInputBgColor:L.neutral_light,apInputTxtColor:L.neutral_darkest,apInputPlaceholderColor:L.neutral_dark,apInputBorderActiveColor:L.primary_base,apInputBorderErrorColor:L.error_dark,apSelectBgHoverColor:L.neutral_lighter,apSelectBorderColor:L.neutral_base,apErrorText:L.error_dark,apSuccessText:L.primary_darker},Dp={light:Oa,dark:Mp},Rt=class Rt{static init(t){const n=yr(t==null?void 0:t.theme,Yt,"light");Rt.currentTheme=n,Rt.styles={...Dp[n],...t==null?void 0:t.styles}}static getStyles(){return Rt.styles}static getTheme(){return Rt.currentTheme}};T(Rt,"currentTheme","light"),T(Rt,"styles",Oa);let $=Rt;const Ur={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},ut=console,tn={};Object.keys(Ur).forEach(e=>{tn[e]=ut[e]});const jn="Datadog Browser SDK:",V={debug:tn.debug.bind(ut,jn),log:tn.log.bind(ut,jn),info:tn.info.bind(ut,jn),warn:tn.warn.bind(ut,jn),error:tn.error.bind(ut,jn)},$r="https://docs.datadoghq.com",Fp=`${$r}/real_user_monitoring/browser/troubleshooting`,Vs="More details:";function Pa(e,t){return(...n)=>{try{return e(...n)}catch(r){V.error(t,r)}}}function yt(e){return e!==0&&Math.random()*100<=e}function Vr(e,t){return+e.toFixed(t)}function Bp(e){return Wn(e)&&e>=0&&e<=100}function Wn(e){return typeof e=="number"}const Se=1e3,Oe=60*Se,La=60*Oe,Na=365*(24*La);function zr(e){return{relative:e,timeStamp:$p(e)}}function Up(e){return{relative:zs(e),timeStamp:e}}function $p(e){const t=Ve()-performance.now();return t>qn()?Math.round(nn(t,e)):zp(e)}function Vp(){return Math.round(Ve()-nn(qn(),performance.now()))}function B(e){return Wn(e)?Vr(e*1e6,0):e}function Ve(){return new Date().getTime()}function de(){return Ve()}function ze(){return performance.now()}function xe(){return{relative:ze(),timeStamp:de()}}function Ma(){return{relative:0,timeStamp:qn()}}function me(e,t){return t-e}function nn(e,t){return e+t}function zs(e){return e-qn()}function zp(e){return Math.round(nn(qn(),e))}function Hp(e){return e<Na}let Hs;function qn(){return Hs===void 0&&(Hs=performance.timing.navigationStart),Hs}const Kn=1024,Da=1024*Kn,jp=/[^\u0000-\u007F]/;function Fa(e){return jp.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function Wp(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Gn(e){return{...e}}function Hr(e,t){return Object.keys(e).some(n=>e[n]===t)}function Lt(e){return Object.keys(e).length===0}function qp(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function et(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}function bt(e,t){const n=et();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let js,Ba=!1;function Kp(e){js=e}function Gp(e){Ba=e}function U(e){return function(){return Nt(e,this,arguments)}}function Nt(e,t,n){try{return e.apply(t,n)}catch(r){dt(r)}}function dt(e){if(Ws(e),js)try{js(e)}catch(t){Ws(t)}}function Ws(...e){Ba&&V.error("[MONITOR]",...e)}function fe(e,t){return bt(et(),"setTimeout")(U(e),t)}function Pe(e){bt(et(),"clearTimeout")(e)}function rn(e,t){return bt(et(),"setInterval")(U(e),t)}function jr(e){bt(et(),"clearInterval")(e)}class G{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach(n=>n(t))}}function Ua(...e){return new G(t=>{const n=e.map(r=>r.subscribe(s=>t.notify(s)));return()=>n.forEach(r=>r.unsubscribe())})}function wt(e,t,n){const r=n&&n.leading!==void 0?n.leading:!0,s=n&&n.trailing!==void 0?n.trailing:!0;let i=!1,o,a;return{throttled:(...c)=>{if(i){o=c;return}r?e(...c):o=c,i=!0,a=fe(()=>{s&&o&&e(...o),i=!1,o=void 0},t)},cancel:()=>{Pe(a),i=!1,o=void 0}}}function z(){}function ye(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,ye)}const Wr=/([\w-]+)\s*=\s*([^;]+)/g;function Yn(e,t){for(Wr.lastIndex=0;;){const n=Wr.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function Yp(e){const t=new Map;for(Wr.lastIndex=0;;){const n=Wr.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function $a(e,t,n=""){const r=e.charCodeAt(t-1),i=r>=55296&&r<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${n}`}function Jp(){return Va()===0}function Zp(){return Va()===1}let qr;function Va(){return qr??(qr=Xp())}function Xp(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function Jn(e,t,n=0,r){const s=new Date;s.setTime(s.getTime()+n);const i=`expires=${s.toUTCString()}`,o=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",l=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${o}${a}${c}${l}`}function qs(e){return Yn(document.cookie,e)}let Ks;function St(e){return Ks||(Ks=Yp(document.cookie)),Ks.get(e)}function za(e,t){Jn(e,"",0,t)}function Qp(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${ye()}`,n="test";Jn(t,n,Oe,e);const r=qs(t)===n;return za(t,e),r}catch(t){return V.error(t),!1}}let Gs;function eh(){if(Gs===void 0){const e=`dd_site_test_${ye()}`,t="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!qs(e);)r=`${n.pop()}.${r}`,Jn(e,t,Se,{domain:r});za(e,{domain:r}),Gs=r}return Gs}const sn="_dd_s";function th(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function Ha(e){return Object.values(e)}function Ys(e){return Object.entries(e)}const Mt=4*La,ja=15*Oe,nh=Na,Zn={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},Wa=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Js="&";function rh(e){return!!e&&(e.indexOf(Js)!==-1||Wa.test(e))}const sh="1";function Dt(e,t){const n={isExpired:sh};return t.trackAnonymousUser&&(e!=null&&e.anonymousId?n.anonymousId=e==null?void 0:e.anonymousId:n.anonymousId=ye()),n}function Kr(e){return Lt(e)}function qa(e){return!Kr(e)}function Gr(e){return e.isExpired!==void 0||!ih(e)}function ih(e){return(e.created===void 0||Ve()-Number(e.created)<Mt)&&(e.expire===void 0||Ve()<Number(e.expire))}function Ka(e){e.expire=String(Ve()+ja)}function Zs(e){return Ys(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(Js)}function Ga(e){const t={};return rh(e)&&e.split(Js).forEach(n=>{const r=Wa.exec(n);if(r!==null){const[,s,i]=r;s==="aid"?t.anonymousId=i:t[s]=i}}),t}const oh="_dd",ah="_dd_r",ch="_dd_l",lh="rum",uh="logs";function dh(e){if(!St(sn)){const n=St(oh),r=St(ah),s=St(ch),i={};n&&(i.id=n),s&&/^[01]$/.test(s)&&(i[uh]=s),r&&/^[012]$/.test(r)&&(i[lh]=r),qa(i)&&(Ka(i),e.persistSession(i))}}function Ya(e){const t=mh(e);return Qp(t)?{type:Zn.COOKIE,cookieOptions:t}:void 0}function fh(e,t){const n={isLockEnabled:Jp(),persistSession:ph(t),retrieveSession:gh,expireSession:r=>hh(t,r,e)};return dh(n),n}function ph(e){return t=>{Jn(sn,Zs(t),ja,e)}}function hh(e,t,n){const r=Dt(t,n);Jn(sn,Zs(r),n.trackAnonymousUser?nh:Mt,e)}function gh(){const e=qs(sn);return Ga(e)}function mh(e){const t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=eh()),t}const yh="_dd_test_";function Ja(){try{const e=ye(),t=`${yh}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Zn.LOCAL_STORAGE}:void 0}catch{return}}function bh(e){return{isLockEnabled:!1,persistSession:Za,retrieveSession:wh,expireSession:t=>Sh(t,e)}}function Za(e){localStorage.setItem(sn,Zs(e))}function wh(){const e=localStorage.getItem(sn);return Ga(e)}function Sh(e,t){Za(Dt(e,t))}const _h=10,vh=100,Xa=[];let Yr;function Ft(e,t,n=0){var r;const{isLockEnabled:s,persistSession:i,expireSession:o}=t,a=f=>i({...f,lock:l}),c=()=>{const f=t.retrieveSession(),h=f.lock;return f.lock&&delete f.lock,{session:f,lock:h}};if(Yr||(Yr=e),e!==Yr){Xa.push(e);return}if(s&&n>=vh){Qa(t);return}let l,u=c();if(s){if(u.lock){Jr(e,t,n);return}if(l=ye(),a(u.session),u=c(),u.lock!==l){Jr(e,t,n);return}}let d=e.process(u.session);if(s&&(u=c(),u.lock!==l)){Jr(e,t,n);return}if(d&&(Gr(d)?o(d):(Ka(d),s?a(d):i(d))),s&&!(d&&Gr(d))){if(u=c(),u.lock!==l){Jr(e,t,n);return}i(u.session),d=u.session}(r=e.after)===null||r===void 0||r.call(e,d||u.session),Qa(t)}function Jr(e,t,n){fe(()=>{Ft(e,t,n+1)},_h)}function Qa(e){Yr=void 0;const t=Xa.shift();t&&Ft(t,e)}const ec=Se;function Eh(e){switch(e.sessionPersistence){case Zn.COOKIE:return Ya(e);case Zn.LOCAL_STORAGE:return Ja();case void 0:{let t=Ya(e);return!t&&e.allowFallbackToLocalStorage&&(t=Ja()),t}default:V.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Ch(e,t,n,r){const s=new G,i=new G,o=new G,a=e.type===Zn.COOKIE?fh(t,e.cookieOptions):bh(t),{expireSession:c}=a,l=rn(p,ec);let u;m();const{throttled:d,cancel:f}=wt(()=>{Ft({process:y=>{if(Kr(y))return;const R=g(y);return w(R),R},after:y=>{qa(y)&&!v()&&k(y),u=y}},a)},ec);function h(){Ft({process:y=>v()?g(y):void 0},a)}function p(){Ft({process:y=>Gr(y)?Dt(y,t):void 0,after:g},a)}function g(y){return Gr(y)&&(y=Dt(y,t)),v()&&(b(y)?_():(o.notify({previousState:u,newState:y}),u=y)),y}function m(){Ft({process:y=>{if(Kr(y))return Dt(y,t)},after:y=>{u=y}},a)}function w(y){if(Kr(y))return!1;const{trackingType:R,isTracked:C}=r(y[n]);y[n]=R,delete y.isExpired,C&&!y.id&&(y.id=ye(),y.created=String(Ve()))}function v(){return u[n]!==void 0}function b(y){return u.id!==y.id||u[n]!==y[n]}function _(){u=Dt(u,t),i.notify()}function k(y){u=y,s.notify()}function x(y){Ft({process:R=>({...R,...y}),after:g},a)}return{expandOrRenewSession:d,expandSession:h,getSession:()=>u,renewObservable:s,expireObservable:i,sessionStateUpdateObservable:o,restartSession:m,expire:()=>{f(),c(u),g(Dt(u,t))},stop:()=>{jr(l)},updateSessionState:x}}const Xs={GRANTED:"granted",NOT_GRANTED:"not-granted"};function xh(e){const t=new G;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===Xs.GRANTED},observable:t}}function on(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=an(Object.prototype),s=an(Array.prototype),i=an(Object.getPrototypeOf(e)),o=an(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),s(),i(),o()}}function an(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):z}function Qs(e){return Zr(e,location.href).href}function Th(e){try{return!!Zr(e)}catch{return!1}}function Ah(e){const t=Zr(e).pathname;return t[0]==="/"?t:`/${t}`}function Zr(e,t){const n=Rh();if(n)try{return t!==void 0?new n(e,t):new n(e)}catch(i){throw new Error(`Failed to construct URL: ${String(i)} ${on({url:e,base:t})}`)}if(t===void 0&&!/:/.test(e))throw new Error(`Invalid URL: '${e}'`);let r=document;const s=r.createElement("a");if(t!==void 0){r=document.implementation.createHTMLDocument("");const i=r.createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(s)}return s.href=e,s}const tc=URL;let Xr;function Rh(){if(Xr===void 0)try{Xr=new tc("http://test/path").href==="http://test/path"}catch{Xr=!1}return Xr?tc:void 0}const nc="datad0g.com",Ih="dd0g-gov.com",Bt="datadoghq.com",kh="datadoghq.eu",Oh="ddog-gov.com",Ph="pci.browser-intake-datadoghq.com",Lh=["ddsource","ddtags"];function cn(e,t,n){const r=Nh(e,t);return{build(s,i){const o=Mh(e,t,n,s,i);return r(o)},tags:n,urlPrefix:r(""),trackType:t}}function Nh(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const i=Qs(r);return o=>`${i}?ddforward=${encodeURIComponent(`${n}?${o}`)}`}if(typeof r=="function")return i=>r({path:n,parameters:i});const s=rc(t,e);return i=>`https://${s}${n}?${i}`}function rc(e,t){const{site:n=Bt,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===Bt)return Ph;if(r&&n===Bt)return`${r}.${Bt}`;if(n===Ih)return`http-intake.logs.${n}`;const s=n.split("."),i=s.pop();return`browser-intake-${s.join("-")}.${i}`}function Mh({clientToken:e,internalAnalyticsSubdomain:t},n,r,s,{retry:i,encoding:o}){const a=["sdk_version:6.6.3",`api:${s}`].concat(r);i&&a.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const c=["ddsource=browser",`ddtags=${encodeURIComponent(a.join(","))}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.6.3")}`,"dd-evp-origin=browser",`dd-request-id=${ye()}`];return o&&c.push(`dd-evp-encoding=${o}`),n==="rum"&&c.push(`batch_time=${de()}`),t&&c.reverse(),c.join("&")}const Dh=200;function Fh(e){const{env:t,service:n,version:r,datacenter:s}=e,i=[];return t&&i.push(Qr("env",t)),n&&i.push(Qr("service",n)),r&&i.push(Qr("version",r)),s&&i.push(Qr("datacenter",s)),i}function Qr(e,t){const n=Dh-e.length-1;(t.length>n||Bh(t))&&V.warn(`${e} value doesn't meet tag requirements and will be sanitized. ${Vs} ${$r}/getting_started/tagging/#defining-tags`);const r=t.replace(/,/g,"_");return`${e}:${r}`}function Bh(e){return Uh()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function Uh(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function $h(e){const t=e.site||Bt,n=Fh(e),r=Vh(e,n);return{replica:zh(e,n),site:t,...r}}function Vh(e,t){return{logsEndpointBuilder:cn(e,"logs",t),rumEndpointBuilder:cn(e,"rum",t),profilingEndpointBuilder:cn(e,"profile",t),sessionReplayEndpointBuilder:cn(e,"replay",t)}}function zh(e,t){if(!e.replica)return;const n={...e,site:Bt,clientToken:e.replica.clientToken},r={logsEndpointBuilder:cn(n,"logs",t),rumEndpointBuilder:cn(n,"rum",t)};return{applicationId:e.replica.applicationId,...r}}function Hh(e){return Lh.every(t=>e.includes(t))}const Xn={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ei={ALL:"all",SAMPLED:"sampled"};function ti(e,t){return e!=null&&typeof e!="string"?(V.error(`${t} must be defined as a string`),!1):!0}function jh(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(V.error(`Site should be a valid Datadog site. ${Vs} ${$r}/getting_started/site/.`),!1):!0}function ln(e,t){return e!==void 0&&!Bp(e)?(V.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function Wh(e){var t,n,r,s,i,o;if(!e||!e.clientToken){V.error("Client Token is not configured, we will not send any data.");return}if(!(!jh(e.site)||!ln(e.sessionSampleRate,"Session")||!ln(e.telemetrySampleRate,"Telemetry")||!ln(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!ln(e.telemetryUsageSampleRate,"Telemetry Usage")||!ti(e.version,"Version")||!ti(e.env,"Env")||!ti(e.service,"Service"))){if(e.trackingConsent!==void 0&&!Hr(Xs,e.trackingConsent)){V.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&Pa(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Eh(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(r=e.telemetryConfigurationSampleRate)!==null&&r!==void 0?r:5,telemetryUsageSampleRate:(s=e.telemetryUsageSampleRate)!==null&&s!==void 0?s:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(i=e.trackingConsent)!==null&&i!==void 0?i:Xs.GRANTED,trackAnonymousUser:(o=e.trackAnonymousUser)!==null&&o!==void 0?o:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*Kn,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Se,batchMessagesLimit:50,messageBytesLimit:256*Kn,...$h(e)}}}function qh(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent}}var Ut;(function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.MISSING_URL_CONTEXT_TELEMETRY="missing_url_context_telemetry",e.USER_ACCOUNT_TRACE_HEADER="user_account_trace_header",e.PROFILING="profiling"})(Ut||(Ut={}));const ni=new Set;function Kh(e){Array.isArray(e)&&Gh(e.filter(t=>Hr(Ut,t)))}function Gh(e){e.forEach(t=>{ni.add(t)})}function es(e){return ni.has(e)}function Yh(){return ni}const Qn="?";function _t(e){const t=[];let n=ri(e,"stack");const r=String(e);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split(`
|
|
13
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ot(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Fr.assertOptions(r,{silentJSONParsing:Qe.transitional(Qe.boolean),forcedJSONParsing:Qe.transitional(Qe.boolean),clarifyTimeoutError:Qe.transitional(Qe.boolean)},!1),s!=null&&(S.isFunction(s)?n.paramsSerializer={serialize:s}:Fr.assertOptions(s,{encode:Qe.function,serialize:Qe.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fr.assertOptions(n,{baseUrl:Qe.spelling("baseURL"),withXsrfToken:Qe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&S.merge(i.common,i[n.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=ke.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let u,d=0,f;if(!c){const p=[Aa.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const p=a[d++],g=a[d++];try{h=p(h)}catch(m){g.call(this,m);break}}try{u=Aa.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Ot(this.defaults,t);const n=ba(t.baseURL,t.url,t.allowAbsoluteUrls);return la(n,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){Pt.prototype[t]=function(n,r){return this.request(Ot(r||{},{method:t,url:n,data:(r||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(Ot(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Pt.prototype[t]=n(),Pt.prototype[t+"Form"]=n(!0)});let Op=class kd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,a){r.reason||(r.reason=new en(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kd(function(s){t=s}),cancel:t}}};function Pp(e){return function(n){return e.apply(null,n)}}function Lp(e){return S.isObject(e)&&e.isAxiosError===!0}const $s={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($s).forEach(([e,t])=>{$s[t]=e});function ka(e){const t=new Pt(e),n=Go(Pt.prototype.request,t);return S.extend(n,Pt.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ka(Ot(e,s))},n}const se=ka(Vn);se.Axios=Pt,se.CanceledError=en,se.CancelToken=Op,se.isCancel=ha,se.VERSION=Ra,se.toFormData=Or,se.AxiosError=F,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=Pp,se.isAxiosError=Lp,se.mergeConfig=Ot,se.AxiosHeaders=ke,se.formToJSON=e=>fa(S.isHTMLForm(e)?new FormData(e):e),se.getAdapter=Ta.getAdapter,se.HttpStatusCode=$s,se.default=se;const{Axios:Dv,AxiosError:Fv,CanceledError:Bv,isCancel:Uv,CancelToken:$v,VERSION:Vv,all:zv,Cancel:Hv,isAxiosError:jv,spread:Wv,toFormData:qv,AxiosHeaders:Kv,HttpStatusCode:Gv,formToJSON:Yv,getAdapter:Jv,mergeConfig:Zv}=se,Hn=(e,t)=>e,Y=class Y{static getAxiosInstance(){if(!this.axiosInstance)throw new Error("AstroPay Payments Library: Not initialized.");return this.axiosInstance}};T(Y,"axiosInstance"),T(Y,"config"),T(Y,"init",t=>{Y.config=t,Y.axiosInstance=se.create({baseURL:t.baseURL,timeout:t.timeout??5e3,withCredentials:!0,headers:{"Accept-Language":te.getCurrent(),...t.headers}}),Y.setupInterceptors()}),T(Y,"GET",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().get(i,o)}),T(Y,"POST",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().post(i,n,o)}),T(Y,"PUT",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s}};return await Y.getAxiosInstance().put(i,n,o)}),T(Y,"PATCH",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().patch(i,n,o)}),T(Y,"DELETE",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().delete(i,o)}),T(Y,"setupInterceptors",()=>{Y.axiosInstance.interceptors.request.use(t=>{const{useQueryParams:n,...r}=t.params||{};return n?t.params={...r,data:Y.getEncodeParams()}:t.params=r,t.data&&(t.data=Ko(t.data,"camelCase-to-snake_case")),t}),Y.axiosInstance.interceptors.response.use(t=>Y.handleResponse(t),t=>Y.handleError(t))}),T(Y,"handleResponse",t=>{const n=t.status===202,r=Ko(t.data,"snake_case-to-camelCase");return n?{...r,statusCode:t.status}:r}),T(Y,"handleError",t=>{var r,s,i,o,a,c,l,u;const n={error:((s=(r=t.response)==null?void 0:r.data)==null?void 0:s.error)||"UNKNOWN_ERROR",internalTerm:(o=(i=t.response)==null?void 0:i.data)==null?void 0:o.internalTerm,message:((c=(a=t.response)==null?void 0:a.data)==null?void 0:c.message)||te.translate("generic_error"),description:(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.description};return Promise.reject(n)}),T(Y,"getEncodeParams",()=>{const t={app_name:Y.config.appName,app_id:rt.getToken(),environment:Nn.getEnvironment(),platform:Wo(),version:"0.1.3"};return qo(t)});let mt=Y;const L={surface_dark:"#041311",surface_light:"#FFFFFF",neutral_lightest:"#FFFFFF",neutral_light:"#F3F6F6",neutral_lighter:"#E2E9E8",neutral_base:"#B4C5C3",neutral_darker:"#7C9995",neutral_dark:"#536663",neutral_darkest:"#151E1D",primary_lightest:"#DBFFFB",primary_light:"#AAF6EC",primary_base:"#00DBBF",primary_darker:"#0FC3AC",primary_dark:"#059986",primary_darkest:"#07544A",warning_light:"#FFEBA8",warning_darkest:"#755A00",error_lightest:"#FFDCD6",error_lighter:"#FF8470",error_base:"#FF2C0A",error_dark:"#A31600"},Br={matter:"Poppins"},Np=async()=>{try{const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap",e.rel="stylesheet",document.head.appendChild(e),await document.fonts.ready}catch(e){console.error("Font loading failed:",e)}},Mp={backgroundColor:L.surface_dark,primaryColor:L.primary_base,secondaryColor:L.primary_darkest,textPrimaryColor:L.neutral_lightest,textSecondaryColor:L.primary_lightest,fontFamily:Br.matter,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",apFontFamily:Br.matter,apWarningBgColor:L.warning_darkest,apWarningTxtColor:L.error_lightest,apPillBgColor:L.primary_darkest,apPillTxtColor:L.primary_light,apPillDisableBgColor:L.neutral_dark,apPillDisableTxtColor:L.neutral_light,apPrimaryColor:L.primary_base,apButtonPrimaryBgColor:L.primary_base,apButtonPrimaryTxtColor:L.neutral_darkest,apButtonSecondaryBgColor:L.primary_darkest,apButtonSecondaryTxtColor:L.primary_base,apButtonTextTxtColor:L.primary_base,apButtonDisableBgColor:L.neutral_base,apButtonDisableTextColor:L.neutral_dark,apInputBgColor:L.neutral_darkest,apInputTxtColor:L.neutral_lightest,apInputPlaceholderColor:L.neutral_darker,apInputBorderActiveColor:L.primary_base,apInputBorderErrorColor:L.error_base,apSelectBgHoverColor:L.neutral_dark,apSelectBorderColor:L.neutral_base,apErrorText:L.error_lighter,apSuccessText:L.primary_base},Oa={backgroundColor:L.surface_light,primaryColor:L.primary_base,secondaryColor:L.primary_lightest,textPrimaryColor:L.neutral_darkest,textSecondaryColor:L.primary_darker,fontFamily:Br.matter,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",apFontFamily:Br.matter,apWarningBgColor:L.warning_light,apWarningTxtColor:L.error_dark,apPillBgColor:L.primary_lightest,apPillTxtColor:L.primary_dark,apPillDisableBgColor:L.neutral_light,apPillDisableTxtColor:L.neutral_dark,apPrimaryColor:L.primary_base,apButtonPrimaryBgColor:L.primary_base,apButtonPrimaryTxtColor:L.neutral_darkest,apButtonSecondaryBgColor:L.primary_lightest,apButtonSecondaryTxtColor:L.primary_dark,apButtonTextTxtColor:L.primary_dark,apButtonDisableBgColor:L.neutral_base,apButtonDisableTextColor:L.neutral_dark,apInputBgColor:L.neutral_light,apInputTxtColor:L.neutral_darkest,apInputPlaceholderColor:L.neutral_dark,apInputBorderActiveColor:L.primary_base,apInputBorderErrorColor:L.error_dark,apSelectBgHoverColor:L.neutral_lighter,apSelectBorderColor:L.neutral_base,apErrorText:L.error_dark,apSuccessText:L.primary_darker},Dp={light:Oa,dark:Mp},Rt=class Rt{static init(t){const n=yr(t==null?void 0:t.theme,Yt,"light");Rt.currentTheme=n,Rt.styles={...Dp[n],...t==null?void 0:t.styles}}static getStyles(){return Rt.styles}static getTheme(){return Rt.currentTheme}};T(Rt,"currentTheme","light"),T(Rt,"styles",Oa);let $=Rt;const Ur={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},ut=console,tn={};Object.keys(Ur).forEach(e=>{tn[e]=ut[e]});const jn="Datadog Browser SDK:",V={debug:tn.debug.bind(ut,jn),log:tn.log.bind(ut,jn),info:tn.info.bind(ut,jn),warn:tn.warn.bind(ut,jn),error:tn.error.bind(ut,jn)},$r="https://docs.datadoghq.com",Fp=`${$r}/real_user_monitoring/browser/troubleshooting`,Vs="More details:";function Pa(e,t){return(...n)=>{try{return e(...n)}catch(r){V.error(t,r)}}}function yt(e){return e!==0&&Math.random()*100<=e}function Vr(e,t){return+e.toFixed(t)}function Bp(e){return Wn(e)&&e>=0&&e<=100}function Wn(e){return typeof e=="number"}const Se=1e3,Oe=60*Se,La=60*Oe,Na=365*(24*La);function zr(e){return{relative:e,timeStamp:$p(e)}}function Up(e){return{relative:zs(e),timeStamp:e}}function $p(e){const t=Ve()-performance.now();return t>qn()?Math.round(nn(t,e)):zp(e)}function Vp(){return Math.round(Ve()-nn(qn(),performance.now()))}function B(e){return Wn(e)?Vr(e*1e6,0):e}function Ve(){return new Date().getTime()}function de(){return Ve()}function ze(){return performance.now()}function xe(){return{relative:ze(),timeStamp:de()}}function Ma(){return{relative:0,timeStamp:qn()}}function me(e,t){return t-e}function nn(e,t){return e+t}function zs(e){return e-qn()}function zp(e){return Math.round(nn(qn(),e))}function Hp(e){return e<Na}let Hs;function qn(){return Hs===void 0&&(Hs=performance.timing.navigationStart),Hs}const Kn=1024,Da=1024*Kn,jp=/[^\u0000-\u007F]/;function Fa(e){return jp.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function Wp(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Gn(e){return{...e}}function Hr(e,t){return Object.keys(e).some(n=>e[n]===t)}function Lt(e){return Object.keys(e).length===0}function qp(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function et(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}function bt(e,t){const n=et();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let js,Ba=!1;function Kp(e){js=e}function Gp(e){Ba=e}function U(e){return function(){return Nt(e,this,arguments)}}function Nt(e,t,n){try{return e.apply(t,n)}catch(r){dt(r)}}function dt(e){if(Ws(e),js)try{js(e)}catch(t){Ws(t)}}function Ws(...e){Ba&&V.error("[MONITOR]",...e)}function fe(e,t){return bt(et(),"setTimeout")(U(e),t)}function Pe(e){bt(et(),"clearTimeout")(e)}function rn(e,t){return bt(et(),"setInterval")(U(e),t)}function jr(e){bt(et(),"clearInterval")(e)}class G{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach(n=>n(t))}}function Ua(...e){return new G(t=>{const n=e.map(r=>r.subscribe(s=>t.notify(s)));return()=>n.forEach(r=>r.unsubscribe())})}function wt(e,t,n){const r=n&&n.leading!==void 0?n.leading:!0,s=n&&n.trailing!==void 0?n.trailing:!0;let i=!1,o,a;return{throttled:(...c)=>{if(i){o=c;return}r?e(...c):o=c,i=!0,a=fe(()=>{s&&o&&e(...o),i=!1,o=void 0},t)},cancel:()=>{Pe(a),i=!1,o=void 0}}}function z(){}function ye(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,ye)}const Wr=/([\w-]+)\s*=\s*([^;]+)/g;function Yn(e,t){for(Wr.lastIndex=0;;){const n=Wr.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function Yp(e){const t=new Map;for(Wr.lastIndex=0;;){const n=Wr.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function $a(e,t,n=""){const r=e.charCodeAt(t-1),i=r>=55296&&r<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${n}`}function Jp(){return Va()===0}function Zp(){return Va()===1}let qr;function Va(){return qr??(qr=Xp())}function Xp(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function Jn(e,t,n=0,r){const s=new Date;s.setTime(s.getTime()+n);const i=`expires=${s.toUTCString()}`,o=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",l=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${o}${a}${c}${l}`}function qs(e){return Yn(document.cookie,e)}let Ks;function St(e){return Ks||(Ks=Yp(document.cookie)),Ks.get(e)}function za(e,t){Jn(e,"",0,t)}function Qp(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${ye()}`,n="test";Jn(t,n,Oe,e);const r=qs(t)===n;return za(t,e),r}catch(t){return V.error(t),!1}}let Gs;function eh(){if(Gs===void 0){const e=`dd_site_test_${ye()}`,t="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!qs(e);)r=`${n.pop()}.${r}`,Jn(e,t,Se,{domain:r});za(e,{domain:r}),Gs=r}return Gs}const sn="_dd_s";function th(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function Ha(e){return Object.values(e)}function Ys(e){return Object.entries(e)}const Mt=4*La,ja=15*Oe,nh=Na,Zn={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},Wa=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Js="&";function rh(e){return!!e&&(e.indexOf(Js)!==-1||Wa.test(e))}const sh="1";function Dt(e,t){const n={isExpired:sh};return t.trackAnonymousUser&&(e!=null&&e.anonymousId?n.anonymousId=e==null?void 0:e.anonymousId:n.anonymousId=ye()),n}function Kr(e){return Lt(e)}function qa(e){return!Kr(e)}function Gr(e){return e.isExpired!==void 0||!ih(e)}function ih(e){return(e.created===void 0||Ve()-Number(e.created)<Mt)&&(e.expire===void 0||Ve()<Number(e.expire))}function Ka(e){e.expire=String(Ve()+ja)}function Zs(e){return Ys(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(Js)}function Ga(e){const t={};return rh(e)&&e.split(Js).forEach(n=>{const r=Wa.exec(n);if(r!==null){const[,s,i]=r;s==="aid"?t.anonymousId=i:t[s]=i}}),t}const oh="_dd",ah="_dd_r",ch="_dd_l",lh="rum",uh="logs";function dh(e){if(!St(sn)){const n=St(oh),r=St(ah),s=St(ch),i={};n&&(i.id=n),s&&/^[01]$/.test(s)&&(i[uh]=s),r&&/^[012]$/.test(r)&&(i[lh]=r),qa(i)&&(Ka(i),e.persistSession(i))}}function Ya(e){const t=mh(e);return Qp(t)?{type:Zn.COOKIE,cookieOptions:t}:void 0}function fh(e,t){const n={isLockEnabled:Jp(),persistSession:ph(t),retrieveSession:gh,expireSession:r=>hh(t,r,e)};return dh(n),n}function ph(e){return t=>{Jn(sn,Zs(t),ja,e)}}function hh(e,t,n){const r=Dt(t,n);Jn(sn,Zs(r),n.trackAnonymousUser?nh:Mt,e)}function gh(){const e=qs(sn);return Ga(e)}function mh(e){const t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=eh()),t}const yh="_dd_test_";function Ja(){try{const e=ye(),t=`${yh}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Zn.LOCAL_STORAGE}:void 0}catch{return}}function bh(e){return{isLockEnabled:!1,persistSession:Za,retrieveSession:wh,expireSession:t=>Sh(t,e)}}function Za(e){localStorage.setItem(sn,Zs(e))}function wh(){const e=localStorage.getItem(sn);return Ga(e)}function Sh(e,t){Za(Dt(e,t))}const _h=10,vh=100,Xa=[];let Yr;function Ft(e,t,n=0){var r;const{isLockEnabled:s,persistSession:i,expireSession:o}=t,a=f=>i({...f,lock:l}),c=()=>{const f=t.retrieveSession(),h=f.lock;return f.lock&&delete f.lock,{session:f,lock:h}};if(Yr||(Yr=e),e!==Yr){Xa.push(e);return}if(s&&n>=vh){Qa(t);return}let l,u=c();if(s){if(u.lock){Jr(e,t,n);return}if(l=ye(),a(u.session),u=c(),u.lock!==l){Jr(e,t,n);return}}let d=e.process(u.session);if(s&&(u=c(),u.lock!==l)){Jr(e,t,n);return}if(d&&(Gr(d)?o(d):(Ka(d),s?a(d):i(d))),s&&!(d&&Gr(d))){if(u=c(),u.lock!==l){Jr(e,t,n);return}i(u.session),d=u.session}(r=e.after)===null||r===void 0||r.call(e,d||u.session),Qa(t)}function Jr(e,t,n){fe(()=>{Ft(e,t,n+1)},_h)}function Qa(e){Yr=void 0;const t=Xa.shift();t&&Ft(t,e)}const ec=Se;function Eh(e){switch(e.sessionPersistence){case Zn.COOKIE:return Ya(e);case Zn.LOCAL_STORAGE:return Ja();case void 0:{let t=Ya(e);return!t&&e.allowFallbackToLocalStorage&&(t=Ja()),t}default:V.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Ch(e,t,n,r){const s=new G,i=new G,o=new G,a=e.type===Zn.COOKIE?fh(t,e.cookieOptions):bh(t),{expireSession:c}=a,l=rn(p,ec);let u;m();const{throttled:d,cancel:f}=wt(()=>{Ft({process:y=>{if(Kr(y))return;const R=g(y);return w(R),R},after:y=>{qa(y)&&!v()&&k(y),u=y}},a)},ec);function h(){Ft({process:y=>v()?g(y):void 0},a)}function p(){Ft({process:y=>Gr(y)?Dt(y,t):void 0,after:g},a)}function g(y){return Gr(y)&&(y=Dt(y,t)),v()&&(b(y)?_():(o.notify({previousState:u,newState:y}),u=y)),y}function m(){Ft({process:y=>{if(Kr(y))return Dt(y,t)},after:y=>{u=y}},a)}function w(y){if(Kr(y))return!1;const{trackingType:R,isTracked:C}=r(y[n]);y[n]=R,delete y.isExpired,C&&!y.id&&(y.id=ye(),y.created=String(Ve()))}function v(){return u[n]!==void 0}function b(y){return u.id!==y.id||u[n]!==y[n]}function _(){u=Dt(u,t),i.notify()}function k(y){u=y,s.notify()}function x(y){Ft({process:R=>({...R,...y}),after:g},a)}return{expandOrRenewSession:d,expandSession:h,getSession:()=>u,renewObservable:s,expireObservable:i,sessionStateUpdateObservable:o,restartSession:m,expire:()=>{f(),c(u),g(Dt(u,t))},stop:()=>{jr(l)},updateSessionState:x}}const Xs={GRANTED:"granted",NOT_GRANTED:"not-granted"};function xh(e){const t=new G;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===Xs.GRANTED},observable:t}}function on(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=an(Object.prototype),s=an(Array.prototype),i=an(Object.getPrototypeOf(e)),o=an(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),s(),i(),o()}}function an(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):z}function Qs(e){return Zr(e,location.href).href}function Th(e){try{return!!Zr(e)}catch{return!1}}function Ah(e){const t=Zr(e).pathname;return t[0]==="/"?t:`/${t}`}function Zr(e,t){const n=Rh();if(n)try{return t!==void 0?new n(e,t):new n(e)}catch(i){throw new Error(`Failed to construct URL: ${String(i)} ${on({url:e,base:t})}`)}if(t===void 0&&!/:/.test(e))throw new Error(`Invalid URL: '${e}'`);let r=document;const s=r.createElement("a");if(t!==void 0){r=document.implementation.createHTMLDocument("");const i=r.createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(s)}return s.href=e,s}const tc=URL;let Xr;function Rh(){if(Xr===void 0)try{Xr=new tc("http://test/path").href==="http://test/path"}catch{Xr=!1}return Xr?tc:void 0}const nc="datad0g.com",Ih="dd0g-gov.com",Bt="datadoghq.com",kh="datadoghq.eu",Oh="ddog-gov.com",Ph="pci.browser-intake-datadoghq.com",Lh=["ddsource","ddtags"];function cn(e,t,n){const r=Nh(e,t);return{build(s,i){const o=Mh(e,t,n,s,i);return r(o)},tags:n,urlPrefix:r(""),trackType:t}}function Nh(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const i=Qs(r);return o=>`${i}?ddforward=${encodeURIComponent(`${n}?${o}`)}`}if(typeof r=="function")return i=>r({path:n,parameters:i});const s=rc(t,e);return i=>`https://${s}${n}?${i}`}function rc(e,t){const{site:n=Bt,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===Bt)return Ph;if(r&&n===Bt)return`${r}.${Bt}`;if(n===Ih)return`http-intake.logs.${n}`;const s=n.split("."),i=s.pop();return`browser-intake-${s.join("-")}.${i}`}function Mh({clientToken:e,internalAnalyticsSubdomain:t},n,r,s,{retry:i,encoding:o}){const a=["sdk_version:6.6.3",`api:${s}`].concat(r);i&&a.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const c=["ddsource=browser",`ddtags=${encodeURIComponent(a.join(","))}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.6.3")}`,"dd-evp-origin=browser",`dd-request-id=${ye()}`];return o&&c.push(`dd-evp-encoding=${o}`),n==="rum"&&c.push(`batch_time=${de()}`),t&&c.reverse(),c.join("&")}const Dh=200;function Fh(e){const{env:t,service:n,version:r,datacenter:s}=e,i=[];return t&&i.push(Qr("env",t)),n&&i.push(Qr("service",n)),r&&i.push(Qr("version",r)),s&&i.push(Qr("datacenter",s)),i}function Qr(e,t){const n=Dh-e.length-1;(t.length>n||Bh(t))&&V.warn(`${e} value doesn't meet tag requirements and will be sanitized. ${Vs} ${$r}/getting_started/tagging/#defining-tags`);const r=t.replace(/,/g,"_");return`${e}:${r}`}function Bh(e){return Uh()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function Uh(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function $h(e){const t=e.site||Bt,n=Fh(e),r=Vh(e,n);return{replica:zh(e,n),site:t,...r}}function Vh(e,t){return{logsEndpointBuilder:cn(e,"logs",t),rumEndpointBuilder:cn(e,"rum",t),profilingEndpointBuilder:cn(e,"profile",t),sessionReplayEndpointBuilder:cn(e,"replay",t)}}function zh(e,t){if(!e.replica)return;const n={...e,site:Bt,clientToken:e.replica.clientToken},r={logsEndpointBuilder:cn(n,"logs",t),rumEndpointBuilder:cn(n,"rum",t)};return{applicationId:e.replica.applicationId,...r}}function Hh(e){return Lh.every(t=>e.includes(t))}const Xn={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ei={ALL:"all",SAMPLED:"sampled"};function ti(e,t){return e!=null&&typeof e!="string"?(V.error(`${t} must be defined as a string`),!1):!0}function jh(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(V.error(`Site should be a valid Datadog site. ${Vs} ${$r}/getting_started/site/.`),!1):!0}function ln(e,t){return e!==void 0&&!Bp(e)?(V.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function Wh(e){var t,n,r,s,i,o;if(!e||!e.clientToken){V.error("Client Token is not configured, we will not send any data.");return}if(!(!jh(e.site)||!ln(e.sessionSampleRate,"Session")||!ln(e.telemetrySampleRate,"Telemetry")||!ln(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!ln(e.telemetryUsageSampleRate,"Telemetry Usage")||!ti(e.version,"Version")||!ti(e.env,"Env")||!ti(e.service,"Service"))){if(e.trackingConsent!==void 0&&!Hr(Xs,e.trackingConsent)){V.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&Pa(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Eh(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(r=e.telemetryConfigurationSampleRate)!==null&&r!==void 0?r:5,telemetryUsageSampleRate:(s=e.telemetryUsageSampleRate)!==null&&s!==void 0?s:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(i=e.trackingConsent)!==null&&i!==void 0?i:Xs.GRANTED,trackAnonymousUser:(o=e.trackAnonymousUser)!==null&&o!==void 0?o:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*Kn,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Se,batchMessagesLimit:50,messageBytesLimit:256*Kn,...$h(e)}}}function qh(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent}}var Ut;(function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.MISSING_URL_CONTEXT_TELEMETRY="missing_url_context_telemetry",e.USER_ACCOUNT_TRACE_HEADER="user_account_trace_header",e.PROFILING="profiling"})(Ut||(Ut={}));const ni=new Set;function Kh(e){Array.isArray(e)&&Gh(e.filter(t=>Hr(Ut,t)))}function Gh(e){e.forEach(t=>{ni.add(t)})}function es(e){return ni.has(e)}function Yh(){return ni}const Qn="?";function _t(e){const t=[];let n=ri(e,"stack");const r=String(e);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split(`
|
|
14
14
|
`).forEach(s=>{const i=Xh(s)||eg(s)||ng(s)||ig(s);i&&(!i.func&&i.line&&(i.func=Qn),t.push(i))}),{message:ri(e,"message"),name:ri(e,"name"),stack:t}}const sc="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",un="(?::(\\d+))",Jh=new RegExp(`^\\s*at (.*?) ?\\(${sc}${un}?${un}?\\)?\\s*$`,"i"),Zh=new RegExp(`\\((\\S*)${un}${un}\\)`);function Xh(e){const t=Jh.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,s=Zh.exec(t[2]);return r&&s&&(t[2]=s[1],t[3]=s[2],t[4]=s[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Qn,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const Qh=new RegExp(`^\\s*at ?${sc}${un}?${un}??\\s*$`,"i");function eg(e){const t=Qh.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:Qn,line:t[2]?+t[2]:void 0,url:t[1]}}const tg=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function ng(e){const t=tg.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Qn,line:+t[3],url:t[2]}}const rg=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,sg=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ig(e){const t=rg.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,r=sg.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Qn,line:t[4]?+t[4]:void 0,url:t[3]}}function ri(e,t){if(typeof e!="object"||!e||!(t in e))return;const n=e[t];return typeof n=="string"?n:void 0}function og(e,t,n,r){const s=[{url:t,column:r,line:n}],{name:i,message:o}=cg(e);return{name:i,message:o,stack:s}}const ag=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function cg(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=ag.exec(e)),{name:t,message:n}}function ts(e){const n=new Error(e);n.name="HandlingStack";let r;return Nt(()=>{const s=_t(n);s.stack=s.stack.slice(2),r=dn(s)}),r}function dn(e){let t=ic(e);return e.stack.forEach(n=>{const r=n.func==="?"?"<anonymous>":n.func,s=n.args&&n.args.length>0?`(${n.args.join(", ")})`:"",i=n.line?`:${n.line}`:"",o=n.line&&n.column?`:${n.column}`:"";t+=`
|
|
15
15
|
at ${r}${s} @ ${n.url}${i}${o}`}),t}function ic(e){return`${e.name||"Error"}: ${e.message}`}function Le(e,t,n,{computeHandlingStack:r}={}){let s=e[t];if(typeof s!="function")if(t in e&&t.startsWith("on"))s=z;else return{stop:z};let i=!1;const o=function(){if(i)return s.apply(this,arguments);const a=Array.from(arguments);let c;Nt(n,null,[{target:this,parameters:a,onPostCall:u=>{c=u},handlingStack:r?ts("instrumented method"):void 0}]);const l=s.apply(this,a);return c&&Nt(c,null,[l]),l};return e[t]=o,{stop:()=>{i=!0,e[t]===o&&(e[t]=s)}}}function er(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:z};const s=z;let i=(a,c)=>{fe(()=>{i!==s&&n(a,c)},0)};const o=function(a){r.set.call(this,a),i(this,a)};return Object.defineProperty(e,t,{set:o}),{stop:()=>{var a;((a=Object.getOwnPropertyDescriptor(e,t))===null||a===void 0?void 0:a.set)===o&&Object.defineProperty(e,t,r),i=s}}}const lg=220*Kn,ug="$",dg=3;function ie(e,t=lg){const n=an(Object.prototype),r=an(Array.prototype),s=[],i=new WeakMap,o=si(e,ug,void 0,s,i),a=JSON.stringify(o);let c=a?a.length:0;if(c>t){oi(t,"discarded",e);return}for(;s.length>0&&c<t;){const l=s.shift();let u=0;if(Array.isArray(l.source))for(let d=0;d<l.source.length;d++){const f=si(l.source[d],l.path,d,s,i);if(f!==void 0?c+=JSON.stringify(f).length:c+=4,c+=u,u=1,c>t){oi(t,"truncated",e);break}l.target[d]=f}else for(const d in l.source)if(Object.prototype.hasOwnProperty.call(l.source,d)){const f=si(l.source[d],l.path,d,s,i);if(f!==void 0&&(c+=JSON.stringify(f).length+u+d.length+dg,u=1),c>t){oi(t,"truncated",e);break}l.target[d]=f}}return n(),r(),o}function si(e,t,n,r,s){const i=hg(e);if(!i||typeof i!="object")return fg(i);const o=ii(i);if(o!=="[Object]"&&o!=="[Array]"&&o!=="[Error]")return o;const a=e;if(s.has(a))return`[Reference seen at ${s.get(a)}]`;const c=n!==void 0?`${t}.${n}`:t,l=Array.isArray(i)?[]:{};return s.set(a,c),r.push({source:i,target:l,path:c}),l}function fg(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function ii(e){try{if(e instanceof Event)return pg(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch{}return"[Unserializable]"}function pg(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?ii(e.currentTarget):null,target:e.target?ii(e.target):null}}function hg(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function oi(e,t,n){V.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const oc="No stack, consider using an instance of Error";function ac({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:s,nonErrorPrefix:i,source:o,handling:a}){const c=vt(t),l=gg(e,c,i,t),u=mg(c,e)?dn(e):oc,d=c?uc(t,o):void 0,f=e?e.name:void 0,h=cc(t),p=lc(t);return{startClocks:s,source:o,handling:a,handlingStack:n,componentStack:r,originalError:t,type:f,message:l,stack:u,causes:d,fingerprint:h,context:p}}function gg(e,t,n,r){return e!=null&&e.message&&(e!=null&&e.name)?e.message:t?"Empty message":`${n} ${on(ie(r))}`}function mg(e,t){return t===void 0?!1:e?!0:t.stack.length>0&&(t.stack.length>1||t.stack[0].url!==void 0)}function cc(e){return vt(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function lc(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function vt(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function uc(e,t){let n=e;const r=[];for(;vt(n==null?void 0:n.cause)&&r.length<10;){const s=_t(n.cause);r.push({message:n.cause.message,source:t,type:s==null?void 0:s.name,stack:s&&dn(s)}),n=n.cause}return r.length?r:void 0}const fn={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function yg(e){const t=(s,i)=>{const o=ac({stackTrace:s,originalError:i,startClocks:xe(),nonErrorPrefix:"Uncaught",source:fn.SOURCE,handling:"unhandled"});e.notify(o)},{stop:n}=bg(t),{stop:r}=wg(t);return{stop:()=>{n(),r()}}}function bg(e){return Le(window,"onerror",({parameters:[t,n,r,s,i]})=>{let o;vt(i)?o=_t(i):o=og(t,n,r,s),e(o,i??t)})}function wg(e){return Le(window,"onunhandledrejection",({parameters:[t]})=>{const n=t.reason||"Empty reason",r=_t(n);e(r,n)})}function Sg(e){const t={version:"6.6.3",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return Gp},enumerable:!1}),t}function _g(e,t,n){const r=e[t];r&&!r.q&&r.version&&V.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,r&&r.q&&r.q.forEach(s=>Pa(s,"onReady callback threw an error:")())}function dc(e,t){t.silentMultipleInit||V.error(`${e} is already initialized.`)}function Z(e,t,n,r,s){return Ne(e,t,[n],r,s)}function Ne(e,t,n,r,{once:s,capture:i,passive:o}={}){const a=U(f=>{!f.isTrusted&&!f.__ddIsTrusted&&!e.allowUntrustedEvents||(s&&d(),r(f))}),c=o?{capture:i,passive:o}:i,l=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,u=bt(l,"addEventListener");n.forEach(f=>u.call(t,f,a,c));function d(){const f=bt(l,"removeEventListener");n.forEach(h=>f.call(t,h,a,c))}return{stop:d}}const tr={intervention:"intervention",cspViolation:"csp_violation"};function vg(e,t){const n=[];t.includes(tr.cspViolation)&&n.push(Cg(e));const r=t.filter(s=>s!==tr.cspViolation);return r.length&&n.push(Eg(r)),Ua(...n)}function Eg(e){return new G(t=>{if(!window.ReportingObserver)return;const n=U((s,i)=>s.forEach(o=>t.notify(xg(o)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function Cg(e){return new G(t=>{const{stop:n}=Z(e,document,"securitypolicyviolation",r=>{t.notify(Tg(r))});return n})}function xg(e){const{type:t,body:n}=e;return fc({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:pc(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function Tg(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return fc({type:e.effectiveDirective,message:`${tr.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:pc(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${$a(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function fc(e){return{startClocks:xe(),source:fn.REPORT,handling:"unhandled",...e}}function pc(e,t,n,r,s){return n?dn({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:s??void 0}]}):void 0}function ai(e,t){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function $t(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function ns(e,t,n=Ag()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const s=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,s)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const s=Array.isArray(e)?e:[];for(let i=0;i<t.length;++i)s[i]=ns(s[i],t[i],n);return s}const r=$t(e)==="object"?e:{};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=ns(r[s],t[s],n));return r}function ci(e){return ns(void 0,e)}function Ge(...e){let t;for(const n of e)n!=null&&(t=ns(t,n));return t}function Ag(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(n){const r=t.has(n);return r||t.add(n),r}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}function hc(){var e;const t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function gc(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const Rg=500;function mc(){const e=[];return{add:s=>{e.push(s)>Rg&&e.splice(0,1)},remove:s=>{gc(e,s)},drain:s=>{e.forEach(i=>i(s)),e.length=0}}}const Vt={log:"log",configuration:"configuration",usage:"usage"},Ig=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],kg=[Oh];let yc=mc(),pn=e=>{yc.add(()=>pn(e))};function Og(e,t){let n;const r=new G,s=new Set,i=!kg.includes(t.site)&&yt(t.telemetrySampleRate),o={[Vt.log]:i,[Vt.configuration]:i&&yt(t.telemetryConfigurationSampleRate),[Vt.usage]:i&&yt(t.telemetryUsageSampleRate)},a=Pg();pn=l=>{const u=on(l);if(o[l.type]&&s.size<t.maxTelemetryEventsPerPage&&!s.has(u)){const d=c(e,l,a);r.notify(d),ai("telemetry",d),s.add(u)}},Kp(li);function c(l,u,d){return Ge({type:"telemetry",date:de(),service:l,version:"6.6.3",source:"browser",_dd:{format_version:2},telemetry:Ge(u,{runtime_env:d,connectivity:hc(),sdk_setup:"npm"}),experimental_features:Array.from(Yh())},n!==void 0?n():{})}return{setContextProvider:l=>{n=l},observable:r,enabled:i}}function Pg(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function Lg(){yc.drain()}function Ng(e){return e.site===nc}function ft(e,t){Ws(Ur.debug,e,t),pn({type:Vt.log,message:e,status:"debug",...t})}function li(e,t){pn({type:Vt.log,status:"error",...Dg(e),...t})}function Mg(e){pn({type:Vt.configuration,configuration:e})}function Te(e){pn({type:Vt.usage,usage:e})}function Dg(e){if(vt(e)){const t=_t(e);return{error:{kind:t.name,stack:dn(Fg(t))},message:t.message}}return{error:{stack:oc},message:`Uncaught ${on(e)}`}}function Fg(e){return e.stack=e.stack.filter(t=>!t.url||Ig.some(n=>t.url.startsWith(n))),e}const nr=1/0,Bg=Oe;let rr=null;const rs=new Set;function Ug(){rs.forEach(e=>e())}function hn({expireDelay:e,maxEntries:t}){let n=[];const r=[];rr||(rr=rn(()=>Ug(),Bg));const s=()=>{const h=ze()-e;for(;n.length>0&&n[n.length-1].endTime<h;){const p=n.pop();p&&r.push(p.startTime)}};rs.add(s);function i(h,p){const g={value:h,startTime:p,endTime:nr,remove:()=>{gc(n,g)},close:m=>{g.endTime=m}};return t&&n.length>=t&&n.pop(),n.unshift(g),g}function o(h=nr,p={returnInactive:!1}){for(const g of n)if(g.startTime<=h){if(p.returnInactive||h<=g.endTime)return g.value;break}}function a(h){const p=n[0];p&&p.endTime===nr&&p.close(h)}function c(h=nr,p=0){const g=nn(h,p);return n.filter(m=>m.startTime<=g&&h<=m.endTime).map(m=>m.value)}function l(){return n.map(({startTime:h,endTime:p,value:g})=>({startTime:h,endTime:p===nr?"Infinity":p,value:g}))}function u(){return r}function d(){n=[]}function f(){rs.delete(s),rs.size===0&&rr&&(jr(rr),rr=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f,getAllEntries:l,getDeletedEntries:u}}const $g=Oe,Vg=Mt;function zg(e,t,n,r){const s=new G,i=new G,o=Ch(e.sessionStoreStrategyType,e,t,n),a=hn({expireDelay:Vg});o.renewObservable.subscribe(()=>{a.add(c(),ze()),s.notify()}),o.expireObservable.subscribe(()=>{i.notify(),a.closeActive(ze())}),o.expandOrRenewSession(),a.add(c(),Ma().relative),r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire()}),Hg(e,()=>{r.isGranted()&&o.expandOrRenewSession()}),jg(e,()=>o.expandSession()),Wg(e,()=>o.restartSession());function c(){return{id:o.getSession().id,trackingType:o.getSession()[t],isReplayForced:!!o.getSession().forcedReplay,anonymousId:o.getSession().anonymousId}}return{findSession:(l,u)=>a.find(l,u),renewObservable:s,expireObservable:i,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function Hg(e,t){const{stop:n}=Ne(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function jg(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Z(e,document,"visibilitychange",n);rn(n,$g)}function Wg(e,t){const{stop:n}=Z(e,window,"resume",t,{capture:!0})}function qg(e){return e>=500}function Kg(e){try{return e.clone()}catch{return}}const Gg=80*Kn,Yg=32,bc=3*Da,Jg=Oe,wc=Se;function Sc(e,t,n,r,s){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?vc(e,t,n,{onSuccess:()=>Ec(0,t,n,r,s),onFailure:()=>{t.queuedPayloads.enqueue(e),_c(t,n,r,s)}}):t.queuedPayloads.enqueue(e)}function _c(e,t,n,r){e.transportStatus===2&&fe(()=>{const s=e.queuedPayloads.first();vc(s,e,t,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=wc,Ec(1,e,t,n,r)},onFailure:()=>{e.currentBackoffTime=Math.min(Jg,e.currentBackoffTime*2),_c(e,t,n,r)}})},e.currentBackoffTime)}function vc(e,t,n,{onSuccess:r,onFailure:s}){t.bandwidthMonitor.add(e),n(e,i=>{t.bandwidthMonitor.remove(e),Zg(i)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:i.status},s()):(t.transportStatus=0,r())})}function Ec(e,t,n,r,s){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(s({message:`Reached max ${r} events size queued for upload: ${bc/Da}MiB`,source:fn.AGENT,startClocks:xe()}),t.queueFullReported=!0);const i=t.queuedPayloads;for(t.queuedPayloads=Cc();i.size()>0;)Sc(i.dequeue(),t,n,r,s)}function Zg(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||qg(e.status))}function Xg(){return{transportStatus:0,currentBackoffTime:wc,bandwidthMonitor:Qg(),queuedPayloads:Cc(),queueFullReported:!1}}function Cc(){const e=[];return{bytesCount:0,enqueue(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=bc}}}function Qg(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=Gg&&this.ongoingRequestCount<Yg},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}}}function xc(e,t,n){const r=Xg(),s=(i,o)=>nm(e,t,i,o);return{send:i=>{Sc(i,r,s,e.trackType,n)},sendOnExit:i=>{em(e,t,i)}}}function em(e,t,n){if(!!navigator.sendBeacon&&n.bytesCount<t)try{const s=e.build("beacon",n);if(navigator.sendBeacon(s,n.data))return}catch(s){tm(s)}ui(e,n)}let Tc=!1;function tm(e){Tc||(Tc=!0,dt(e))}function nm(e,t,n,r){if(rm()&&n.bytesCount<t){const i=e.build("fetch-keepalive",n);fetch(i,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(U(o=>r==null?void 0:r({status:o.status,type:o.type}))).catch(U(()=>ui(e,n,r)))}else ui(e,n,r)}function ui(e,t,n){const r=e.build("fetch",t);fetch(r,{method:"POST",body:t.data,mode:"cors"}).then(U(s=>n==null?void 0:n({status:s.status,type:s.type}))).catch(U(()=>n==null?void 0:n({status:0})))}function rm(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function gn(){const e=sm();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){const s=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:s}))}}}function Ac(e){const t=gn();return!!t&&t.getCapabilities().includes(e)}function zt(e){var t;e===void 0&&(e=(t=et().location)===null||t===void 0?void 0:t.hostname);const n=gn();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function sm(){return et().DatadogEventBridge}const mn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function im(e){return new G(t=>{const{stop:n}=Ne(e,window,["visibilitychange","freeze"],s=>{s.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:mn.HIDDEN}):s.type==="freeze"&&t.notify({reason:mn.FROZEN})},{capture:!0}),r=Z(e,window,"beforeunload",()=>{t.notify({reason:mn.UNLOADING})}).stop;return()=>{n(),r()}})}function Rc(e){return Ha(mn).includes(e)}function om({encoder:e,request:t,flushController:n,messageBytesLimit:r}){let s={};const i=n.flushObservable.subscribe(d=>u(d));function o(d,f,h){n.notifyBeforeAddMessage(f),h!==void 0?(s[h]=d,n.notifyAfterAddMessage()):e.write(e.isEmpty?d:`
|
|
16
16
|
${d}`,p=>{n.notifyAfterAddMessage(p-f)})}function a(d){return d!==void 0&&s[d]!==void 0}function c(d){const f=s[d];delete s[d];const h=e.estimateEncodedBytesCount(f);n.notifyAfterRemoveMessage(h)}function l(d,f){const h=on(d),p=e.estimateEncodedBytesCount(h);if(p>=r){V.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${Vs} ${Fp}/#technical-limitations`);return}a(f)&&c(f),o(h,p,f)}function u(d){const f=Ha(s).join(`
|
|
17
17
|
`);s={};const h=Rc(d.reason),p=h?t.sendOnExit:t.send;if(h&&e.isAsync){const g=e.finishSync();g.outputBytesCount&&p(Ic(g));const m=[g.pendingData,f].filter(Boolean).join(`
|
|
18
18
|
`);m&&p({data:m,bytesCount:Fa(m)})}else f&&e.write(e.isEmpty?f:`
|
|
19
|
-
${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.unsubscribe}}function Ic(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function am({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:s}){const i=r.subscribe(p=>u(p.reason)),o=s.subscribe(()=>u("session_expire")),a=new G(()=>()=>{i.unsubscribe(),o.unsubscribe()});let c=0,l=0;function u(p){if(l===0)return;const g=l,m=c;l=0,c=0,h(),a.notify({reason:p,messagesCount:g,bytesCount:m})}let d;function f(){d===void 0&&(d=fe(()=>{u("duration_limit")},n))}function h(){Pe(d),d=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(p){c+p>=t&&u("bytes_limit"),l+=1,c+=p,f()},notifyAfterAddMessage(p=0){c+=p,l>=e?u("messages_limit"):c>=t&&u("bytes_limit")},notifyAfterRemoveMessage(p){c-=p,l-=1,l===0&&h()}}}function cm(e,t,n,r,s,i,o=om){const a=l(e,t),c=n&&l(e,n);function l(u,{endpoint:d,encoder:f}){return o({encoder:f,request:xc(d,u.batchBytesLimit,r),flushController:am({messagesLimit:u.batchMessagesLimit,bytesLimit:u.batchBytesLimit,durationLimit:u.flushTimeout,pageMayExitObservable:s,sessionExpireObservable:i}),messageBytesLimit:u.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(u,d=!0){a.add(u),c&&d&&c.add(n.transformMessage?n.transformMessage(u):u)},upsert:(u,d)=>{a.upsert(u,d),c&&c.upsert(n.transformMessage?n.transformMessage(u):u,d)},stop:()=>{a.stop(),c&&c.stop()}}}function lm(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const s=Fa(n);t+=s,e+=n,r&&r(s)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class um{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(s=>s(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}function di(e,t,n){let r=0,s=!1;return{isLimitReached(){if(r===0&&fe(()=>{r=0},Oe),r+=1,r<=t||s)return s=!1,!1;if(r===t+1){s=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:fn.AGENT,startClocks:xe()})}finally{s=!1}}return!0}}}function fi(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:z}):Z(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function dm(e,t){return new Promise(n=>{fi(e,t,n)})}let pi;const hi=new WeakMap;function fm(e){return pi||(pi=pm(e)),pi}function pm(e){return new G(t=>{const{stop:n}=Le(XMLHttpRequest.prototype,"open",hm),{stop:r}=Le(XMLHttpRequest.prototype,"send",i=>{gm(i,e,t)},{computeHandlingStack:!0}),{stop:s}=Le(XMLHttpRequest.prototype,"abort",mm);return()=>{n(),r(),s()}})}function hm({target:e,parameters:[t,n]}){hi.set(e,{state:"open",method:String(t).toUpperCase(),url:Qs(String(n))})}function gm({target:e,handlingStack:t},n,r){const s=hi.get(e);if(!s)return;const i=s;i.state="start",i.startClocks=xe(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let o=!1;const{stop:a}=Le(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&c()}),c=()=>{if(l(),a(),o)return;o=!0;const u=s;u.state="complete",u.duration=me(i.startClocks.timeStamp,de()),u.status=e.status,r.notify(Gn(u))},{stop:l}=Z(n,e,"loadend",c);r.notify(i)}function mm({target:e}){const t=hi.get(e);t&&(t.isAborted=!0)}let gi;function kc(){return gi||(gi=ym()),gi}function ym(){return new G(e=>{if(!window.fetch)return;const{stop:t}=Le(window,"fetch",n=>bm(n,e),{computeHandlingStack:!0});return t})}function bm({parameters:e,onPostCall:t,handlingStack:n},r){const[s,i]=e;let o=i&&i.method;o===void 0&&s instanceof Request&&(o=s.method);const a=o!==void 0?String(o).toUpperCase():"GET",c=s instanceof Request?s.url:Qs(String(s)),l=xe(),u={state:"start",init:i,input:s,method:a,startClocks:l,url:c,handlingStack:n};r.notify(u),e[0]=u.input,e[1]=u.init,t(d=>wm(r,d,u))}function wm(e,t,n){const r=n;function s(i){r.state="resolve",Object.assign(r,i),e.notify(r)}t.then(U(i=>{s({response:i,responseType:i.type,status:i.status,isAborted:!1})}),U(i=>{var o,a;s({status:0,isAborted:((a=(o=r.init)===null||o===void 0?void 0:o.signal)===null||a===void 0?void 0:a.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function Oc(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(U(e),t);return()=>window.cancelIdleCallback(n)}return _m(e)}const Sm=50;function _m(e){const t=Ve(),n=fe(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,Sm-(Ve()-t))})},0);return()=>Pe(n)}const vm=Se,Em=30;function Cm(){const e=[];function t(r){let s;if(r.didTimeout){const i=performance.now();s=()=>Em-(performance.now()-i)}else s=r.timeRemaining.bind(r);for(;s()>0&&e.length;)e.shift()();e.length&&n()}function n(){Oc(t,{timeout:vm})}return{push(r){e.push(r)===1&&n()}}}let mi={};function xm(e){const t=e.map(n=>(mi[n]||(mi[n]=Tm(n)),mi[n]));return Ua(...t)}function Tm(e){return new G(t=>{const n=ut[e];return ut[e]=(...r)=>{n.apply(console,r);const s=ts("console error");Nt(()=>{t.notify(Am(r,e,s))})},()=>{ut[e]=n}})}function Am(e,t,n){const r=e.map(i=>Rm(i)).join(" ");let s;if(t===Ur.error){const i=e.find(vt);s={stack:i?dn(_t(i)):void 0,fingerprint:cc(i),causes:i?uc(i,"console"):void 0,startClocks:xe(),message:r,source:fn.CONSOLE,handling:"handled",handlingStack:n,context:lc(i),originalError:i}}return{api:t,message:r,error:s,handlingStack:n}}function Rm(e){return typeof e=="string"?ie(e):vt(e)?ic(_t(e)):on(ie(e),void 0,2)}function Im(e){const t=$t(e)==="object";return t||V.error("Unsupported context:",e),t}function yi(e,t,n){const r={...e};for(const[s,{required:i,type:o}]of Object.entries(t))o==="string"&&s in r&&(r[s]=String(r[s])),i&&!(s in e)&&V.warn(`The property ${s} of ${n} is required; context will not be sent to the intake.`);return r}function ss(e="",{propertiesConfig:t={}}={}){let n={};const r=new G,s={getContext:()=>ci(n),setContext:i=>{Im(i)?n=ie(yi(i,t,e)):s.clearContext(),r.notify()},setContextProperty:(i,o)=>{n=ie(yi({...n,[i]:o},t,e)),r.notify()},removeContextProperty:i=>{delete n[i],yi(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return s}const km="_dd_c",Om=[];function bi(e,t,n,r){const s=Pm(n,r);Om.push(Z(e,window,"storage",({key:l})=>{s===l&&o()})),t.changeObservable.subscribe(a);const i=Ge(c(),t.getContext());Lt(i)||t.setContext(i);function o(){t.setContext(c())}function a(){localStorage.setItem(s,JSON.stringify(t.getContext()))}function c(){const l=localStorage.getItem(s);return l?JSON.parse(l):{}}}function Pm(e,t){return`${km}_${e}_${t}`}const pe={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Ae={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function Lm(e,t,n){const r=e.getReader();let s=0;i();function i(){r.read().then(U(a=>{if(a.done){o();return}s+=a.value.length,s>n.bytesLimit?o():i()}),U(a=>t(a)))}function o(){r.cancel().catch(z),t(void 0,void 0,void 0)}}const Nm="datadog-synthetics-public-id",Mm="datadog-synthetics-result-id",Dm="datadog-synthetics-injects-rum";function Pc(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||St(Dm))}function Fm(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||St(Nm);return typeof e=="string"?e:void 0}function Bm(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||St(Mm);return typeof e=="string"?e:void 0}function wi(e){const t=$t(e);return t==="string"||t==="function"||e instanceof RegExp}function Lc(e,t,n=!1){return e.some(r=>{try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?t.startsWith(r):r===t}catch(s){V.error(s)}return!1})}function Um(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function $m(e,t,n){function r(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function s(i){r(i)&&e.notify(12,zm(i))}return{addDurationVital:s,startDurationVital:(i,o={})=>Nc(n,i,o),stopDurationVital:(i,o={})=>{Mc(s,n,i,o)}}}function Nc({vitalsByName:e,vitalsByReference:t},n,r={}){const s={name:n,startClocks:xe(),context:r.context,description:r.description},i={__dd_vital_reference:!0};return e.set(n,s),t.set(i,s),i}function Mc(e,{vitalsByName:t,vitalsByReference:n},r,s={}){const i=typeof r=="string"?t.get(r):n.get(r);i&&(e(Vm(i,i.startClocks,s,xe())),typeof r=="string"?t.delete(r):n.delete(r))}function Vm(e,t,n,r){var s;return{name:e.name,type:"duration",startClocks:t,duration:me(t.timeStamp,r.timeStamp),context:Ge(e.context,n.context),description:(s=n.description)!==null&&s!==void 0?s:e.description}}function zm(e,t){const n={date:e.startClocks.timeStamp,vital:{id:ye(),type:e.type,name:e.name,duration:B(e.duration),description:e.description},type:"vital"};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,customerContext:e.context,domainContext:{}}}function Dc(e,t,n){if(e)for(const r of e){const s=r[t];s&&s(n)}}function Hm(){return Bc(64)}function Fc(){return Bc(63)}function Bc(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],s=t[0],i="";do{const o=r%n*4294967296+s;r=Math.floor(r/n),s=Math.floor(o/n),i=(o%n).toString(n)+i}while(r||s);return i}}}function yn(e){return e.toString(16).padStart(16,"0")}let is;function jm(e,t){if(t===100)return!0;if(t===0)return!1;if(is&&e===is.sessionId)return is.decision;let n;return window.BigInt?n=Wm(BigInt(`0x${e.split("-")[4]}`),t):n=yt(t),is={sessionId:e,decision:n},n}function Wm(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),s=e*n%r;return Number(s)<=t/100*Number(r)}function qm(e){const t=e;return $t(t)==="object"&&wi(t.match)&&Array.isArray(t.propagatorTypes)}function Km(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Gm(e,t,n){return{clearTracingIfNeeded:Km,traceFetch:r=>Uc(e,r,t,n,s=>{var i;if(r.input instanceof Request&&!(!((i=r.init)===null||i===void 0)&&i.headers))r.input=new Request(r.input),Object.keys(s).forEach(o=>{r.input.headers.append(o,s[o])});else{r.init=Gn(r.init);const o=[];r.init.headers instanceof Headers?r.init.headers.forEach((a,c)=>{o.push([c,a])}):Array.isArray(r.init.headers)?r.init.headers.forEach(a=>{o.push(a)}):r.init.headers&&Object.keys(r.init.headers).forEach(a=>{o.push([a,r.init.headers[a]])}),r.init.headers=o.concat(Ys(s))}}),traceXhr:(r,s)=>Uc(e,r,t,n,i=>{Object.keys(i).forEach(o=>{s.setRequestHeader(o,i[o])})})}}function Uc(e,t,n,r,s){const i=n.findTrackedSession();if(!i)return;const o=e.allowedTracingUrls.find(l=>Lc([l.match],t.url,!0));if(!o)return;const a=jm(i.id,e.traceSampleRate);(a||e.traceContextInjection===ei.ALL)&&(t.traceSampled=a,t.traceId=Hm(),t.spanId=Fc(),s(Ym(t.traceId,t.spanId,t.traceSampled,o.propagatorTypes,r,e)))}function Ym(e,t,n,r,s,i){const o={};if(r.forEach(a=>{switch(a){case"datadog":{Object.assign(o,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(o,{traceparent:`00-0000000000000000${yn(e)}-${yn(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(o,{b3:`${yn(e)}-${yn(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(o,{"X-B3-TraceId":yn(e),"X-B3-SpanId":yn(t),"X-B3-Sampled":n?"1":"0"});break}}}),es(Ut.USER_ACCOUNT_TRACE_HEADER)&&i.propagateTraceBaggage){const a=s().user.id,c=s().account.id,l=[];typeof a=="string"&&l.push(`usr.id=${encodeURIComponent(a)}`),typeof c=="string"&&l.push(`account.id=${encodeURIComponent(c)}`),l.length>0&&(o.baggage=l.join(","))}return o}const $c=["tracecontext","datadog"];function Jm(e){var t,n,r,s,i,o,a;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&V.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){V.error("Application ID is not configured, no RUM data will be collected.");return}if(!ln(e.sessionReplaySampleRate,"Session Replay")||!ln(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){V.error("Excluded Activity Urls should be an array");return}const c=Zm(e);if(!c)return;const l=Wh(e);if(!l)return;const u=es(Ut.PROFILING),d=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,version:e.version||void 0,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:d,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:d===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:Wn(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:c,excludedActivityUrls:(r=e.excludedActivityUrls)!==null&&r!==void 0?r:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((s=e.trackUserInteractions)!==null&&s!==void 0)||s),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((o=e.trackLongTasks)!==null&&o!==void 0)||o),subdomain:e.subdomain,defaultPrivacyLevel:Hr(Xn,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Xn.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:Hr(ei,e.traceContextInjection)?e.traceContextInjection:ei.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:u&&(a=e.profilingSampleRate)!==null&&a!==void 0?a:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...l}}function Zm(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){V.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){V.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{wi(n)?t.push({match:n,propagatorTypes:$c}):qm(n)?t.push(n):V.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Xm(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{wi(n)?$c.forEach(r=>t.add(r)):$t(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Qm(e){var t;const n=qh(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:Xm(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var s;return{name:r.name,...(s=r.getConfigurationTelemetry)===null||s===void 0?void 0:s.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,...n}}const e1="v1";function t1(e,t){r1(e,n=>{t(n1(e,n))})}function n1(e,t){return{...e,...t}}function r1(e,t){const n=new XMLHttpRequest;Z(e,n,"load",function(){if(n.status===200){const r=JSON.parse(n.responseText);t(r.rum)}else Vc()}),Z(e,n,"error",function(){Vc()}),n.open("GET",s1(e)),n.send()}function s1(e){return`https://sdk-configuration.${rc("rum",e)}/${e1}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Vc(){V.error("Error fetching the remote configuration.")}function i1(e){const t=zc();return e.storeContextsAcrossPages&&bi(e,t,"rum",2),t}function zc(){return ss("global context")}function o1(e){const t=Hc();return e.storeContextsAcrossPages&&bi(e,t,"rum",1),t}function Hc(){return ss("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}function a1(e){const t=jc();return e.storeContextsAcrossPages&&bi(e,t,"rum",4),t}function jc(){return ss("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function c1({ignoreInitIfSyntheticsWillInjectRum:e,startDeflateWorker:t},n,r,s){const i=mc(),o=zc();Si(o,pe.globalContext,i);const a=Hc();Si(a,pe.userContext,i);const c=jc();Si(c,pe.accountContext,i);let l,u,d,f;const h=n.observable.subscribe(g),p={};function g(){if(!d||!f||!n.isGranted())return;h.unsubscribe();let b;if(f.trackViewsManually){if(!l)return;i.remove(l.callback),b=l.options}const _=s(f,u,b);i.drain(_)}function m(b){const _=zt();if(_&&(b=l1(b)),d=b,Mg(Qm(b)),f){dc("DD_RUM",b);return}const k=Jm(b);if(k){if(!_&&!k.sessionStoreStrategyType){V.warn("No storage available for session. We will not send any data.");return}k.compressIntakeRequests&&!_&&t&&(u=t(k,"Datadog RUM",z),!u)||(f=k,kc().subscribe(z),n.tryToInit(k.trackingConsent),g())}}const w=b=>{i.add(_=>_.addDurationVital(b))};return{init(b,_){if(!b){V.error("Missing configuration");return}Kh(b.enableExperimentalFeatures),d=b,!(e&&Pc())&&(Dc(b.plugins,"onInit",{initConfiguration:b,publicApi:_}),b.remoteConfigurationId?t1(b,m):m(b))},get initConfiguration(){return d},getInternalContext:z,stopSession:z,addTiming(b,_=de()){i.add(k=>k.addTiming(b,_))},startView(b,_=xe()){const k=x=>{x.startView(b,_)};i.add(k),l||(l={options:b,callback:k},g())},setViewName(b){i.add(_=>_.setViewName(b))},setViewContext(b){i.add(_=>_.setViewContext(b))},setViewContextProperty(b,_){i.add(k=>k.setViewContextProperty(b,_))},getViewContext:()=>p,globalContext:o,userContext:a,accountContext:c,addAction(b){i.add(_=>_.addAction(b))},addError(b){i.add(_=>_.addError(b))},addFeatureFlagEvaluation(b,_){i.add(k=>k.addFeatureFlagEvaluation(b,_))},startDurationVital(b,_){return Nc(r,b,_)},stopDurationVital(b,_){Mc(w,r,b,_)},addDurationVital:w}}function l1(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=gn())===null||n===void 0?void 0:n.getPrivacyLevel()}}function Si(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(s=>s[t].setContext(r))})}function u1(e,t,n,r={}){const s=xh(),i=Um();let o=c1(r,s,i,(u,d,f)=>{const h=e(u,t,n,f,d&&r.createDeflateEncoder?p=>r.createDeflateEncoder(u,d,p):lm,s,i);return t.onRumStart(h.lifeCycle,u,h.session,h.viewHistory,d),n.onRumStart(h.lifeCycle,u,h.session,h.viewHistory),o=d1(o,h),Dc(u.plugins,"onRumStart",{strategy:o}),h});const a=U(u=>{const d=typeof u=="object"?u:{name:u};o.startView(d),Te({feature:"start-view"})});function c(u,d,f){return U((...h)=>(Te({feature:f}),o[u][d](...h)))}const l=Sg({init:U(u=>{o.init(u,l)}),setTrackingConsent:U(u=>{s.update(u),Te({feature:"set-tracking-consent",tracking_consent:u})}),setViewName:U(u=>{o.setViewName(u),Te({feature:"set-view-name"})}),setViewContext:U(u=>{o.setViewContext(u),Te({feature:"set-view-context"})}),setViewContextProperty:U((u,d)=>{o.setViewContextProperty(u,d),Te({feature:"set-view-context-property"})}),getViewContext:U(()=>(Te({feature:"set-view-context-property"}),o.getViewContext())),getInternalContext:U(u=>o.getInternalContext(u)),getInitConfiguration:U(()=>ci(o.initConfiguration)),addAction:(u,d)=>{const f=ts("action");Nt(()=>{o.addAction({name:ie(u),context:ie(d),startClocks:xe(),type:"custom",handlingStack:f}),Te({feature:"add-action"})})},addError:(u,d)=>{const f=ts("error");Nt(()=>{o.addError({error:u,handlingStack:f,context:ie(d),startClocks:xe()}),Te({feature:"add-error"})})},addTiming:U((u,d)=>{o.addTiming(ie(u),d)}),setGlobalContext:c(pe.globalContext,Ae.setContext,"set-global-context"),getGlobalContext:c(pe.globalContext,Ae.getContext,"get-global-context"),setGlobalContextProperty:c(pe.globalContext,Ae.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:c(pe.globalContext,Ae.removeContextProperty,"remove-global-context-property"),clearGlobalContext:c(pe.globalContext,Ae.clearContext,"clear-global-context"),setUser:c(pe.userContext,Ae.setContext,"set-user"),getUser:c(pe.userContext,Ae.getContext,"get-user"),setUserProperty:c(pe.userContext,Ae.setContextProperty,"set-user-property"),removeUserProperty:c(pe.userContext,Ae.removeContextProperty,"remove-user-property"),clearUser:c(pe.userContext,Ae.clearContext,"clear-user"),setAccount:c(pe.accountContext,Ae.setContext,"set-account"),getAccount:c(pe.accountContext,Ae.getContext,"get-account"),setAccountProperty:c(pe.accountContext,Ae.setContextProperty,"set-account-property"),removeAccountProperty:c(pe.accountContext,Ae.removeContextProperty,"remove-account-property"),clearAccount:c(pe.accountContext,Ae.clearContext,"clear-account"),startView:a,stopSession:U(()=>{o.stopSession(),Te({feature:"stop-session"})}),addFeatureFlagEvaluation:U((u,d)=>{o.addFeatureFlagEvaluation(ie(u),ie(d)),Te({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:U(()=>t.getSessionReplayLink()),startSessionReplayRecording:U(u=>{t.start(u),Te({feature:"start-session-replay-recording",force:u&&u.force})}),stopSessionReplayRecording:U(()=>t.stop()),addDurationVital:U((u,d)=>{Te({feature:"add-duration-vital"}),o.addDurationVital({name:ie(u),type:"duration",startClocks:Up(d.startTime),duration:d.duration,context:ie(d&&d.context),description:ie(d&&d.description)})}),startDurationVital:U((u,d)=>(Te({feature:"start-duration-vital"}),o.startDurationVital(ie(u),{context:ie(d&&d.context),description:ie(d&&d.description)}))),stopDurationVital:U((u,d)=>{Te({feature:"stop-duration-vital"}),o.stopDurationVital(typeof u=="string"?ie(u):u,{context:ie(d&&d.context),description:ie(d&&d.description)})})});return l}function d1(e,t){return{init:n=>{dc("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function f1(){const e=Wc();return new G(t=>{if(!e)return;const n=new e(U(()=>t.notify()));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Wc(){let e;const t=window;if(t.Zone&&(e=bt(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(z),r=bt(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function p1(){const e=new G,{stop:t}=Le(window,"open",()=>e.notify());return{observable:e,stop:t}}function h1(e,t,n,r,s){return{get:i=>{const o=n.findView(i),a=s.findUrl(i),c=t.findTrackedSession(i);if(c&&o&&a){const l=r.findActionId(i);return{application_id:e,session_id:c.id,user_action:l?{id:l}:void 0,view:{id:o.id,name:o.name,referrer:a.referrer,url:a.url}}}}}}const g1=um,m1=Mt;function y1(e){const t=hn({expireDelay:m1});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const s=t.find(r.startClocks.relative);s&&r.name&&(s.name=r.name),s&&r.context&&(s.context=r.context)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),getAllEntries:()=>t.getAllEntries(),getDeletedEntries:()=>t.getDeletedEntries(),stop:()=>{t.stop()}}}const qc="initial_document",b1=[["document",e=>qc===e],["xhr",e=>e==="xmlhttprequest"],["fetch",e=>e==="fetch"],["beacon",e=>e==="beacon"],["css",(e,t)=>/\.css$/i.test(t)],["js",(e,t)=>/\.js$/i.test(t)],["image",(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],["font",(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],["media",(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function w1(e){const t=e.name;if(!Th(t))return ft(`Failed to construct URL for "${e.name}"`),"other";const n=Ah(t);for(const[r,s]of b1)if(s(e.initiatorType,n))return r;return"other"}function Kc(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function S1(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Gc(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?me(n,r):t}function _1(e){if(!Jc(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:s,redirectEnd:i,domainLookupStart:o,domainLookupEnd:a,connectStart:c,secureConnectionStart:l,connectEnd:u,requestStart:d,responseStart:f,responseEnd:h}=e,p={download:Ht(t,f,h),first_byte:Ht(t,d,f)};return 0<r&&r<n&&(p.worker=Ht(t,r,n)),n<u&&(p.connect=Ht(t,c,u),c<=l&&l<=u&&(p.ssl=Ht(t,l,u))),n<a&&(p.dns=Ht(t,o,a)),t<i&&(p.redirect=Ht(t,s,i)),p}function Yc(e){return e.duration>=0}function Jc(e){const t=Kc(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=v1(e)?Kc(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function v1(e){return e.redirectEnd>e.startTime}function Ht(e,t,n){if(e<=t&&t<=n)return{duration:B(me(t,n)),start:B(me(e,t))}}function Zc(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Xc(e){return e.deliveryType===""?"other":e.deliveryType}function E1(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function _i(e){return e&&!Hh(e)}const C1=/data:(.+)?(;base64)?,/g,Qc=24e3;function el(e){return e.length<=Qc?!1:e.substring(0,5)==="data:"?(e=e.substring(0,Qc),!0):!1}function tl(e){return`${e.match(C1)[0]}[...]`}let nl=1;function x1(e,t,n,r){const s=Gm(t,n,r);T1(e,t,s),A1(e,s)}function T1(e,t,n){const r=fm(t).subscribe(s=>{const i=s;if(_i(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=rl(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:"xhr",url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>r.unsubscribe()}}function A1(e,t){const n=kc().subscribe(r=>{const s=r;if(_i(s.url))switch(s.state){case"start":t.traceFetch(s),s.requestIndex=rl(),e.notify(7,{requestIndex:s.requestIndex,url:s.url});break;case"resolve":R1(s,i=>{t.clearTracingIfNeeded(s),e.notify(8,{duration:i,method:s.method,requestIndex:s.requestIndex,responseType:s.responseType,spanId:s.spanId,startClocks:s.startClocks,status:s.status,traceId:s.traceId,traceSampled:s.traceSampled,type:"fetch",url:s.url,response:s.response,init:s.init,input:s.input,isAborted:s.isAborted,handlingStack:s.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function rl(){const e=nl;return nl+=1,e}function R1(e,t){const n=e.response&&Kg(e.response);!n||!n.body?t(me(e.startClocks.timeStamp,de())):Lm(n.body,()=>{t(me(e.startClocks.timeStamp,de()))},{bytesLimit:Number.POSITIVE_INFINITY})}function sl(e){return Wn(e)&&e<0?void 0:e}function il({lifeCycle:e,isChildEvent:t,onChange:n=z}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},s=e.subscribe(13,i=>{var o;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case"error":r.errorCount+=1,n();break;case"action":r.actionCount+=1,i.action.frustration&&(r.frustrationCount+=i.action.frustration.type.length),n();break;case"long_task":r.longTaskCount+=1,n();break;case"resource":!((o=i._dd)===null||o===void 0)&&o.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{s.unsubscribe()},eventCounts:r}}function I1(e,t){const n=Ve();let r=!1;const{stop:s}=Ne(e,window,["click","mousedown","keydown","touchstart","pointerdown"],a=>{if(!a.cancelable)return;const c={entryType:"first-input",processingStart:ze(),processingEnd:ze(),startTime:a.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};a.type==="pointerdown"?i(e,c):o(c)},{passive:!0,capture:!0});return{stop:s};function i(a,c){Ne(a,window,["pointerup","pointercancel"],l=>{l.type==="pointerup"&&o(c)},{once:!0})}function o(a){if(!r){r=!0,s();const c=a.processingStart-a.startTime;c>=0&&c<Ve()-n&&t(a)}}}var H;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(H||(H={}));function tt(e,t){return new G(n=>{if(!window.PerformanceObserver)return;const r=c=>{const l=P1(c);l.length>0&&n.notify(l)};let s,i=!0;const o=new PerformanceObserver(U(c=>{i?s=fe(()=>r(c.getEntries())):r(c.getEntries())}));try{o.observe(t)}catch{if([H.RESOURCE,H.NAVIGATION,H.LONG_TASK,H.PAINT].includes(t.type)){t.buffered&&(s=fe(()=>r(performance.getEntriesByType(t.type))));try{o.observe({entryTypes:[t.type]})}catch{return}}}i=!1,k1(e);let a;return!jt(H.FIRST_INPUT)&&t.type===H.FIRST_INPUT&&({stop:a}=I1(e,c=>{r([c])})),()=>{o.disconnect(),a&&a(),Pe(s)}})}let sr;function k1(e){return!sr&&O1()&&"addEventListener"in performance&&(sr=Z(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{sr==null||sr.stop()}}function O1(){return window.performance!==void 0&&"getEntries"in performance}function jt(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function P1(e){return e.filter(t=>!L1(t))}function L1(e){return e.entryType===H.RESOURCE&&(!_i(e.name)||!Yc(e))}const ol=100,N1=100;function vi(e,t,n,r,s,i){const o=D1(e,t,n,r);return M1(o,s,i)}function M1(e,t,n){let r,s=!1;const i=fe(U(()=>l({hadActivity:!1})),ol),o=n!==void 0?fe(U(()=>l({hadActivity:!0,end:de()})),n):void 0,a=e.subscribe(({isBusy:u})=>{Pe(i),Pe(r);const d=de();u||(r=fe(U(()=>l({hadActivity:!0,end:d})),N1))}),c=()=>{s=!0,Pe(i),Pe(r),Pe(o),a.unsubscribe()};function l(u){s||(c(),t(u))}return{stop:c}}function D1(e,t,n,r){return new G(s=>{const i=[];let o,a=0;return i.push(t.subscribe(c),n.subscribe(c),tt(r,{type:H.RESOURCE}).subscribe(l=>{l.some(u=>!Ei(r,u.name))&&c()}),e.subscribe(7,l=>{Ei(r,l.url)||(o===void 0&&(o=l.requestIndex),a+=1,c())}),e.subscribe(8,l=>{Ei(r,l.url)||o===void 0||l.requestIndex<o||(a-=1,c())})),()=>{i.forEach(l=>l.unsubscribe())};function c(){s.notify({isBusy:a>0})}})}function Ei(e,t){return Lc(e.excludedActivityUrls,t)}function al(e){return e.nodeType===Node.TEXT_NODE}function F1(e){return e.nodeType===Node.COMMENT_NODE}function bn(e){return e.nodeType===Node.ELEMENT_NODE}function os(e){return bn(e)&&!!e.shadowRoot}function Ci(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&bn(t.host)}function B1(e){return e.childNodes.length>0||os(e)}function cl(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;os(e)&&t(e.shadowRoot)}function as(e){return Ci(e)?e.host:e.parentNode}const M={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Xn.ALLOW,MASK:Xn.MASK,MASK_USER_INPUT:Xn.MASK_USER_INPUT},xi="data-dd-privacy",U1="hidden",$1="dd-privacy-",Et="***",ll="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",V1={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},z1="x";function nt(e,t,n){if(n&&n.has(e))return n.get(e);const r=as(e),s=r?nt(r,t,n):t,i=dl(e),o=ul(i,s);return n&&n.set(e,o),o}function ul(e,t){switch(t){case M.HIDDEN:case M.IGNORE:return t}switch(e){case M.ALLOW:case M.MASK:case M.MASK_USER_INPUT:case M.HIDDEN:case M.IGNORE:return e;default:return t}}function dl(e){if(bn(e)){if(e.tagName==="BASE")return M.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return M.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return M.MASK}if(e.matches(wn(M.HIDDEN)))return M.HIDDEN;if(e.matches(wn(M.MASK)))return M.MASK;if(e.matches(wn(M.MASK_USER_INPUT)))return M.MASK_USER_INPUT;if(e.matches(wn(M.ALLOW)))return M.ALLOW;if(j1(e))return M.IGNORE}}function cs(e,t){switch(t){case M.MASK:case M.HIDDEN:case M.IGNORE:return!0;case M.MASK_USER_INPUT:return al(e)?fl(e.parentNode):fl(e);default:return!1}}function fl(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!V1[t.tagName]}const H1=e=>e.replace(/\S/g,z1);function pl(e,t,n){var r;const s=(r=e.parentElement)===null||r===void 0?void 0:r.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const o=n;if(s==="SCRIPT")i=Et;else if(o===M.HIDDEN)i=Et;else if(cs(e,o))if(s==="DATALIST"||s==="SELECT"||s==="OPTGROUP"){if(!i.trim())return}else s==="OPTION"?i=Et:i=H1(i);return i}function j1(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),s=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(s)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(s)||/^product:/.test(s)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function wn(e){return`[${xi}="${e}"], .${$1}${e}`}const Ti="data-dd-action-name",W1="Masked Element";function q1(e,{enablePrivacyForActionName:t,actionNameAttribute:n},r){const s=hl(e,Ti)||n&&hl(e,n);return s?{name:s,nameSource:"custom_attribute"}:r===M.MASK?{name:W1,nameSource:"mask_placeholder"}:gl(e,n,K1,t)||gl(e,n,G1,t)||{name:"",nameSource:"blank"}}function hl(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return yl(ml(r.trim()))}const K1=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return ls(e.labels[0],t)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return ls(e,t,n)},e=>ir(e,"aria-label"),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(s=>J1(e,s)).filter(s=>!!s).map(s=>bl(s,t,n)).join(" "),nameSource:"text_content"}},e=>ir(e,"alt"),e=>ir(e,"name"),e=>ir(e,"title"),e=>ir(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return ls(e.options[0],t)}],G1=[(e,t,n)=>ls(e,t,n)],Y1=10;function gl(e,t,n,r){let s=e,i=0;for(;i<=Y1&&s&&s.nodeName!=="BODY"&&s.nodeName!=="HTML"&&s.nodeName!=="HEAD";){for(const o of n){const a=o(s,t,r);if(a){const{name:c,nameSource:l}=a,u=c&&c.trim();if(u)return{name:yl(ml(u)),nameSource:l}}}if(s.nodeName==="FORM")break;s=s.parentElement,i+=1}}function ml(e){return e.replace(/\s+/g," ")}function yl(e){return e.length>100?`${$a(e,100)} [...]`:e}function J1(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function ir(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function ls(e,t,n){return{name:bl(e,t,n)||"",nameSource:"text_content"}}function bl(e,t,n){if(!e.isContentEditable){if("innerText"in e){let r=e.innerText;const s=i=>{const o=e.querySelectorAll(i);for(let a=0;a<o.length;a+=1){const c=o[a];if("innerText"in c){const l=c.innerText;l&&l.trim().length>0&&(r=r.replace(l,""))}}};return s(`[${Ti}]`),t&&s(`[${t}]`),n&&s(`${wn(M.HIDDEN)}, ${wn(M.MASK)}`),r}return e.textContent}}const wl=[Ti,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Z1=[_l,Q1],X1=[_l,e0,t0];function or(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const s=vl(r,Z1,r0,t,n);if(s)return s;n=vl(r,X1,s0,t,n)||us(n0(r),n),r=r.parentElement}return n}function Sl(e){return/[0-9]/.test(e)}function Q1(e){if(e.id&&!Sl(e.id))return`#${CSS.escape(e.id)}`}function e0(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!Sl(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function t0(e){return CSS.escape(e.tagName)}function _l(e,t){if(t){const r=n(t);if(r)return r}for(const r of wl){const s=n(r);if(s)return s}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function n0(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function vl(e,t,n,r,s){for(const i of t){const o=i(e,r);if(o&&n(e,o,s))return us(o,s)}}function r0(e,t,n){return e.ownerDocument.querySelectorAll(us(t,n)).length===1}function s0(e,t,n){let r;if(n===void 0)r=o=>o.matches(t);else{const o=us(`${t}:scope`,n);r=a=>a.querySelector(o)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&r(i))return!1;i=i.nextElementSibling}return!0}function us(e,t){return t?`${e}>${t}`:e}const El=Se,i0=100;function o0(e,t){const n=[];let r=0,s;i(e);function i(c){c.stopObservable.subscribe(o),n.push(c),Pe(s),s=fe(a,El)}function o(){r===1&&n.every(c=>c.isStopped())&&(r=2,t(n))}function a(){Pe(s),r===0&&(r=1,o())}return{tryAppend:c=>r!==0?!1:n.length>0&&!a0(n[n.length-1].event,c.event)?(a(),!1):(i(c),!0),stop:()=>{a()}}}function a0(e,t){return e.target===t.target&&c0(e,t)<=i0&&e.timeStamp-t.timeStamp<=El}function c0(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function l0(e,{onPointerDown:t,onPointerUp:n}){let r,s={selection:!1,input:!1,scroll:!1},i;const o=[Z(e,window,"pointerdown",a=>{xl(a)&&(r=Cl(),s={selection:!1,input:!1,scroll:!1},i=t(a))},{capture:!0}),Z(e,window,"selectionchange",()=>{(!r||!Cl())&&(s.selection=!0)},{capture:!0}),Z(e,window,"scroll",()=>{s.scroll=!0},{capture:!0,passive:!0}),Z(e,window,"pointerup",a=>{if(xl(a)&&i){const c=s;n(i,a,()=>c),i=void 0}},{capture:!0}),Z(e,window,"input",()=>{s.input=!0},{capture:!0})];return{stop:()=>{o.forEach(a=>a.stop())}}}function Cl(){const e=window.getSelection();return!e||e.isCollapsed}function xl(e){return e.target instanceof Element&&e.isPrimary!==!1}const Tl=3;function u0(e,t){if(d0(e))return t.addFrustration("rage_click"),e.some(Al)&&t.addFrustration("dead_click"),t.hasError&&t.addFrustration("error_click"),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration("error_click"),Al(r)&&!n&&r.addFrustration("dead_click")}),{isRage:!1}}function d0(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(Tl-1);t+=1)if(e[t+Tl-1].event.timeStamp-e[t].event.timeStamp<=Se)return!0;return!1}const f0='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Al(e){return e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll?!1:!e.event.target.matches(f0)}const Rl=10*Se,ar=new Map;function p0(e){const t=ar.get(e);return ar.delete(e),t}function Il(e,t){ar.set(e,t),ar.forEach((n,r)=>{me(r,ze())>Rl&&ar.delete(r)})}const h0=5*Oe;function g0(e,t,n,r){const s=hn({expireDelay:h0}),i=new G;let o;e.subscribe(10,()=>{s.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===mn.UNLOADING&&u()});const{stop:a}=l0(r,{onPointerDown:d=>m0(r,e,t,d,n),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},h,p)=>{y0(r,e,t,n,s,i,l,d,h,p,f)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:d=>s.findAll(d)}};function l(d){if(!o||!o.tryAppend(d)){const f=d.clone();o=o0(d,h=>{w0(h,f)})}}function u(){o&&o.stop()}}function m0(e,t,n,r,s){const i=e.enablePrivacyForActionName?nt(r.target,e.defaultPrivacyLevel):M.ALLOW;if(i===M.HIDDEN)return;const o=b0(r,i,e);let a=!1;return vi(t,n,s,e,c=>{a=c.hadActivity},ol),{clickActionBase:o,hadActivityOnPointerDown:()=>a}}function y0(e,t,n,r,s,i,o,a,c,l,u){var d;const f=kl(t,s,l,a,c);o(f);const h=(d=a==null?void 0:a.target)===null||d===void 0?void 0:d.selector;h&&Il(c.timeStamp,h);const{stop:p}=vi(t,n,r,e,w=>{w.hadActivity&&w.end<f.startClocks.timeStamp?f.discard():w.hadActivity?f.stop(w.end):u()?f.stop(f.startClocks.timeStamp):f.stop()},Rl),g=t.subscribe(5,({endClocks:w})=>{f.stop(w.timeStamp)}),m=i.subscribe(()=>{f.stop()});f.stopObservable.subscribe(()=>{g.unsubscribe(),p(),m.unsubscribe()})}function b0(e,t,n){const r=e.target.getBoundingClientRect(),s=or(e.target,n.actionNameAttribute);s&&Il(e.timeStamp,s);const i=q1(e.target,n,t);return{type:"click",target:{width:Math.round(r.width),height:Math.round(r.height),selector:s},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:i.name,nameSource:i.nameSource}}function kl(e,t,n,r,s){const i=ye(),o=xe(),a=t.add(i,o.relative),c=il({lifeCycle:e,isChildEvent:p=>p.action!==void 0&&(Array.isArray(p.action.id)?p.action.id.includes(i):p.action.id===i)});let l=0,u;const d=[],f=new G;function h(p){l===0&&(u=p,l=1,u?a.close(zs(u)):a.remove(),c.stop(),f.notify())}return{event:s,stop:h,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return u!==void 0},getUserActivity:n,addFrustration:p=>{d.push(p)},startClocks:o,isStopped:()=>l===1||l===2,clone:()=>kl(e,t,n,r,s),validate:p=>{if(h(),l!==1)return;const{resourceCount:g,errorCount:m,longTaskCount:w}=c.eventCounts,v={duration:u&&me(o.timeStamp,u),startClocks:o,id:i,frustrationTypes:d,counts:{resourceCount:g,errorCount:m,longTaskCount:w},events:p??[s],event:s,...r};e.notify(0,v),l=2},discard:()=>{h(),l=2}}}function w0(e,t){const{isRage:n}=u0(e,t);n?(e.forEach(r=>r.discard()),t.stop(de()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function S0(e,t,n,r,s){e.subscribe(0,a=>e.notify(12,Ol(a))),t.register(0,({startTime:a,eventType:c})=>{if(c!=="error"&&c!=="resource"&&c!=="long_task")return;const l=i.findActionId(a);if(l)return{type:c,action:{id:l}}});let i={findActionId:z},o=z;return s.trackUserInteractions&&({actionContexts:i,stop:o}=g0(e,n,r,s)),{addAction:a=>{e.notify(12,Ol(a))},actionContexts:i,stop:o}}function Ol(e){const t=ds(e)?{action:{id:e.id,loading_time:sl(B(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:void 0,n=Ge({action:{id:ye(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:"action"},t),r=ds(e)?e.duration:void 0,s=ds(e)?void 0:e.context,i=ds(e)?{events:e.events}:{handlingStack:e.handlingStack};return{customerContext:s,rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function ds(e){return e.type!=="custom"}function _0(e){const t=xm([Ur.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function v0(e,t){const n=vg(e,[tr.cspViolation,tr.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function E0(e,t){const n=new G;return _0(n),yg(n),v0(t,n),n.subscribe(r=>e.notify(14,{error:r})),C0(e)}function C0(e){return e.subscribe(14,({error:t,customerContext:n})=>{n=Ge(t.context,n),e.notify(12,{customerContext:n,...x0(t)})}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:s,context:i})=>{const o=vt(t)?_t(t):void 0,a=ac({stackTrace:o,originalError:t,handlingStack:n,componentStack:r,startClocks:s,nonErrorPrefix:"Provided",source:fn.CUSTOM,handling:"handled"});e.notify(14,{customerContext:i,error:a})}}}function x0(e){const t={date:e.startClocks.timeStamp,error:{id:ye(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:"error"},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const Pl=new WeakSet;function T0(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!Pl.has(r)).filter(r=>Yc(r)&&Jc(r)).filter(r=>A0(r,e.startClocks.relative,Ll({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return Pl.add(n[0]),n[0].toJSON()}function Ll(e){return nn(e.startTime,e.duration)}function A0(e,t,n){return e.startTime>=t-1&&Ll(e)<=nn(n,1)}const R0=2*Oe;function I0(e){const t=k0(e)||O0(e);if(!(!t||t.traceTime<=Ve()-R0))return t.traceId}function k0(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return Nl(t&&t.content,n&&n.content)}function O0(e){const t=P0(e);if(t)return Nl(Yn(t,"trace-id"),Yn(t,"trace-time"))}function Nl(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function P0(e){for(let t=0;t<e.childNodes.length;t+=1){const n=Ml(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=Ml(n);if(r)return r;if(!al(n))break}}function Ml(e){if(e&&F1(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function Dl(){if(jt(H.NAVIGATION)){const n=performance.getEntriesByType(H.NAVIGATION)[0];if(n)return n}const e=L0(),t={entryType:H.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function L0(){const e={},t=performance.timing;for(const n in t)if(Wn(t[n])){const r=n,s=t[r];e[r]=s===0?0:zs(s)}return e}function N0(e,t,n=Dl){fi(e,"interactive",()=>{const r=n(),s=Object.assign(r.toJSON(),{entryType:H.RESOURCE,initiatorType:qc,duration:r.responseEnd,traceId:I0(document),toJSON:()=>({...s,toJSON:void 0})});t(s)})}function M0(e,t,n,r=Cm(),s=N0){e.subscribe(8,a=>{o(()=>D0(a,t,n))});const i=tt(t,{type:H.RESOURCE,buffered:!0}).subscribe(a=>{for(const c of a)S1(c)||o(()=>Fl(c,t))});s(t,a=>{o(()=>Fl(a,t))});function o(a){r.push(()=>{const c=a();c&&e.notify(12,c)})}return{stop:()=>{i.unsubscribe()}}}function D0(e,t,n){const r=T0(e),s=r?zr(r.startTime):e.startClocks,i=F0(e,t);if(!t.trackResources&&!i)return;const o=e.type==="xhr"?"xhr":"fetch",a=r?Bl(r):void 0,c=r?Gc(r):U0(n,s,e.duration),l=Ge({date:s.timeStamp,resource:{id:ye(),type:o,duration:B(c),method:e.method,status_code:e.status,protocol:r&&Zc(r),url:el(e.url)?tl(e.url):e.url,delivery_type:r&&Xc(r)},type:"resource",_dd:{discarded:!t.trackResources}},i,a);return{startTime:s.relative,duration:c,rawRumEvent:l,domainContext:{performanceEntry:r,xhr:e.xhr,response:e.response,requestInput:e.input,requestInit:e.init,error:e.error,isAborted:e.isAborted,handlingStack:e.handlingStack}}}function Fl(e,t){const n=zr(e.startTime),r=B0(e,t);if(!t.trackResources&&!r)return;const s=w1(e),i=Bl(e),o=Gc(e),a=Ge({date:n.timeStamp,resource:{id:ye(),type:s,duration:B(o),url:e.name,status_code:$0(e.responseStatus),protocol:Zc(e),delivery_type:Xc(e)},type:"resource",_dd:{discarded:!t.trackResources}},r,i);return{startTime:n.relative,duration:o,rawRumEvent:a,domainContext:{performanceEntry:e}}}function Bl(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...E1(e),..._1(e)}}}function F0(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function B0(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Fc().toString(),rule_psr:t.rulePsr}}}function U0(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function $0(e){return e===0?void 0:e}function V0(e,t,n){const{stop:r,eventCounts:s}=il({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:r,eventCounts:s}}const z0=10*Oe;function H0(e,t,n){return{stop:tt(e,{type:H.PAINT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.name==="first-contentful-paint"&&o.startTime<t.timeStamp&&o.startTime<z0);i&&n(i.startTime)}).unsubscribe}}function j0(e,t,n){const r=tt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.startTime<t.timeStamp);if(i){const o=me(i.startTime,i.processingStart);let a;i.target&&bn(i.target)&&(a=or(i.target,e.actionNameAttribute)),n({delay:o>=0?o:0,time:i.startTime,targetSelector:a})}});return{stop:()=>{r.unsubscribe()}}}function W0(e,t,n=Dl){return G0(e,()=>{const r=n();K0(r)||t(q0(r))})}function q0(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=ze()?e.responseStart:void 0}}function K0(e){return e.loadEventEnd<=0}function G0(e,t){let n;const{stop:r}=fi(e,"complete",()=>{n=fe(()=>t())});return{stop:()=>{r(),Pe(n)}}}const Y0=10*Oe;function J0(e,t,n,r){let s=1/0;const{stop:i}=Ne(e,n,["pointerdown","keydown"],c=>{s=c.timeStamp},{capture:!0,once:!0});let o=0;const a=tt(e,{type:H.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(c=>{const l=th(c,u=>u.entryType===H.LARGEST_CONTENTFUL_PAINT&&u.startTime<s&&u.startTime<t.timeStamp&&u.startTime<Y0&&u.size>o);if(l){let u;l.element&&(u=or(l.element,e.actionNameAttribute)),r({value:l.startTime,targetSelector:u,resourceUrl:Z0(l)}),o=l.size}});return{stop:()=>{i(),a.unsubscribe()}}}function Z0(e){return e.url===""?void 0:e.url}function Ul(e,t=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:z};if(jt(H.VISIBILITY_STATE)){const s=performance.getEntriesByType(H.VISIBILITY_STATE).find(i=>i.name==="hidden");if(s)return{timeStamp:s.startTime,stop:z}}let n=1/0;const{stop:r}=Ne(e,t,["pagehide","visibilitychange"],s=>{(s.type==="pagehide"||document.visibilityState==="hidden")&&(n=s.timeStamp,r())},{capture:!0});return{get timeStamp(){return n},stop:r}}function X0(e,t,n){const r={},{stop:s}=W0(e,u=>{t(u.loadEvent),r.navigationTimings=u,n()}),i=Ul(e),{stop:o}=H0(e,i,u=>{r.firstContentfulPaint=u,n()}),{stop:a}=J0(e,i,window,u=>{r.largestContentfulPaint=u,n()}),{stop:c}=j0(e,i,u=>{r.firstInput=u,n()});function l(){s(),o(),a(),c(),i.stop()}return{stop:l,initialViewMetrics:r}}function Q0(e,t,n){if(!sy())return{stop:z};let r=0,s;n({value:0});const i=ry(),o=tt(e,{type:H.LAYOUT_SHIFT,buffered:!0}).subscribe(a=>{var c;for(const l of a){if(l.hadRecentInput||l.startTime<t)continue;const{cumulatedValue:u,isMaxValue:d}=i.update(l);if(d){const f=ey(l.sources);s={target:f!=null&&f.node?new WeakRef(f.node):void 0,time:me(t,l.startTime),previousRect:f==null?void 0:f.previousRect,currentRect:f==null?void 0:f.currentRect,devicePixelRatio:window.devicePixelRatio}}if(u>r){r=u;const f=(c=s==null?void 0:s.target)===null||c===void 0?void 0:c.deref();n({value:Vr(r,4),targetSelector:f&&or(f,e.actionNameAttribute),time:s==null?void 0:s.time,previousRect:s!=null&&s.previousRect?$l(s.previousRect):void 0,currentRect:s!=null&&s.currentRect?$l(s.currentRect):void 0,devicePixelRatio:s==null?void 0:s.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function ey(e){return e.find(t=>!!t.node&&bn(t.node))}function $l({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const ty=5*Se,ny=Se;function ry(){let e=0,t,n,r=0;return{update:s=>{const i=t===void 0||s.startTime-n>=ny||s.startTime-t>=ty;let o;return i?(t=n=s.startTime,r=e=s.value,o=!0):(e+=s.value,n=s.startTime,o=s.value>r,o&&(r=s.value)),{cumulatedValue:e,isMaxValue:o}}}}function sy(){return jt(H.LAYOUT_SHIFT)&&"WeakRef"in window}let fs,Vl=0,Ai=1/0,Ri=0;function iy(){"interactionCount"in performance||fs||(fs=new window.PerformanceObserver(U(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(Ai=Math.min(Ai,n.interactionId),Ri=Math.max(Ri,n.interactionId),Vl=(Ri-Ai)/7+1)})})),fs.observe({type:"event",buffered:!0,durationThreshold:0}))}const zl=()=>fs?Vl:window.performance.interactionCount||0,Hl=10,oy=1*Oe;function ay(e,t,n){if(!uy())return{getInteractionToNextPaint:()=>{},setViewEnd:z,stop:z};const{getViewInteractionCount:r,stopViewInteractionCount:s}=ly(n);let i=1/0;const o=cy(r);let a=-1,c,l;function u(h){for(const g of h)g.interactionId&&g.startTime>=t&&g.startTime<=i&&o.process(g);const p=o.estimateP98Interaction();p&&p.duration!==a&&(a=p.duration,l=me(t,p.startTime),c=p0(p.startTime),!c&&p.target&&bn(p.target)&&(c=or(p.target,e.actionNameAttribute)))}const d=tt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(u),f=tt(e,{type:H.EVENT,durationThreshold:40,buffered:!0}).subscribe(u);return{getInteractionToNextPaint:()=>{if(a>=0)return{value:Math.min(a,oy),targetSelector:c,time:l};if(r())return{value:0}},setViewEnd:h=>{i=h,s()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function cy(e){const t=[];function n(){t.sort((r,s)=>s.duration-r.duration).splice(Hl)}return{process(r){const s=t.findIndex(o=>r.interactionId===o.interactionId),i=t[t.length-1];s!==-1?r.duration>t[s].duration&&(t[s]=r,n()):(t.length<Hl||r.duration>i.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function ly(e){iy();const t=e==="initial_load"?0:zl();let n={stopped:!1};function r(){return zl()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function uy(){return jt(H.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function dy(e,t,n,r,s,i,o){let a=s==="initial_load",c=!0;const l=[],u=Ul(r);function d(){if(!c&&!a&&l.length>0){const h=Math.max(...l);h<u.timeStamp&&o(h)}}const{stop:f}=vi(e,t,n,r,h=>{c&&(c=!1,h.hadActivity&&l.push(me(i.timeStamp,h.end)),d())});return{stop:()=>{f(),u.stop()},setLoadEvent:h=>{a&&(a=!1,l.push(h),d())}}}function jl(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Ii(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let ki;function Wl(e){return ki||(ki=fy(e)),ki}function fy(e){return new G(t=>{const{throttled:n}=wt(()=>{t.notify(ps())},200);return Z(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function ps(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const py=Se;function hy(e,t,n,r=my(e)){let s=0,i=0,o=0;const a=r.subscribe(({scrollDepth:c,scrollTop:l,scrollHeight:u})=>{let d=!1;if(c>s&&(s=c,d=!0),u>i){i=u;const f=ze();o=me(t.relative,f),d=!0}d&&n({maxDepth:Math.min(s,i),maxDepthScrollTop:l,maxScrollHeight:i,maxScrollHeightTime:o})});return{stop:()=>a.unsubscribe()}}function gy(){const e=Ii(),{height:t}=ps(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function my(e,t=py){return new G(n=>{function r(){n.notify(gy())}if(window.ResizeObserver){const s=wt(r,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,o=new ResizeObserver(U(s.throttled));i&&o.observe(i);const a=Z(e,window,"scroll",s.throttled,{passive:!0});return()=>{s.cancel(),o.disconnect(),a.stop()}}})}function yy(e,t,n,r,s,i,o){const a={},{stop:c,setLoadEvent:l}=dy(e,t,n,r,i,o,g=>{a.loadingTime=g,s()}),{stop:u}=hy(r,o,g=>{a.scroll=g}),{stop:d}=Q0(r,o.relative,g=>{a.cumulativeLayoutShift=g,s()}),{stop:f,getInteractionToNextPaint:h,setViewEnd:p}=ay(r,o.relative,i);return{stop:()=>{c(),d(),u()},stopINPTracking:f,setLoadEvent:l,setViewEnd:p,getCommonViewMetrics:()=>(a.interactionToNextPaint=h(),a)}}const by=3e3,wy=5*Oe,Sy=5*Oe;function _y(e,t,n,r,s,i,o,a){const c=new Set;let l=d("initial_load",Ma(),a);f();let u;o&&(u=h(i));function d(p,g,m){const w=vy(t,n,r,s,e,p,g,m);return c.add(w),w.stopObservable.subscribe(()=>{c.delete(w)}),w}function f(){t.subscribe(10,()=>{l=d("route_change",void 0,{name:l.name,service:l.service,version:l.version,context:l.contextManager.getContext()})}),t.subscribe(9,()=>{l.end({sessionIsActive:!1})})}function h(p){return p.subscribe(({oldLocation:g,newLocation:m})=>{Cy(g,m)&&(l.end(),l=d("route_change"))})}return{addTiming:(p,g=de())=>{l.addTiming(p,g)},startView:(p,g)=>{l.end({endClocks:g}),l=d("route_change",g,p)},setViewContext:p=>{l.contextManager.setContext(p)},setViewContextProperty:(p,g)=>{l.contextManager.setContextProperty(p,g)},setViewName:p=>{l.setViewName(p)},getViewContext:()=>l.contextManager.getContext(),stop:()=>{u&&u.unsubscribe(),l.end(),c.forEach(p=>p.stop())}}}function vy(e,t,n,r,s,i,o=xe(),a){const c=ye(),l=new G,u={};let d=0,f;const h=Gn(s),p=ss();let g=!0,m=a==null?void 0:a.name;const w=(a==null?void 0:a.service)||r.service,v=(a==null?void 0:a.version)||r.version,b=a==null?void 0:a.context;b&&p.setContext(b);const _={id:c,name:m,startClocks:o,service:w,version:v,context:b};e.notify(1,_),e.notify(2,_);const{throttled:k,cancel:x}=wt(ne,by,{leading:!1}),{setLoadEvent:y,setViewEnd:R,stop:C,stopINPTracking:I,getCommonViewMetrics:A}=yy(e,t,n,r,X,i,o),{stop:O,initialViewMetrics:P}=i==="initial_load"?X0(r,y,X):{stop:z,initialViewMetrics:{}},{stop:N,eventCounts:Q}=V0(e,c,X),ge=rn(ne,wy),$e=e.subscribe(11,ee=>{ee.reason===mn.UNLOADING&&ne()});ne(),p.changeObservable.subscribe(X);function qe(){e.notify(3,{id:c,name:m,context:p.getContext(),startClocks:o})}function X(){qe(),k()}function ne(){x(),qe(),d+=1;const ee=f===void 0?de():f.timeStamp;e.notify(4,{customTimings:u,documentVersion:d,id:c,name:m,service:w,version:v,context:p.getContext(),loadingType:i,location:h,startClocks:o,commonViewMetrics:A(),initialViewMetrics:P,duration:me(o.timeStamp,ee),isActive:f===void 0,sessionIsActive:g,eventCounts:Q})}return{get name(){return m},service:w,version:v,contextManager:p,stopObservable:l,end(ee={}){var Re,ve;f||(f=(Re=ee.endClocks)!==null&&Re!==void 0?Re:xe(),g=(ve=ee.sessionIsActive)!==null&&ve!==void 0?ve:!0,e.notify(5,{endClocks:f}),e.notify(6,{endClocks:f}),jr(ge),R(f.relative),C(),$e.unsubscribe(),ne(),fe(()=>{this.stop()},Sy))},stop(){O(),N(),I(),l.notify()},addTiming(ee,Re){if(f)return;const ve=Hp(Re)?Re:me(o.timeStamp,Re);u[Ey(ee)]=ve,X()},setViewName(ee){m=ee,ne()}}}function Ey(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&V.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Cy(e,t){return e.pathname!==t.pathname||!xy(t.hash)&&ql(t.hash)!==ql(e.hash)}function xy(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function ql(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Ty(e,t,n,r,s,i,o,a,c,l){return e.subscribe(4,u=>e.notify(12,Ay(u,n,a))),t.register(0,({startTime:u,eventType:d})=>{const{service:f,version:h,id:p,name:g,context:m}=c.findView(u);return{type:d,service:f,version:h,context:m,view:{id:p,name:g}}}),_y(r,e,s,i,n,o,!n.trackViewsManually,l)}function Ay(e,t,n){var r,s,i,o,a,c,l,u,d,f,h,p,g,m,w,v,b,_;const k=n.getReplayStats(e.id),x=(s=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||s===void 0?void 0:s.devicePixelRatio,y={_dd:{document_version:e.documentVersion,replay_stats:k,cls:x?{device_pixel_ratio:x}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:"view",view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:B((o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.time),cumulative_layout_shift_target_selector:(a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.targetSelector,first_byte:B((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:B((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.domComplete),dom_content_loaded:B((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domContentLoaded),dom_interactive:B((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:B(e.initialViewMetrics.firstContentfulPaint),first_input_delay:B((f=e.initialViewMetrics.firstInput)===null||f===void 0?void 0:f.delay),first_input_time:B((h=e.initialViewMetrics.firstInput)===null||h===void 0?void 0:h.time),first_input_target_selector:(p=e.initialViewMetrics.firstInput)===null||p===void 0?void 0:p.targetSelector,interaction_to_next_paint:B((g=e.commonViewMetrics.interactionToNextPaint)===null||g===void 0?void 0:g.value),interaction_to_next_paint_time:B((m=e.commonViewMetrics.interactionToNextPaint)===null||m===void 0?void 0:m.time),interaction_to_next_paint_target_selector:(w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:B((v=e.initialViewMetrics.largestContentfulPaint)===null||v===void 0?void 0:v.value),largest_contentful_paint_target_selector:(b=e.initialViewMetrics.largestContentfulPaint)===null||b===void 0?void 0:b.targetSelector,load_event:B((_=e.initialViewMetrics.navigationTimings)===null||_===void 0?void 0:_.loadEvent),loading_time:sl(B(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Ry(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:B(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:B(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:k?!0:void 0,is_active:e.sessionIsActive?void 0:!1},privacy:{replay_level:t.defaultPrivacyLevel}};return Lt(e.customTimings)||(y.view.custom_timings=qp(e.customTimings,B)),{rawRumEvent:y,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Ry({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:s}){return{cls:e&&{score:e.value,timestamp:B(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:B(n)},fid:r&&{duration:B(r.delay),timestamp:B(r.time),target_selector:r.targetSelector},inp:t&&{duration:B(t.value),timestamp:B(t.time),target_selector:t.targetSelector},lcp:s&&{timestamp:B(s.value),target_selector:s.targetSelector,resource_url:s.resourceUrl}}}const Iy="rum";function ky(e,t,n){const r=zg(e,Iy,s=>Py(e,s),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:s,newState:i})=>{if(!s.forcedReplay&&i.forcedReplay){const o=r.findSession();o&&(o.isReplayForced=!0)}}),{findTrackedSession:s=>{const i=r.findSession(s);if(!(!i||!Kl(i.trackingType)))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function Oy(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Ac("records")?1:0};return{findTrackedSession:()=>e,expire:z,expireObservable:new G,setForcedReplay:z}}function Py(e,t){let n;return Ly(t)?n=t:yt(e.sessionSampleRate)?yt(e.sessionReplaySampleRate)?n="1":n="2":n="0",{trackingType:n,isTracked:Kl(n)}}function Ly(e){return e==="0"||e==="1"||e==="2"}function Kl(e){return e==="2"||e==="1"}function Ny(e,t,n,r,s,i,o){const a=e.replica,c=cm(e,{endpoint:e.rumEndpointBuilder,encoder:o(2)},a&&{endpoint:a.rumEndpointBuilder,transformMessage:l=>Ge(l,{application:{id:a.applicationId}}),encoder:o(3)},r,s,i);return t.subscribe(13,l=>{l.type==="view"?c.upsert(l,l.view.id):c.add(l)}),n.subscribe(l=>c.add(l,Ng(e))),c}function My(e){const t=gn();e.subscribe(13,n=>{t.send("rum",n)})}const Dy=Mt;function Fy(e,t,n,r){const s=hn({expireDelay:Dy});let i;e.subscribe(1,({startClocks:c})=>{const l=r.href;s.add(a({url:l,referrer:i||document.referrer}),c.relative),i=l}),e.subscribe(6,({endClocks:c})=>{s.closeActive(c.relative)});const o=n.subscribe(({newLocation:c})=>{const l=s.find();if(l){const u=ze();s.closeActive(u),s.add(a({url:c.href,referrer:l.referrer}),u)}});function a({url:c,referrer:l}){return{url:c,referrer:l}}return t.register(0,({startTime:c,eventType:l})=>{const{url:u,referrer:d}=s.find(c);return{type:l,view:{url:u,referrer:d}}}),{findUrl:c=>s.find(c),getAllEntries:()=>s.getAllEntries(),getDeletedEntries:()=>s.getDeletedEntries(),stop:()=>{o.unsubscribe(),s.stop()}}}function By(e,t){let n=Gn(t);return new G(r=>{const{stop:s}=Uy(e,o),{stop:i}=$y(e,o);function o(){if(n.href===t.href)return;const a=Gn(t);r.notify({newLocation:a,oldLocation:n}),n=a}return()=>{s(),i()}})}function Uy(e,t){const{stop:n}=Le(Gl("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:r}=Le(Gl("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:s}=Z(e,window,"popstate",t);return{stop:()=>{n(),r(),s()}}}function $y(e,t){return Z(e,window,"hashchange",t)}function Gl(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Vy=Mt;function zy(e,t,n){const r=hn({expireDelay:Vy});return e.subscribe(1,({startClocks:s})=>{r.add({},s.relative)}),e.subscribe(6,({endClocks:s})=>{r.closeActive(s.relative)}),t.register(0,({startTime:s,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat(["view","error"]).includes(i))return;const a=r.find(s);if(!(!a||Lt(a)))return{type:i,feature_flags:a}}),{addFeatureFlagEvaluation:(s,i)=>{const o=r.find();o&&(o[s]=i)}}}const Hy=10*Se;let Sn,Oi;function jy(e,t,n,r){t.enabled&&yt(e.customerDataTelemetrySampleRate)&&(Zl(),Oi=!1,n.subscribe(13,()=>{Oi=!0}),r.subscribe(({bytesCount:i,messagesCount:o})=>{Oi&&(Sn.batchCount+=1,Jl(Sn.batchBytesCount,i),Jl(Sn.batchMessagesCount,o))}),rn(Wy,Hy))}function Wy(){Sn.batchCount!==0&&(ft("Customer data measures",Sn),Zl())}function Yl(){return{min:1/0,max:0,sum:0}}function Jl(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function Zl(){Sn={batchCount:0,batchBytesCount:Yl(),batchMessagesCount:Yl()}}const qy=4e3,Ky=500,Gy=Mt;function Yy(e,t,n=Ky){const r=hn({expireDelay:Gy,maxEntries:qy});let s;o(Xl(),ze());const{stop:i}=Ne(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],c=>{o(Zy(c),c.timeStamp)},{capture:!0});function o(c,l=ze()){c!==s&&(s=c,r.closeActive(l),r.add({state:s,startTime:l},l))}function a(c,l,u){return r.findAll(l,u).some(d=>d.state===c)}return e.register(0,({startTime:c,duration:l=0,eventType:u})=>{if(u==="view"){const d=r.findAll(c,l);return{type:u,_dd:{page_states:Jy(d,c,n)}}}if(u==="action"||u==="error")return{type:u,view:{in_foreground:a("active",c,0)}}}),{wasInPageStateDuringPeriod:a,addPageState:o,stop:()=>{i(),r.stop()}}}function Jy(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:s})=>({state:r,start:B(me(t,s))}))}function Zy(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":Xl()}function Xl(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Xy(e){let t;const n=requestAnimationFrame(U(()=>{t=ps()})),r=Wl(e).subscribe(s=>{t=s}).unsubscribe;return{get:()=>t?{viewport:t}:void 0,stop:()=>{r(),n&&cancelAnimationFrame(n)}}}const Qy=Se;function eb(e){return new G(t=>tb(e,n=>t.notify(n)))}function tb(e,t){const n=Yn(document.cookie,e),r=rn(()=>{const s=Yn(document.cookie,e);s!==n&&t(s)},Qy);return()=>jr(r)}const Ql="datadog-ci-visibility-test-execution-id";function nb(e,t=eb(Ql)){var n;let r=St(Ql)||((n=window.Cypress)===null||n===void 0?void 0:n.env("traceId"));const s=t.subscribe(i=>{r=i});return e.register(0,({eventType:i})=>{if(typeof r=="string")return{type:i,session:{type:"ci_test"},ci_test:{test_execution_id:r}}}),{stop:()=>{s.unsubscribe()}}}function rb(e,t){const n=tt(t,{type:H.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const s of r){const i=zr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-animation-frame",duration:B(s.duration),blocking_duration:B(s.blockingDuration),first_ui_event_timestamp:B(s.firstUIEventTimestamp),render_start:B(s.renderStart),style_and_layout_start:B(s.styleAndLayoutStart),start_time:B(s.startTime),scripts:s.scripts.map(a=>({duration:B(a.duration),pause_duration:B(a.pauseDuration),forced_style_and_layout_duration:B(a.forcedStyleAndLayoutDuration),start_time:B(a.startTime),execution_start:B(a.executionStart),source_url:a.sourceURL,source_function_name:a.sourceFunctionName,source_char_position:a.sourceCharPosition,invoker:a.invoker,invoker_type:a.invokerType,window_attribution:a.windowAttribution}))},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop:()=>n.unsubscribe()}}function sb(e,t){const n=tt(t,{type:H.LONG_TASK,buffered:!0}).subscribe(r=>{for(const s of r){if(s.entryType!==H.LONG_TASK||!t.trackLongTasks)break;const i=zr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-task",duration:B(s.duration)},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop(){n.unsubscribe()}}}function ib(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const s=(e[t]||[]).map(i=>i(n));return Ge(...s)}}}function ob(e){e.register(0,({eventType:t})=>{const n=Fm(),r=Bm();if(!(!n||!r))return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:Pc()}}})}function ab(e,t,n){const r=ci(e),s=n(r);return Ys(t).forEach(([i,o])=>Pi(e,r,i.split(/\.|(?=\[\])/),o)),s}function Pi(e,t,n,r){const[s,...i]=n;if(s==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((o,a)=>Pi(o,t[a],i,r));return}if(!(!eu(e)||!eu(t))){if(i.length>0)return Pi(e[s],t[s],i,r);cb(e,s,t[s],r)}}function cb(e,t,n,r){const s=$t(n);s===r?e[t]=ie(n):r==="object"&&(s==="undefined"||s==="null")&&(e[t]={})}function eu(e){return $t(e)==="object"}const _n={"view.name":"string","view.url":"string","view.referrer":"string"},vn={context:"object"},Li={service:"string",version:"string"};let tu;function lb(e,t,n,r,s,i,o,a,c){tu={view:{"view.performance.lcp.resource_url":"string",...vn,..._n},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...vn,..._n,...Li},resource:{"resource.url":"string",...es(Ut.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...vn,..._n,...Li},action:{"action.target.name":"string",...vn,..._n,...Li},long_task:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...vn,..._n},vital:{...vn,..._n}};const l={error:di("error",e.eventRateLimiterThreshold,c),action:di("action",e.eventRateLimiterThreshold,c),vital:di("vital",e.eventRateLimiterThreshold,c)};t.subscribe(12,({startTime:u,duration:d,rawRumEvent:f,domainContext:h,customerContext:p})=>{const g=s.findView(u),m=i.findUrl(u),w=r.findTrackedSession(u);if(w&&g&&!m&&es(Ut.MISSING_URL_CONTEXT_TELEMETRY)&&ft("Missing URL entry",{debug:{eventType:f.type,startTime:u,urlEntries:i.getAllEntries(),urlDeletedEntries:i.getDeletedEntries(),viewEntries:s.getAllEntries(),viewDeletedEntries:s.getDeletedEntries()}}),w&&g&&m){const v=a(),b={_dd:{format_version:2,drift:Vp(),configuration:{session_sample_rate:Vr(e.sessionSampleRate,3),session_replay_sample_rate:Vr(e.sessionReplaySampleRate,3)},browser_sdk_version:zt()?"6.6.3":void 0},application:{id:e.applicationId},date:de(),source:"browser",session:{id:w.id,type:"user"},display:o.get(),connectivity:hc(),context:v.context},_=Ge(b,n.triggerHook(0,{eventType:f.type,startTime:u,duration:d}),{context:p},f);"has_replay"in _.session||(_.session.has_replay=v.hasReplay),_.type==="view"&&(_.session.sampled_for_replay=w.sessionReplay===1),w.anonymousId&&!v.user.anonymous_id&&e.trackAnonymousUser&&(v.user.anonymous_id=w.anonymousId),Lt(v.user)||(_.usr=v.user),!Lt(v.account)&&v.account.id&&(_.account=v.account),ub(_,e.beforeSend,h,l)&&(Lt(_.context)&&delete _.context,t.notify(13,_))}})}function ub(e,t,n,r){var s;if(t){const o=ab(e,tu[e.type],a=>t(a,n));if(o===!1&&e.type!=="view")return!1;o===!1&&V.warn("Can't dismiss view events using beforeSend!")}return!((s=r[e.type])===null||s===void 0?void 0:s.isLimitReached())}function db(e,t,n,r){return{context:e.getContext(),user:t.getContext(),account:n.getContext(),hasReplay:r.isRecording()?!0:void 0}}function fb(e,t,n,r,s,i,o){const a=[],c=new g1,l=ib();c.subscribe(13,ce=>ai("rum",ce));const u=pb(e);u.setContextProvider(()=>{var ce,Pn;return{application:{id:e.applicationId},session:{id:(ce=p.findTrackedSession())===null||ce===void 0?void 0:ce.id},view:{id:(Pn=v.findView())===null||Pn===void 0?void 0:Pn.id},action:{id:A.findActionId()}}});const d=ce=>{c.notify(14,{error:ce}),ft("Error reported to customer",{"error.message":ce.message})},f=im(e),h=f.subscribe(ce=>{c.notify(11,ce)});a.push(()=>h.unsubscribe());const p=zt()?Oy():ky(e,c,i);if(zt())My(c);else{const ce=Ny(e,c,u.observable,d,f,p.expireObservable,s);a.push(()=>ce.stop()),jy(e,u,c,ce.flushObservable)}const g=f1(),m=By(e,location),w=Yy(l,e),v=y1(c),b=Fy(c,l,m,location),_=zy(c,l,e),{observable:k,stop:x}=p1();a.push(x);const y=i1(e),R=o1(e),C=a1(e),I=()=>db(y,R,C,t),{actionContexts:A,addAction:O,stop:P}=hb(c,l,e,p,w,g,k,b,v,I,d);a.push(P),Lg();const{addTiming:N,startView:Q,setViewName:ge,setViewContext:$e,setViewContextProperty:qe,getViewContext:X,stop:ne}=Ty(c,l,e,location,g,k,m,t,v,r);a.push(ne);const{stop:ee}=M0(c,e,w);if(a.push(ee),e.trackLongTasks)if(jt(H.LONG_ANIMATION_FRAME)){const{stop:ce}=rb(c,e);a.push(ce)}else sb(c,e);const{addError:Re}=E0(c,e);x1(c,e,p,I);const ve=$m(c,w,o),Co=h1(e.applicationId,p,v,A,b);return a.push(()=>n.stop()),{addAction:O,addError:Re,addTiming:N,addFeatureFlagEvaluation:_.addFeatureFlagEvaluation,startView:Q,setViewContext:$e,setViewContextProperty:qe,getViewContext:X,setViewName:ge,lifeCycle:c,viewHistory:v,session:p,stopSession:()=>p.expire(),getInternalContext:Co.get,startDurationVital:ve.startDurationVital,stopDurationVital:ve.stopDurationVital,addDurationVital:ve.addDurationVital,globalContext:y,userContext:R,accountContext:C,stop:()=>{a.forEach(ce=>ce())}}}function pb(e){const t=Og("browser-rum-sdk",e);if(zt()){const n=gn();t.observable.subscribe(r=>n.send("internal_telemetry",r))}return t}function hb(e,t,n,r,s,i,o,a,c,l,u){const d=S0(e,t,i,o,n),f=Xy(n),h=nb(t);return ob(t),lb(n,e,t,r,c,a,f,l,u),{pageStateHistory:s,addAction:d.addAction,actionContexts:d.actionContexts,stop:()=>{d.stop(),h.stop(),f.stop(),c.stop(),s.stop(),a.stop()}}}function gb(e,{session:t,viewContext:n,errorType:r}){const s=t?t.id:"no-session-id",i=[];r!==void 0&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const o=mb(e),a=`/rum/replay/sessions/${s}`;return`${o}${a}?${i.join("&")}`}function mb(e){const t=e.site,n=e.subdomain||yb(e);return`https://${n?`${n}.`:""}${t}`}function yb(e){switch(e.site){case Bt:case kh:return"app";case nc:return"dd";default:return}}const bb=1e3;let He;function wb(e){return hs(e).segments_count}function Sb(e){hs(e).segments_count+=1}function _b(e){hs(e).records_count+=1}function vb(e,t){hs(e).segments_total_raw_size+=t}function Eb(e){return He==null?void 0:He.get(e)}function hs(e){He||(He=new Map);let t;return He.has(e)?t=He.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},He.set(e,t),He.size>bb&&Cb()),t}function Cb(){if(!He)return;const e=He.keys().next().value;e&&He.delete(e)}function nu(e,t,n){let r=0,s=[],i,o=0;const a=[],{stop:c}=Z(e,t,"message",({data:d})=>{if(d.type!=="wrote"||d.streamId!==n)return;r+=d.additionalBytesCount,s.push(d.result),i=d.trailer;const f=a.shift();f&&f.id===d.id?f.writeCallback?f.writeCallback(d.result.byteLength):f.finishCallback&&f.finishCallback():(c(),ft("Worker responses received out of order."))});function l(){const d=s.length===0?new Uint8Array(0):Wp(s.concat(i)),f={rawBytesCount:r,output:d,outputBytesCount:d.byteLength,encoding:"deflate"};return r=0,s=[],f}function u(){o>0&&(t.postMessage({action:"reset",streamId:n}),o=0)}return{isAsync:!0,get isEmpty(){return o===0},write(d,f){t.postMessage({action:"write",id:o,data:d,streamId:n}),a.push({id:o,writeCallback:f,data:d}),o+=1},finish(d){u(),a.length?(a.forEach(f=>{delete f.writeCallback}),a[a.length-1].finishCallback=()=>d(l())):d(l())},finishSync(){u();const d=a.map(f=>(delete f.writeCallback,delete f.finishCallback,f.data)).join("");return{...l(),pendingData:d}},estimateEncodedBytesCount(d){return d.length/8},stop(){c()}}}function Ni({configuredUrl:e,error:t,source:n,scriptType:r}){if(V.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&xb(t.message)){let s;e?s=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:s="Please make sure CSP is correctly configured.",V.error(`${s} See documentation at ${$r}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&li(t)}function xb(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Tb=30*Se;function ru(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},et=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-J)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=L(s.adler,h,o,l):2===s.state.wrap&&(s.adler=T(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},at=function(t,e){for(var a,n;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},nt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var it=[new rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(et(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)})),new rt(4,4,8,4,at),new rt(4,5,16,8,at),new rt(4,6,32,32,at),new rt(4,4,16,16,nt),new rt(8,16,32,32,nt),new rt(8,16,128,128,nt),new rt(8,32,128,256,nt),new rt(32,128,258,1024,nt),new rt(32,258,258,4096,nt)];function st(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var ht=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=it[e.level].max_lazy,e.good_match=it[e.level].good_length,e.nice_match=it[e.level].nice_length,e.max_chain_length=it[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},lt=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(et(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(et(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):it[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},_t=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},ot=new Uint8Array(256),dt=0;dt<256;dt++)ot[dt]=dt>=252?6:dt>=248?5:dt>=240?4:dt>=224?3:dt>=192?2:1;ot[254]=ot[254]=1;var ut=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ft=Object.prototype.toString;function ct(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ut,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new st;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,ht(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ft.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,et(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function pt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function gt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}ct.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ft.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=lt(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=_t(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ct.prototype.onData=function(t){this.chunks.push(t)},ct.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.6.3"};case"write":{let n=e.get(a.streamId);n||(n=new ct,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:gt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){pt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){pt(e,t)}}()})();'])))}let oe={status:0};function su(e,t,n,r=ru){switch(oe.status===0&&Ab(e,t,r),oe.status){case 1:return oe.initializationFailureCallbacks.push(n),oe.worker;case 3:return oe.worker}}function iu(){return oe.status}function Ab(e,t,n=ru){try{const r=n(e),{stop:s}=Z(e,r,"error",a=>{Mi(e,t,a)}),{stop:i}=Z(e,r,"message",({data:a})=>{a.type==="errored"?Mi(e,t,a.error,a.streamId):a.type==="initialized"&&Ib(a.version)});r.postMessage({action:"init"}),fe(()=>Rb(t),Tb),oe={status:1,worker:r,stop:()=>{s(),i()},initializationFailureCallbacks:[]}}catch(r){Mi(e,t,r)}}function Rb(e){oe.status===1&&(V.error(`${e} failed to start: a timeout occurred while initializing the Worker`),oe.initializationFailureCallbacks.forEach(t=>t()),oe={status:2})}function Ib(e){oe.status===1&&(oe={status:3,worker:oe.worker,stop:oe.stop,version:e})}function Mi(e,t,n,r){oe.status===1||oe.status===0?(Ni({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),oe.status===1&&oe.initializationFailureCallbacks.forEach(s=>s()),oe={status:2}):li(n,{worker_version:oe.status===3&&oe.version,stream_id:r})}function ou(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function kb(e,t,n,r){const s=t.findTrackedSession(),i=Ob(s,r),o=n.findView();return gb(e,{viewContext:o,errorType:i,session:s})}function Ob(e,t){if(!ou())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function Pb(e,t,n,r,s,i){let o=0,a;t.subscribe(9,()=>{(o===2||o===3)&&(u(),o=1)}),t.subscribe(10,()=>{o===1&&l()});const c=async()=>{const[d]=await Promise.all([s(),dm(e,"interactive")]);if(o!==2)return;const f=i();if(!f||!d){o=0;return}({stop:a}=d(t,e,n,r,f)),o=3};function l(d){const f=n.findTrackedSession();if(Lb(f,d)){o=1;return}Nb(o)||(o=2,c().catch(dt),Mb(f,d)&&n.setForcedReplay())}function u(){o===3&&(a==null||a()),o=0}return{start:l,stop:u,getSessionReplayLink(){return kb(e,n,r,o!==0)},isRecording:()=>o===3}}function Lb(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function Nb(e){return e===2||e===3}function Mb(e,t){return t&&t.force&&e.sessionReplay===0}function Db(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:z},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Fb(e,t){if(zt()&&!Ac("records")||!ou())return{start:z,stop:z,getReplayStats:()=>{},onRumStart:z,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=Db();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:s,isRecording:()=>iu()===3&&n.isRecording(),getReplayStats:i=>iu()===3?Eb(i):void 0};function s(i,o,a,c,l){let u;function d(){return u||(l??(l=su(o,"Datadog Session Replay",()=>{n.stop()},t)),l&&(u=nu(o,l,1))),u}n=Pb(o,i,a,c,e,d),r(o)&&n.start()}}async function Bb(e=Ub){try{return await e()}catch(t){Ni({error:t,source:"Recorder",scriptType:"module"})}}async function Ub(){return(await Promise.resolve().then(()=>ov)).startRecording}function $b(){return et().Profiler!==void 0}async function Vb(e=zb){try{return await e()}catch(t){Ni({error:t,source:"Profiler",scriptType:"module"})}}async function zb(){return(await Promise.resolve().then(()=>Sv)).createRumProfiler}function Hb(){let e;function t(n,r,s,i){!$b()||!yt(r.profilingSampleRate)||Vb().then(o=>{if(!o){ft("[DD_RUM] Failed to lazy load the RUM Profiler");return}e=o(r,n,s),e.start(i.findView())}).catch(dt)}return{onRumStart:t,stop:()=>{e==null||e.stop().catch(dt)}}}const jb=Fb(Bb),Wb=Hb(),Be=u1(fb,jb,Wb,{startDeflateWorker:su,createDeflateEncoder:nu});_g(et(),"DD_RUM",Be);const On=class On{init(){if(On.isInitialized){console.info("Tracker [DD]: already initialized");return}Be.init({applicationId:"3ea6bf90-69cc-42fe-9e69-d461f783221d",clientToken:"pub51a171e3f587fb85f6d3f0ed2bf8f531",site:"datadoghq.com",service:"astropay-payments-library",env:"production",version:"0.1.2",sessionSampleRate:50,sessionReplaySampleRate:10,defaultPrivacyLevel:"mask-user-input",trackViewsManually:!0,trackResources:!1,trackUserInteractions:!1,beforeSend:t=>this.filterEvents(t)}),Be.startView({name:"ap_cl_view_mounted"}),Be.startSessionReplayRecording(),On.isInitialized=!0,console.info("Tracker [DD]: initialized")}track(t,n){Be==null||Be.addAction(t,n||{})}trackError(t,n){Be==null||Be.addError(t,{context:n})}destroy(){console.info("Tracker [DD]: destroying"),typeof Be.stopSessionReplayRecording=="function"&&Be.stopSessionReplayRecording(),Be.addAction("ap_cl_view_unmounted",{reason:"component_destroyed"}),On.isInitialized=!1}filterEvents(t){var n,r,s;return!!(t.type==="view"&&((n=t.view.name)!=null&&n.startsWith("ap_cl_"))||t.type==="action"&&typeof((r=t.action.target)==null?void 0:r.name)=="string"&&t.action.target.name.startsWith("ap_cl_")||t.type==="error"&&((s=t.error)==null?void 0:s.source)==="custom")}};T(On,"isInitialized",!1);let Di=On,En=[];class je{static init(t){if(!t){console.info("Tracking disabled");return}En=[new Di],En.forEach(n=>n.init())}static trackEvent(t,n){En.forEach(r=>r.track(t,n))}static trackError(t,n){En.forEach(r=>r.trackError(t,n))}static destroy(){En.forEach(t=>t.destroy()),En=[]}}const he=class he{static init(t,n){if(!t)throw console.error('AstroPay Payments Library: Missing "app-id". Call init function first.'),new Error("app-id is required for authentication.");if(he.isInitialized){console.warn("AstroPay Payments Library: Already initialized.");return}he.token=t,je.init((n==null?void 0:n.tracking)??!0),$.init({theme:(n==null?void 0:n.theme)??"light",styles:(n==null?void 0:n.styles)??{}}),te.init({language:(n==null?void 0:n.language)??"en"}),Nn.init({environment:(n==null?void 0:n.environment)??"production",currencyMode:(n==null?void 0:n.currencyMode)??"iso"}),mt.init({appName:"ap-cl",baseURL:"https://partners-api.astropay.com/api",timeout:5e3}),je.trackEvent("ap_cl_init",{app_id:t,origin:window.location.origin}),he.isInitialized=!0}static registerComponent(t){he.components.add(t)}static unregisterComponent(t){he.components.delete(t)}static getToken(){if(!he.isInitialized){const t="AstroPay Payments Library: Not initialized.";throw console.error(t),new Error(t)}return he.token}static destroy(){he.isInitialized&&(he.components.forEach(t=>t.destroy()),he.components.clear(),he.isInitialized=!1,je.destroy(),he.token="")}static isLibInitialized(){return he.isInitialized}};T(he,"isInitialized",!1),T(he,"token"),T(he,"components",new Set);let rt=he;class ae{constructor({tag:t,elementId:n,styles:r}){T(this,"element");if(this.element=document.createElement(t),n&&this.element.setAttribute("id",n),r){const s=$.getStyles(),i=r(s);this.element.className=i}}addStyleClass(t){this.element.classList.add(t)}render(t){t instanceof ae?t.element.appendChild(this.element):t.appendChild(this.element)}destroy(){this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}function qb(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Kb(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Gb=function(){function e(n){var r=this;this._insertTag=function(s){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,i),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Kb(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var i=qb(s);try{i.insertRule(r,i.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),_e="-ms-",gs="-moz-",j="-webkit-",au="comm",Fi="rule",Bi="decl",Yb="@import",cu="@keyframes",Jb="@layer",Zb=Math.abs,ms=String.fromCharCode,Xb=Object.assign;function Qb(e,t){return be(e,0)^45?(((t<<2^be(e,0))<<2^be(e,1))<<2^be(e,2))<<2^be(e,3):0}function lu(e){return e.trim()}function ew(e,t){return(e=t.exec(e))?e[0]:e}function W(e,t,n){return e.replace(t,n)}function Ui(e,t){return e.indexOf(t)}function be(e,t){return e.charCodeAt(t)|0}function cr(e,t,n){return e.slice(t,n)}function st(e){return e.length}function $i(e){return e.length}function ys(e,t){return t.push(e),e}function tw(e,t){return e.map(t).join("")}var bs=1,Cn=1,uu=0,Me=0,le=0,xn="";function ws(e,t,n,r,s,i,o){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:bs,column:Cn,length:o,return:""}}function lr(e,t){return Xb(ws("",null,null,"",null,null,0),e,{length:-e.length},t)}function nw(){return le}function rw(){return le=Me>0?be(xn,--Me):0,Cn--,le===10&&(Cn=1,bs--),le}function Ue(){return le=Me<uu?be(xn,Me++):0,Cn++,le===10&&(Cn=1,bs++),le}function it(){return be(xn,Me)}function Ss(){return Me}function ur(e,t){return cr(xn,e,t)}function dr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function du(e){return bs=Cn=1,uu=st(xn=e),Me=0,[]}function fu(e){return xn="",e}function _s(e){return lu(ur(Me-1,Vi(e===91?e+2:e===40?e+1:e)))}function sw(e){for(;(le=it())&&le<33;)Ue();return dr(e)>2||dr(le)>3?"":" "}function iw(e,t){for(;--t&&Ue()&&!(le<48||le>102||le>57&&le<65||le>70&&le<97););return ur(e,Ss()+(t<6&&it()==32&&Ue()==32))}function Vi(e){for(;Ue();)switch(le){case e:return Me;case 34:case 39:e!==34&&e!==39&&Vi(le);break;case 40:e===41&&Vi(e);break;case 92:Ue();break}return Me}function ow(e,t){for(;Ue()&&e+le!==57;)if(e+le===84&&it()===47)break;return"/*"+ur(t,Me-1)+"*"+ms(e===47?e:Ue())}function aw(e){for(;!dr(it());)Ue();return ur(e,Me)}function cw(e){return fu(vs("",null,null,null,[""],e=du(e),0,[0],e))}function vs(e,t,n,r,s,i,o,a,c){for(var l=0,u=0,d=o,f=0,h=0,p=0,g=1,m=1,w=1,v=0,b="",_=s,k=i,x=r,y=b;m;)switch(p=v,v=Ue()){case 40:if(p!=108&&be(y,d-1)==58){Ui(y+=W(_s(v),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:y+=_s(v);break;case 9:case 10:case 13:case 32:y+=sw(p);break;case 92:y+=iw(Ss()-1,7);continue;case 47:switch(it()){case 42:case 47:ys(lw(ow(Ue(),Ss()),t,n),c);break;default:y+="/"}break;case 123*g:a[l++]=st(y)*w;case 125*g:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+u:w==-1&&(y=W(y,/\f/g,"")),h>0&&st(y)-d&&ys(h>32?hu(y+";",r,n,d-1):hu(W(y," ","")+";",r,n,d-2),c);break;case 59:y+=";";default:if(ys(x=pu(y,t,n,l,u,s,a,b,_=[],k=[],d),i),v===123)if(u===0)vs(y,t,x,x,_,i,d,a,k);else switch(f===99&&be(y,3)===110?100:f){case 100:case 108:case 109:case 115:vs(e,x,x,r&&ys(pu(e,x,x,0,0,s,a,b,s,_=[],d),k),s,k,d,a,r?_:k);break;default:vs(y,x,x,x,[""],k,0,a,k)}}l=u=h=0,g=w=1,b=y="",d=o;break;case 58:d=1+st(y),h=p;default:if(g<1){if(v==123)--g;else if(v==125&&g++==0&&rw()==125)continue}switch(y+=ms(v),v*g){case 38:w=u>0?1:(y+="\f",-1);break;case 44:a[l++]=(st(y)-1)*w,w=1;break;case 64:it()===45&&(y+=_s(Ue())),f=it(),u=d=st(b=y+=aw(Ss())),v++;break;case 45:p===45&&st(y)==2&&(g=0)}}return i}function pu(e,t,n,r,s,i,o,a,c,l,u){for(var d=s-1,f=s===0?i:[""],h=$i(f),p=0,g=0,m=0;p<r;++p)for(var w=0,v=cr(e,d+1,d=Zb(g=o[p])),b=e;w<h;++w)(b=lu(g>0?f[w]+" "+v:W(v,/&\f/g,f[w])))&&(c[m++]=b);return ws(e,t,n,s===0?Fi:a,c,l,u)}function lw(e,t,n){return ws(e,t,n,au,ms(nw()),cr(e,2,-2),0)}function hu(e,t,n,r){return ws(e,t,n,Bi,cr(e,0,r),cr(e,r+1,-1),r)}function Tn(e,t){for(var n="",r=$i(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function uw(e,t,n,r){switch(e.type){case Jb:if(e.children.length)break;case Yb:case Bi:return e.return=e.return||e.value;case au:return"";case cu:return e.return=e.value+"{"+Tn(e.children,r)+"}";case Fi:e.value=e.props.join(",")}return st(n=Tn(e.children,r))?e.return=e.value+"{"+n+"}":""}function dw(e){var t=$i(e);return function(n,r,s,i){for(var o="",a=0;a<t;a++)o+=e[a](n,r,s,i)||"";return o}}function fw(e){return function(t){t.root||(t=t.return)&&e(t)}}function pw(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var hw=function(t,n,r){for(var s=0,i=0;s=i,i=it(),s===38&&i===12&&(n[r]=1),!dr(i);)Ue();return ur(t,Me)},gw=function(t,n){var r=-1,s=44;do switch(dr(s)){case 0:s===38&&it()===12&&(n[r]=1),t[r]+=hw(Me-1,n,r);break;case 2:t[r]+=_s(s);break;case 4:if(s===44){t[++r]=it()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=ms(s)}while(s=Ue());return t},mw=function(t,n){return fu(gw(du(t),n))},gu=new WeakMap,yw=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!gu.get(r))&&!s){gu.set(t,!0);for(var i=[],o=mw(n,i),a=r.props,c=0,l=0;c<o.length;c++)for(var u=0;u<a.length;u++,l++)t.props[l]=i[c]?o[c].replace(/&\f/g,a[u]):a[u]+" "+o[c]}}},bw=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function mu(e,t){switch(Qb(e,t)){case 5103:return j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return j+e+gs+e+_e+e+e;case 6828:case 4268:return j+e+_e+e+e;case 6165:return j+e+_e+"flex-"+e+e;case 5187:return j+e+W(e,/(\w+).+(:[^]+)/,j+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return j+e+_e+"flex-item-"+W(e,/flex-|-self/,"")+e;case 4675:return j+e+_e+"flex-line-pack"+W(e,/align-content|flex-|-self/,"")+e;case 5548:return j+e+_e+W(e,"shrink","negative")+e;case 5292:return j+e+_e+W(e,"basis","preferred-size")+e;case 6060:return j+"box-"+W(e,"-grow","")+j+e+_e+W(e,"grow","positive")+e;case 4554:return j+W(e,/([^-])(transform)/g,"$1"+j+"$2")+e;case 6187:return W(W(W(e,/(zoom-|grab)/,j+"$1"),/(image-set)/,j+"$1"),e,"")+e;case 5495:case 3959:return W(e,/(image-set\([^]*)/,j+"$1$`$1");case 4968:return W(W(e,/(.+:)(flex-)?(.*)/,j+"box-pack:$3"+_e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+j+e+e;case 4095:case 3583:case 4068:case 2532:return W(e,/(.+)-inline(.+)/,j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(st(e)-1-t>6)switch(be(e,t+1)){case 109:if(be(e,t+4)!==45)break;case 102:return W(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+gs+(be(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ui(e,"stretch")?mu(W(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(be(e,t+1)!==115)break;case 6444:switch(be(e,st(e)-3-(~Ui(e,"!important")&&10))){case 107:return W(e,":",":"+j)+e;case 101:return W(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j+(be(e,14)===45?"inline-":"")+"box$3$1"+j+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(be(e,t+11)){case 114:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return j+e+_e+e+e}return e}var ww=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case Bi:t.return=mu(t.value,t.length);break;case cu:return Tn([lr(t,{value:W(t.value,"@","@"+j)})],s);case Fi:if(t.length)return tw(t.props,function(i){switch(ew(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Tn([lr(t,{props:[W(i,/:(read-\w+)/,":"+gs+"$1")]})],s);case"::placeholder":return Tn([lr(t,{props:[W(i,/:(plac\w+)/,":"+j+"input-$1")]}),lr(t,{props:[W(i,/:(plac\w+)/,":"+gs+"$1")]}),lr(t,{props:[W(i,/:(plac\w+)/,_e+"input-$1")]})],s)}return""})}},Sw=[ww],_w=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var s=t.stylisPlugins||Sw,i={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),w=1;w<m.length;w++)i[m[w]]=!0;a.push(g)});var c,l=[yw,bw];{var u,d=[uw,fw(function(g){u.insert(g)})],f=dw(l.concat(s,d)),h=function(m){return Tn(cw(m),f)};c=function(m,w,v,b){u=v,h(m?m+"{"+w.styles+"}":w.styles),b&&(p.inserted[w.name]=!0)}}var p={key:n,sheet:new Gb({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return p.sheet.hydrate(a),p};function vw(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ew={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Cw=/[A-Z]|^ms/g,xw=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yu=function(t){return t.charCodeAt(1)===45},bu=function(t){return t!=null&&typeof t!="boolean"},zi=pw(function(e){return yu(e)?e:e.replace(Cw,"-$&").toLowerCase()}),wu=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(xw,function(r,s,i){return Ct={name:s,styles:i,next:Ct},s})}return Ew[t]!==1&&!yu(t)&&typeof n=="number"&&n!==0?n+"px":n};function Es(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return Ct={name:s.name,styles:s.styles,next:Ct},s.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)Ct={name:o.name,styles:o.styles,next:Ct},o=o.next;var a=i.styles+";";return a}return Tw(e,t,n)}}var c=n;if(t==null)return c;var l=t[c];return l!==void 0?l:c}function Tw(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=Es(e,t,n[s])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=i+"{"+t[a]+"}":bu(a)&&(r+=zi(i)+":"+wu(i,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)bu(o[c])&&(r+=zi(i)+":"+wu(i,o[c])+";");else{var l=Es(e,t,o);switch(i){case"animation":case"animationName":{r+=zi(i)+":"+l+";";break}default:r+=i+"{"+l+"}"}}}return r}var Su=/label:\s*([^\s;{]+)\s*(;|$)/g,Ct;function Hi(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";Ct=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,s+=Es(n,t,i);else{var o=i;s+=o[0]}for(var a=1;a<e.length;a++)if(s+=Es(n,t,e[a]),r){var c=i;s+=c[a]}Su.lastIndex=0;for(var l="",u;(u=Su.exec(s))!==null;)l+="-"+u[1];var d=vw(s)+l;return{name:d,styles:s,next:Ct}}function _u(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var Aw=function(t,n,r){var s=t.key+"-"+n.name;t.registered[s]===void 0&&(t.registered[s]=n.styles)},Rw=function(t,n,r){Aw(t,n);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+s:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function vu(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Eu(e,t,n){var r=[],s=_u(e,r,n);return r.length<2?n:s+t(r)}var Iw=function(t){var n=_w(t);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered,void 0);return Rw(n,d),n.key+"-"+d.name},s=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered),f="animation-"+d.name;return vu(n,{name:d.name,styles:"@keyframes "+f+"{"+d.styles+"}"}),f},i=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered);vu(n,d)},o=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];return Eu(n.registered,r,kw(l))};return{css:r,cx:o,injectGlobal:i,keyframes:s,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:_u.bind(null,n.registered),merge:Eu.bind(null,n.registered,r)}},kw=function e(t){for(var n="",r=0;r<t.length;r++){var s=t[r];if(s!=null){var i=void 0;switch(typeof s){case"boolean":break;case"object":{if(Array.isArray(s))i=e(s);else{i="";for(var o in s)s[o]&&o&&(i&&(i+=" "),i+=o)}break}default:i=s}i&&(n&&(n+=" "),n+=i)}}return n},ji=Iw({key:"css"}),Ow=ji.cx,fr=ji.keyframes,K=ji.css;const Pw=(e,t)=>K`
|
|
19
|
+
${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.unsubscribe}}function Ic(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function am({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:s}){const i=r.subscribe(p=>u(p.reason)),o=s.subscribe(()=>u("session_expire")),a=new G(()=>()=>{i.unsubscribe(),o.unsubscribe()});let c=0,l=0;function u(p){if(l===0)return;const g=l,m=c;l=0,c=0,h(),a.notify({reason:p,messagesCount:g,bytesCount:m})}let d;function f(){d===void 0&&(d=fe(()=>{u("duration_limit")},n))}function h(){Pe(d),d=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(p){c+p>=t&&u("bytes_limit"),l+=1,c+=p,f()},notifyAfterAddMessage(p=0){c+=p,l>=e?u("messages_limit"):c>=t&&u("bytes_limit")},notifyAfterRemoveMessage(p){c-=p,l-=1,l===0&&h()}}}function cm(e,t,n,r,s,i,o=om){const a=l(e,t),c=n&&l(e,n);function l(u,{endpoint:d,encoder:f}){return o({encoder:f,request:xc(d,u.batchBytesLimit,r),flushController:am({messagesLimit:u.batchMessagesLimit,bytesLimit:u.batchBytesLimit,durationLimit:u.flushTimeout,pageMayExitObservable:s,sessionExpireObservable:i}),messageBytesLimit:u.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(u,d=!0){a.add(u),c&&d&&c.add(n.transformMessage?n.transformMessage(u):u)},upsert:(u,d)=>{a.upsert(u,d),c&&c.upsert(n.transformMessage?n.transformMessage(u):u,d)},stop:()=>{a.stop(),c&&c.stop()}}}function lm(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const s=Fa(n);t+=s,e+=n,r&&r(s)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class um{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(s=>s(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}function di(e,t,n){let r=0,s=!1;return{isLimitReached(){if(r===0&&fe(()=>{r=0},Oe),r+=1,r<=t||s)return s=!1,!1;if(r===t+1){s=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:fn.AGENT,startClocks:xe()})}finally{s=!1}}return!0}}}function fi(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:z}):Z(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function dm(e,t){return new Promise(n=>{fi(e,t,n)})}let pi;const hi=new WeakMap;function fm(e){return pi||(pi=pm(e)),pi}function pm(e){return new G(t=>{const{stop:n}=Le(XMLHttpRequest.prototype,"open",hm),{stop:r}=Le(XMLHttpRequest.prototype,"send",i=>{gm(i,e,t)},{computeHandlingStack:!0}),{stop:s}=Le(XMLHttpRequest.prototype,"abort",mm);return()=>{n(),r(),s()}})}function hm({target:e,parameters:[t,n]}){hi.set(e,{state:"open",method:String(t).toUpperCase(),url:Qs(String(n))})}function gm({target:e,handlingStack:t},n,r){const s=hi.get(e);if(!s)return;const i=s;i.state="start",i.startClocks=xe(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let o=!1;const{stop:a}=Le(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&c()}),c=()=>{if(l(),a(),o)return;o=!0;const u=s;u.state="complete",u.duration=me(i.startClocks.timeStamp,de()),u.status=e.status,r.notify(Gn(u))},{stop:l}=Z(n,e,"loadend",c);r.notify(i)}function mm({target:e}){const t=hi.get(e);t&&(t.isAborted=!0)}let gi;function kc(){return gi||(gi=ym()),gi}function ym(){return new G(e=>{if(!window.fetch)return;const{stop:t}=Le(window,"fetch",n=>bm(n,e),{computeHandlingStack:!0});return t})}function bm({parameters:e,onPostCall:t,handlingStack:n},r){const[s,i]=e;let o=i&&i.method;o===void 0&&s instanceof Request&&(o=s.method);const a=o!==void 0?String(o).toUpperCase():"GET",c=s instanceof Request?s.url:Qs(String(s)),l=xe(),u={state:"start",init:i,input:s,method:a,startClocks:l,url:c,handlingStack:n};r.notify(u),e[0]=u.input,e[1]=u.init,t(d=>wm(r,d,u))}function wm(e,t,n){const r=n;function s(i){r.state="resolve",Object.assign(r,i),e.notify(r)}t.then(U(i=>{s({response:i,responseType:i.type,status:i.status,isAborted:!1})}),U(i=>{var o,a;s({status:0,isAborted:((a=(o=r.init)===null||o===void 0?void 0:o.signal)===null||a===void 0?void 0:a.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function Oc(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(U(e),t);return()=>window.cancelIdleCallback(n)}return _m(e)}const Sm=50;function _m(e){const t=Ve(),n=fe(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,Sm-(Ve()-t))})},0);return()=>Pe(n)}const vm=Se,Em=30;function Cm(){const e=[];function t(r){let s;if(r.didTimeout){const i=performance.now();s=()=>Em-(performance.now()-i)}else s=r.timeRemaining.bind(r);for(;s()>0&&e.length;)e.shift()();e.length&&n()}function n(){Oc(t,{timeout:vm})}return{push(r){e.push(r)===1&&n()}}}let mi={};function xm(e){const t=e.map(n=>(mi[n]||(mi[n]=Tm(n)),mi[n]));return Ua(...t)}function Tm(e){return new G(t=>{const n=ut[e];return ut[e]=(...r)=>{n.apply(console,r);const s=ts("console error");Nt(()=>{t.notify(Am(r,e,s))})},()=>{ut[e]=n}})}function Am(e,t,n){const r=e.map(i=>Rm(i)).join(" ");let s;if(t===Ur.error){const i=e.find(vt);s={stack:i?dn(_t(i)):void 0,fingerprint:cc(i),causes:i?uc(i,"console"):void 0,startClocks:xe(),message:r,source:fn.CONSOLE,handling:"handled",handlingStack:n,context:lc(i),originalError:i}}return{api:t,message:r,error:s,handlingStack:n}}function Rm(e){return typeof e=="string"?ie(e):vt(e)?ic(_t(e)):on(ie(e),void 0,2)}function Im(e){const t=$t(e)==="object";return t||V.error("Unsupported context:",e),t}function yi(e,t,n){const r={...e};for(const[s,{required:i,type:o}]of Object.entries(t))o==="string"&&s in r&&(r[s]=String(r[s])),i&&!(s in e)&&V.warn(`The property ${s} of ${n} is required; context will not be sent to the intake.`);return r}function ss(e="",{propertiesConfig:t={}}={}){let n={};const r=new G,s={getContext:()=>ci(n),setContext:i=>{Im(i)?n=ie(yi(i,t,e)):s.clearContext(),r.notify()},setContextProperty:(i,o)=>{n=ie(yi({...n,[i]:o},t,e)),r.notify()},removeContextProperty:i=>{delete n[i],yi(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return s}const km="_dd_c",Om=[];function bi(e,t,n,r){const s=Pm(n,r);Om.push(Z(e,window,"storage",({key:l})=>{s===l&&o()})),t.changeObservable.subscribe(a);const i=Ge(c(),t.getContext());Lt(i)||t.setContext(i);function o(){t.setContext(c())}function a(){localStorage.setItem(s,JSON.stringify(t.getContext()))}function c(){const l=localStorage.getItem(s);return l?JSON.parse(l):{}}}function Pm(e,t){return`${km}_${e}_${t}`}const pe={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Ae={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function Lm(e,t,n){const r=e.getReader();let s=0;i();function i(){r.read().then(U(a=>{if(a.done){o();return}s+=a.value.length,s>n.bytesLimit?o():i()}),U(a=>t(a)))}function o(){r.cancel().catch(z),t(void 0,void 0,void 0)}}const Nm="datadog-synthetics-public-id",Mm="datadog-synthetics-result-id",Dm="datadog-synthetics-injects-rum";function Pc(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||St(Dm))}function Fm(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||St(Nm);return typeof e=="string"?e:void 0}function Bm(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||St(Mm);return typeof e=="string"?e:void 0}function wi(e){const t=$t(e);return t==="string"||t==="function"||e instanceof RegExp}function Lc(e,t,n=!1){return e.some(r=>{try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?t.startsWith(r):r===t}catch(s){V.error(s)}return!1})}function Um(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function $m(e,t,n){function r(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function s(i){r(i)&&e.notify(12,zm(i))}return{addDurationVital:s,startDurationVital:(i,o={})=>Nc(n,i,o),stopDurationVital:(i,o={})=>{Mc(s,n,i,o)}}}function Nc({vitalsByName:e,vitalsByReference:t},n,r={}){const s={name:n,startClocks:xe(),context:r.context,description:r.description},i={__dd_vital_reference:!0};return e.set(n,s),t.set(i,s),i}function Mc(e,{vitalsByName:t,vitalsByReference:n},r,s={}){const i=typeof r=="string"?t.get(r):n.get(r);i&&(e(Vm(i,i.startClocks,s,xe())),typeof r=="string"?t.delete(r):n.delete(r))}function Vm(e,t,n,r){var s;return{name:e.name,type:"duration",startClocks:t,duration:me(t.timeStamp,r.timeStamp),context:Ge(e.context,n.context),description:(s=n.description)!==null&&s!==void 0?s:e.description}}function zm(e,t){const n={date:e.startClocks.timeStamp,vital:{id:ye(),type:e.type,name:e.name,duration:B(e.duration),description:e.description},type:"vital"};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,customerContext:e.context,domainContext:{}}}function Dc(e,t,n){if(e)for(const r of e){const s=r[t];s&&s(n)}}function Hm(){return Bc(64)}function Fc(){return Bc(63)}function Bc(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],s=t[0],i="";do{const o=r%n*4294967296+s;r=Math.floor(r/n),s=Math.floor(o/n),i=(o%n).toString(n)+i}while(r||s);return i}}}function yn(e){return e.toString(16).padStart(16,"0")}let is;function jm(e,t){if(t===100)return!0;if(t===0)return!1;if(is&&e===is.sessionId)return is.decision;let n;return window.BigInt?n=Wm(BigInt(`0x${e.split("-")[4]}`),t):n=yt(t),is={sessionId:e,decision:n},n}function Wm(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),s=e*n%r;return Number(s)<=t/100*Number(r)}function qm(e){const t=e;return $t(t)==="object"&&wi(t.match)&&Array.isArray(t.propagatorTypes)}function Km(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Gm(e,t,n){return{clearTracingIfNeeded:Km,traceFetch:r=>Uc(e,r,t,n,s=>{var i;if(r.input instanceof Request&&!(!((i=r.init)===null||i===void 0)&&i.headers))r.input=new Request(r.input),Object.keys(s).forEach(o=>{r.input.headers.append(o,s[o])});else{r.init=Gn(r.init);const o=[];r.init.headers instanceof Headers?r.init.headers.forEach((a,c)=>{o.push([c,a])}):Array.isArray(r.init.headers)?r.init.headers.forEach(a=>{o.push(a)}):r.init.headers&&Object.keys(r.init.headers).forEach(a=>{o.push([a,r.init.headers[a]])}),r.init.headers=o.concat(Ys(s))}}),traceXhr:(r,s)=>Uc(e,r,t,n,i=>{Object.keys(i).forEach(o=>{s.setRequestHeader(o,i[o])})})}}function Uc(e,t,n,r,s){const i=n.findTrackedSession();if(!i)return;const o=e.allowedTracingUrls.find(l=>Lc([l.match],t.url,!0));if(!o)return;const a=jm(i.id,e.traceSampleRate);(a||e.traceContextInjection===ei.ALL)&&(t.traceSampled=a,t.traceId=Hm(),t.spanId=Fc(),s(Ym(t.traceId,t.spanId,t.traceSampled,o.propagatorTypes,r,e)))}function Ym(e,t,n,r,s,i){const o={};if(r.forEach(a=>{switch(a){case"datadog":{Object.assign(o,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(o,{traceparent:`00-0000000000000000${yn(e)}-${yn(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(o,{b3:`${yn(e)}-${yn(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(o,{"X-B3-TraceId":yn(e),"X-B3-SpanId":yn(t),"X-B3-Sampled":n?"1":"0"});break}}}),es(Ut.USER_ACCOUNT_TRACE_HEADER)&&i.propagateTraceBaggage){const a=s().user.id,c=s().account.id,l=[];typeof a=="string"&&l.push(`usr.id=${encodeURIComponent(a)}`),typeof c=="string"&&l.push(`account.id=${encodeURIComponent(c)}`),l.length>0&&(o.baggage=l.join(","))}return o}const $c=["tracecontext","datadog"];function Jm(e){var t,n,r,s,i,o,a;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&V.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){V.error("Application ID is not configured, no RUM data will be collected.");return}if(!ln(e.sessionReplaySampleRate,"Session Replay")||!ln(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){V.error("Excluded Activity Urls should be an array");return}const c=Zm(e);if(!c)return;const l=Wh(e);if(!l)return;const u=es(Ut.PROFILING),d=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,version:e.version||void 0,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:d,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:d===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:Wn(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:c,excludedActivityUrls:(r=e.excludedActivityUrls)!==null&&r!==void 0?r:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((s=e.trackUserInteractions)!==null&&s!==void 0)||s),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((o=e.trackLongTasks)!==null&&o!==void 0)||o),subdomain:e.subdomain,defaultPrivacyLevel:Hr(Xn,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Xn.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:Hr(ei,e.traceContextInjection)?e.traceContextInjection:ei.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:u&&(a=e.profilingSampleRate)!==null&&a!==void 0?a:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...l}}function Zm(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){V.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){V.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{wi(n)?t.push({match:n,propagatorTypes:$c}):qm(n)?t.push(n):V.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Xm(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{wi(n)?$c.forEach(r=>t.add(r)):$t(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Qm(e){var t;const n=qh(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:Xm(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var s;return{name:r.name,...(s=r.getConfigurationTelemetry)===null||s===void 0?void 0:s.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,...n}}const e1="v1";function t1(e,t){r1(e,n=>{t(n1(e,n))})}function n1(e,t){return{...e,...t}}function r1(e,t){const n=new XMLHttpRequest;Z(e,n,"load",function(){if(n.status===200){const r=JSON.parse(n.responseText);t(r.rum)}else Vc()}),Z(e,n,"error",function(){Vc()}),n.open("GET",s1(e)),n.send()}function s1(e){return`https://sdk-configuration.${rc("rum",e)}/${e1}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Vc(){V.error("Error fetching the remote configuration.")}function i1(e){const t=zc();return e.storeContextsAcrossPages&&bi(e,t,"rum",2),t}function zc(){return ss("global context")}function o1(e){const t=Hc();return e.storeContextsAcrossPages&&bi(e,t,"rum",1),t}function Hc(){return ss("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}function a1(e){const t=jc();return e.storeContextsAcrossPages&&bi(e,t,"rum",4),t}function jc(){return ss("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function c1({ignoreInitIfSyntheticsWillInjectRum:e,startDeflateWorker:t},n,r,s){const i=mc(),o=zc();Si(o,pe.globalContext,i);const a=Hc();Si(a,pe.userContext,i);const c=jc();Si(c,pe.accountContext,i);let l,u,d,f;const h=n.observable.subscribe(g),p={};function g(){if(!d||!f||!n.isGranted())return;h.unsubscribe();let b;if(f.trackViewsManually){if(!l)return;i.remove(l.callback),b=l.options}const _=s(f,u,b);i.drain(_)}function m(b){const _=zt();if(_&&(b=l1(b)),d=b,Mg(Qm(b)),f){dc("DD_RUM",b);return}const k=Jm(b);if(k){if(!_&&!k.sessionStoreStrategyType){V.warn("No storage available for session. We will not send any data.");return}k.compressIntakeRequests&&!_&&t&&(u=t(k,"Datadog RUM",z),!u)||(f=k,kc().subscribe(z),n.tryToInit(k.trackingConsent),g())}}const w=b=>{i.add(_=>_.addDurationVital(b))};return{init(b,_){if(!b){V.error("Missing configuration");return}Kh(b.enableExperimentalFeatures),d=b,!(e&&Pc())&&(Dc(b.plugins,"onInit",{initConfiguration:b,publicApi:_}),b.remoteConfigurationId?t1(b,m):m(b))},get initConfiguration(){return d},getInternalContext:z,stopSession:z,addTiming(b,_=de()){i.add(k=>k.addTiming(b,_))},startView(b,_=xe()){const k=x=>{x.startView(b,_)};i.add(k),l||(l={options:b,callback:k},g())},setViewName(b){i.add(_=>_.setViewName(b))},setViewContext(b){i.add(_=>_.setViewContext(b))},setViewContextProperty(b,_){i.add(k=>k.setViewContextProperty(b,_))},getViewContext:()=>p,globalContext:o,userContext:a,accountContext:c,addAction(b){i.add(_=>_.addAction(b))},addError(b){i.add(_=>_.addError(b))},addFeatureFlagEvaluation(b,_){i.add(k=>k.addFeatureFlagEvaluation(b,_))},startDurationVital(b,_){return Nc(r,b,_)},stopDurationVital(b,_){Mc(w,r,b,_)},addDurationVital:w}}function l1(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=gn())===null||n===void 0?void 0:n.getPrivacyLevel()}}function Si(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(s=>s[t].setContext(r))})}function u1(e,t,n,r={}){const s=xh(),i=Um();let o=c1(r,s,i,(u,d,f)=>{const h=e(u,t,n,f,d&&r.createDeflateEncoder?p=>r.createDeflateEncoder(u,d,p):lm,s,i);return t.onRumStart(h.lifeCycle,u,h.session,h.viewHistory,d),n.onRumStart(h.lifeCycle,u,h.session,h.viewHistory),o=d1(o,h),Dc(u.plugins,"onRumStart",{strategy:o}),h});const a=U(u=>{const d=typeof u=="object"?u:{name:u};o.startView(d),Te({feature:"start-view"})});function c(u,d,f){return U((...h)=>(Te({feature:f}),o[u][d](...h)))}const l=Sg({init:U(u=>{o.init(u,l)}),setTrackingConsent:U(u=>{s.update(u),Te({feature:"set-tracking-consent",tracking_consent:u})}),setViewName:U(u=>{o.setViewName(u),Te({feature:"set-view-name"})}),setViewContext:U(u=>{o.setViewContext(u),Te({feature:"set-view-context"})}),setViewContextProperty:U((u,d)=>{o.setViewContextProperty(u,d),Te({feature:"set-view-context-property"})}),getViewContext:U(()=>(Te({feature:"set-view-context-property"}),o.getViewContext())),getInternalContext:U(u=>o.getInternalContext(u)),getInitConfiguration:U(()=>ci(o.initConfiguration)),addAction:(u,d)=>{const f=ts("action");Nt(()=>{o.addAction({name:ie(u),context:ie(d),startClocks:xe(),type:"custom",handlingStack:f}),Te({feature:"add-action"})})},addError:(u,d)=>{const f=ts("error");Nt(()=>{o.addError({error:u,handlingStack:f,context:ie(d),startClocks:xe()}),Te({feature:"add-error"})})},addTiming:U((u,d)=>{o.addTiming(ie(u),d)}),setGlobalContext:c(pe.globalContext,Ae.setContext,"set-global-context"),getGlobalContext:c(pe.globalContext,Ae.getContext,"get-global-context"),setGlobalContextProperty:c(pe.globalContext,Ae.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:c(pe.globalContext,Ae.removeContextProperty,"remove-global-context-property"),clearGlobalContext:c(pe.globalContext,Ae.clearContext,"clear-global-context"),setUser:c(pe.userContext,Ae.setContext,"set-user"),getUser:c(pe.userContext,Ae.getContext,"get-user"),setUserProperty:c(pe.userContext,Ae.setContextProperty,"set-user-property"),removeUserProperty:c(pe.userContext,Ae.removeContextProperty,"remove-user-property"),clearUser:c(pe.userContext,Ae.clearContext,"clear-user"),setAccount:c(pe.accountContext,Ae.setContext,"set-account"),getAccount:c(pe.accountContext,Ae.getContext,"get-account"),setAccountProperty:c(pe.accountContext,Ae.setContextProperty,"set-account-property"),removeAccountProperty:c(pe.accountContext,Ae.removeContextProperty,"remove-account-property"),clearAccount:c(pe.accountContext,Ae.clearContext,"clear-account"),startView:a,stopSession:U(()=>{o.stopSession(),Te({feature:"stop-session"})}),addFeatureFlagEvaluation:U((u,d)=>{o.addFeatureFlagEvaluation(ie(u),ie(d)),Te({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:U(()=>t.getSessionReplayLink()),startSessionReplayRecording:U(u=>{t.start(u),Te({feature:"start-session-replay-recording",force:u&&u.force})}),stopSessionReplayRecording:U(()=>t.stop()),addDurationVital:U((u,d)=>{Te({feature:"add-duration-vital"}),o.addDurationVital({name:ie(u),type:"duration",startClocks:Up(d.startTime),duration:d.duration,context:ie(d&&d.context),description:ie(d&&d.description)})}),startDurationVital:U((u,d)=>(Te({feature:"start-duration-vital"}),o.startDurationVital(ie(u),{context:ie(d&&d.context),description:ie(d&&d.description)}))),stopDurationVital:U((u,d)=>{Te({feature:"stop-duration-vital"}),o.stopDurationVital(typeof u=="string"?ie(u):u,{context:ie(d&&d.context),description:ie(d&&d.description)})})});return l}function d1(e,t){return{init:n=>{dc("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function f1(){const e=Wc();return new G(t=>{if(!e)return;const n=new e(U(()=>t.notify()));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Wc(){let e;const t=window;if(t.Zone&&(e=bt(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(z),r=bt(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function p1(){const e=new G,{stop:t}=Le(window,"open",()=>e.notify());return{observable:e,stop:t}}function h1(e,t,n,r,s){return{get:i=>{const o=n.findView(i),a=s.findUrl(i),c=t.findTrackedSession(i);if(c&&o&&a){const l=r.findActionId(i);return{application_id:e,session_id:c.id,user_action:l?{id:l}:void 0,view:{id:o.id,name:o.name,referrer:a.referrer,url:a.url}}}}}}const g1=um,m1=Mt;function y1(e){const t=hn({expireDelay:m1});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const s=t.find(r.startClocks.relative);s&&r.name&&(s.name=r.name),s&&r.context&&(s.context=r.context)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),getAllEntries:()=>t.getAllEntries(),getDeletedEntries:()=>t.getDeletedEntries(),stop:()=>{t.stop()}}}const qc="initial_document",b1=[["document",e=>qc===e],["xhr",e=>e==="xmlhttprequest"],["fetch",e=>e==="fetch"],["beacon",e=>e==="beacon"],["css",(e,t)=>/\.css$/i.test(t)],["js",(e,t)=>/\.js$/i.test(t)],["image",(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],["font",(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],["media",(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function w1(e){const t=e.name;if(!Th(t))return ft(`Failed to construct URL for "${e.name}"`),"other";const n=Ah(t);for(const[r,s]of b1)if(s(e.initiatorType,n))return r;return"other"}function Kc(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function S1(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Gc(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?me(n,r):t}function _1(e){if(!Jc(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:s,redirectEnd:i,domainLookupStart:o,domainLookupEnd:a,connectStart:c,secureConnectionStart:l,connectEnd:u,requestStart:d,responseStart:f,responseEnd:h}=e,p={download:Ht(t,f,h),first_byte:Ht(t,d,f)};return 0<r&&r<n&&(p.worker=Ht(t,r,n)),n<u&&(p.connect=Ht(t,c,u),c<=l&&l<=u&&(p.ssl=Ht(t,l,u))),n<a&&(p.dns=Ht(t,o,a)),t<i&&(p.redirect=Ht(t,s,i)),p}function Yc(e){return e.duration>=0}function Jc(e){const t=Kc(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=v1(e)?Kc(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function v1(e){return e.redirectEnd>e.startTime}function Ht(e,t,n){if(e<=t&&t<=n)return{duration:B(me(t,n)),start:B(me(e,t))}}function Zc(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Xc(e){return e.deliveryType===""?"other":e.deliveryType}function E1(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function _i(e){return e&&!Hh(e)}const C1=/data:(.+)?(;base64)?,/g,Qc=24e3;function el(e){return e.length<=Qc?!1:e.substring(0,5)==="data:"?(e=e.substring(0,Qc),!0):!1}function tl(e){return`${e.match(C1)[0]}[...]`}let nl=1;function x1(e,t,n,r){const s=Gm(t,n,r);T1(e,t,s),A1(e,s)}function T1(e,t,n){const r=fm(t).subscribe(s=>{const i=s;if(_i(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=rl(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:"xhr",url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>r.unsubscribe()}}function A1(e,t){const n=kc().subscribe(r=>{const s=r;if(_i(s.url))switch(s.state){case"start":t.traceFetch(s),s.requestIndex=rl(),e.notify(7,{requestIndex:s.requestIndex,url:s.url});break;case"resolve":R1(s,i=>{t.clearTracingIfNeeded(s),e.notify(8,{duration:i,method:s.method,requestIndex:s.requestIndex,responseType:s.responseType,spanId:s.spanId,startClocks:s.startClocks,status:s.status,traceId:s.traceId,traceSampled:s.traceSampled,type:"fetch",url:s.url,response:s.response,init:s.init,input:s.input,isAborted:s.isAborted,handlingStack:s.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function rl(){const e=nl;return nl+=1,e}function R1(e,t){const n=e.response&&Kg(e.response);!n||!n.body?t(me(e.startClocks.timeStamp,de())):Lm(n.body,()=>{t(me(e.startClocks.timeStamp,de()))},{bytesLimit:Number.POSITIVE_INFINITY})}function sl(e){return Wn(e)&&e<0?void 0:e}function il({lifeCycle:e,isChildEvent:t,onChange:n=z}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},s=e.subscribe(13,i=>{var o;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case"error":r.errorCount+=1,n();break;case"action":r.actionCount+=1,i.action.frustration&&(r.frustrationCount+=i.action.frustration.type.length),n();break;case"long_task":r.longTaskCount+=1,n();break;case"resource":!((o=i._dd)===null||o===void 0)&&o.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{s.unsubscribe()},eventCounts:r}}function I1(e,t){const n=Ve();let r=!1;const{stop:s}=Ne(e,window,["click","mousedown","keydown","touchstart","pointerdown"],a=>{if(!a.cancelable)return;const c={entryType:"first-input",processingStart:ze(),processingEnd:ze(),startTime:a.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};a.type==="pointerdown"?i(e,c):o(c)},{passive:!0,capture:!0});return{stop:s};function i(a,c){Ne(a,window,["pointerup","pointercancel"],l=>{l.type==="pointerup"&&o(c)},{once:!0})}function o(a){if(!r){r=!0,s();const c=a.processingStart-a.startTime;c>=0&&c<Ve()-n&&t(a)}}}var H;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(H||(H={}));function tt(e,t){return new G(n=>{if(!window.PerformanceObserver)return;const r=c=>{const l=P1(c);l.length>0&&n.notify(l)};let s,i=!0;const o=new PerformanceObserver(U(c=>{i?s=fe(()=>r(c.getEntries())):r(c.getEntries())}));try{o.observe(t)}catch{if([H.RESOURCE,H.NAVIGATION,H.LONG_TASK,H.PAINT].includes(t.type)){t.buffered&&(s=fe(()=>r(performance.getEntriesByType(t.type))));try{o.observe({entryTypes:[t.type]})}catch{return}}}i=!1,k1(e);let a;return!jt(H.FIRST_INPUT)&&t.type===H.FIRST_INPUT&&({stop:a}=I1(e,c=>{r([c])})),()=>{o.disconnect(),a&&a(),Pe(s)}})}let sr;function k1(e){return!sr&&O1()&&"addEventListener"in performance&&(sr=Z(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{sr==null||sr.stop()}}function O1(){return window.performance!==void 0&&"getEntries"in performance}function jt(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function P1(e){return e.filter(t=>!L1(t))}function L1(e){return e.entryType===H.RESOURCE&&(!_i(e.name)||!Yc(e))}const ol=100,N1=100;function vi(e,t,n,r,s,i){const o=D1(e,t,n,r);return M1(o,s,i)}function M1(e,t,n){let r,s=!1;const i=fe(U(()=>l({hadActivity:!1})),ol),o=n!==void 0?fe(U(()=>l({hadActivity:!0,end:de()})),n):void 0,a=e.subscribe(({isBusy:u})=>{Pe(i),Pe(r);const d=de();u||(r=fe(U(()=>l({hadActivity:!0,end:d})),N1))}),c=()=>{s=!0,Pe(i),Pe(r),Pe(o),a.unsubscribe()};function l(u){s||(c(),t(u))}return{stop:c}}function D1(e,t,n,r){return new G(s=>{const i=[];let o,a=0;return i.push(t.subscribe(c),n.subscribe(c),tt(r,{type:H.RESOURCE}).subscribe(l=>{l.some(u=>!Ei(r,u.name))&&c()}),e.subscribe(7,l=>{Ei(r,l.url)||(o===void 0&&(o=l.requestIndex),a+=1,c())}),e.subscribe(8,l=>{Ei(r,l.url)||o===void 0||l.requestIndex<o||(a-=1,c())})),()=>{i.forEach(l=>l.unsubscribe())};function c(){s.notify({isBusy:a>0})}})}function Ei(e,t){return Lc(e.excludedActivityUrls,t)}function al(e){return e.nodeType===Node.TEXT_NODE}function F1(e){return e.nodeType===Node.COMMENT_NODE}function bn(e){return e.nodeType===Node.ELEMENT_NODE}function os(e){return bn(e)&&!!e.shadowRoot}function Ci(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&bn(t.host)}function B1(e){return e.childNodes.length>0||os(e)}function cl(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;os(e)&&t(e.shadowRoot)}function as(e){return Ci(e)?e.host:e.parentNode}const M={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Xn.ALLOW,MASK:Xn.MASK,MASK_USER_INPUT:Xn.MASK_USER_INPUT},xi="data-dd-privacy",U1="hidden",$1="dd-privacy-",Et="***",ll="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",V1={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},z1="x";function nt(e,t,n){if(n&&n.has(e))return n.get(e);const r=as(e),s=r?nt(r,t,n):t,i=dl(e),o=ul(i,s);return n&&n.set(e,o),o}function ul(e,t){switch(t){case M.HIDDEN:case M.IGNORE:return t}switch(e){case M.ALLOW:case M.MASK:case M.MASK_USER_INPUT:case M.HIDDEN:case M.IGNORE:return e;default:return t}}function dl(e){if(bn(e)){if(e.tagName==="BASE")return M.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return M.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return M.MASK}if(e.matches(wn(M.HIDDEN)))return M.HIDDEN;if(e.matches(wn(M.MASK)))return M.MASK;if(e.matches(wn(M.MASK_USER_INPUT)))return M.MASK_USER_INPUT;if(e.matches(wn(M.ALLOW)))return M.ALLOW;if(j1(e))return M.IGNORE}}function cs(e,t){switch(t){case M.MASK:case M.HIDDEN:case M.IGNORE:return!0;case M.MASK_USER_INPUT:return al(e)?fl(e.parentNode):fl(e);default:return!1}}function fl(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!V1[t.tagName]}const H1=e=>e.replace(/\S/g,z1);function pl(e,t,n){var r;const s=(r=e.parentElement)===null||r===void 0?void 0:r.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const o=n;if(s==="SCRIPT")i=Et;else if(o===M.HIDDEN)i=Et;else if(cs(e,o))if(s==="DATALIST"||s==="SELECT"||s==="OPTGROUP"){if(!i.trim())return}else s==="OPTION"?i=Et:i=H1(i);return i}function j1(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),s=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(s)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(s)||/^product:/.test(s)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function wn(e){return`[${xi}="${e}"], .${$1}${e}`}const Ti="data-dd-action-name",W1="Masked Element";function q1(e,{enablePrivacyForActionName:t,actionNameAttribute:n},r){const s=hl(e,Ti)||n&&hl(e,n);return s?{name:s,nameSource:"custom_attribute"}:r===M.MASK?{name:W1,nameSource:"mask_placeholder"}:gl(e,n,K1,t)||gl(e,n,G1,t)||{name:"",nameSource:"blank"}}function hl(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return yl(ml(r.trim()))}const K1=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return ls(e.labels[0],t)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return ls(e,t,n)},e=>ir(e,"aria-label"),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(s=>J1(e,s)).filter(s=>!!s).map(s=>bl(s,t,n)).join(" "),nameSource:"text_content"}},e=>ir(e,"alt"),e=>ir(e,"name"),e=>ir(e,"title"),e=>ir(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return ls(e.options[0],t)}],G1=[(e,t,n)=>ls(e,t,n)],Y1=10;function gl(e,t,n,r){let s=e,i=0;for(;i<=Y1&&s&&s.nodeName!=="BODY"&&s.nodeName!=="HTML"&&s.nodeName!=="HEAD";){for(const o of n){const a=o(s,t,r);if(a){const{name:c,nameSource:l}=a,u=c&&c.trim();if(u)return{name:yl(ml(u)),nameSource:l}}}if(s.nodeName==="FORM")break;s=s.parentElement,i+=1}}function ml(e){return e.replace(/\s+/g," ")}function yl(e){return e.length>100?`${$a(e,100)} [...]`:e}function J1(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function ir(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function ls(e,t,n){return{name:bl(e,t,n)||"",nameSource:"text_content"}}function bl(e,t,n){if(!e.isContentEditable){if("innerText"in e){let r=e.innerText;const s=i=>{const o=e.querySelectorAll(i);for(let a=0;a<o.length;a+=1){const c=o[a];if("innerText"in c){const l=c.innerText;l&&l.trim().length>0&&(r=r.replace(l,""))}}};return s(`[${Ti}]`),t&&s(`[${t}]`),n&&s(`${wn(M.HIDDEN)}, ${wn(M.MASK)}`),r}return e.textContent}}const wl=[Ti,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Z1=[_l,Q1],X1=[_l,e0,t0];function or(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const s=vl(r,Z1,r0,t,n);if(s)return s;n=vl(r,X1,s0,t,n)||us(n0(r),n),r=r.parentElement}return n}function Sl(e){return/[0-9]/.test(e)}function Q1(e){if(e.id&&!Sl(e.id))return`#${CSS.escape(e.id)}`}function e0(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!Sl(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function t0(e){return CSS.escape(e.tagName)}function _l(e,t){if(t){const r=n(t);if(r)return r}for(const r of wl){const s=n(r);if(s)return s}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function n0(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function vl(e,t,n,r,s){for(const i of t){const o=i(e,r);if(o&&n(e,o,s))return us(o,s)}}function r0(e,t,n){return e.ownerDocument.querySelectorAll(us(t,n)).length===1}function s0(e,t,n){let r;if(n===void 0)r=o=>o.matches(t);else{const o=us(`${t}:scope`,n);r=a=>a.querySelector(o)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&r(i))return!1;i=i.nextElementSibling}return!0}function us(e,t){return t?`${e}>${t}`:e}const El=Se,i0=100;function o0(e,t){const n=[];let r=0,s;i(e);function i(c){c.stopObservable.subscribe(o),n.push(c),Pe(s),s=fe(a,El)}function o(){r===1&&n.every(c=>c.isStopped())&&(r=2,t(n))}function a(){Pe(s),r===0&&(r=1,o())}return{tryAppend:c=>r!==0?!1:n.length>0&&!a0(n[n.length-1].event,c.event)?(a(),!1):(i(c),!0),stop:()=>{a()}}}function a0(e,t){return e.target===t.target&&c0(e,t)<=i0&&e.timeStamp-t.timeStamp<=El}function c0(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function l0(e,{onPointerDown:t,onPointerUp:n}){let r,s={selection:!1,input:!1,scroll:!1},i;const o=[Z(e,window,"pointerdown",a=>{xl(a)&&(r=Cl(),s={selection:!1,input:!1,scroll:!1},i=t(a))},{capture:!0}),Z(e,window,"selectionchange",()=>{(!r||!Cl())&&(s.selection=!0)},{capture:!0}),Z(e,window,"scroll",()=>{s.scroll=!0},{capture:!0,passive:!0}),Z(e,window,"pointerup",a=>{if(xl(a)&&i){const c=s;n(i,a,()=>c),i=void 0}},{capture:!0}),Z(e,window,"input",()=>{s.input=!0},{capture:!0})];return{stop:()=>{o.forEach(a=>a.stop())}}}function Cl(){const e=window.getSelection();return!e||e.isCollapsed}function xl(e){return e.target instanceof Element&&e.isPrimary!==!1}const Tl=3;function u0(e,t){if(d0(e))return t.addFrustration("rage_click"),e.some(Al)&&t.addFrustration("dead_click"),t.hasError&&t.addFrustration("error_click"),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration("error_click"),Al(r)&&!n&&r.addFrustration("dead_click")}),{isRage:!1}}function d0(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(Tl-1);t+=1)if(e[t+Tl-1].event.timeStamp-e[t].event.timeStamp<=Se)return!0;return!1}const f0='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Al(e){return e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll?!1:!e.event.target.matches(f0)}const Rl=10*Se,ar=new Map;function p0(e){const t=ar.get(e);return ar.delete(e),t}function Il(e,t){ar.set(e,t),ar.forEach((n,r)=>{me(r,ze())>Rl&&ar.delete(r)})}const h0=5*Oe;function g0(e,t,n,r){const s=hn({expireDelay:h0}),i=new G;let o;e.subscribe(10,()=>{s.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===mn.UNLOADING&&u()});const{stop:a}=l0(r,{onPointerDown:d=>m0(r,e,t,d,n),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},h,p)=>{y0(r,e,t,n,s,i,l,d,h,p,f)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:d=>s.findAll(d)}};function l(d){if(!o||!o.tryAppend(d)){const f=d.clone();o=o0(d,h=>{w0(h,f)})}}function u(){o&&o.stop()}}function m0(e,t,n,r,s){const i=e.enablePrivacyForActionName?nt(r.target,e.defaultPrivacyLevel):M.ALLOW;if(i===M.HIDDEN)return;const o=b0(r,i,e);let a=!1;return vi(t,n,s,e,c=>{a=c.hadActivity},ol),{clickActionBase:o,hadActivityOnPointerDown:()=>a}}function y0(e,t,n,r,s,i,o,a,c,l,u){var d;const f=kl(t,s,l,a,c);o(f);const h=(d=a==null?void 0:a.target)===null||d===void 0?void 0:d.selector;h&&Il(c.timeStamp,h);const{stop:p}=vi(t,n,r,e,w=>{w.hadActivity&&w.end<f.startClocks.timeStamp?f.discard():w.hadActivity?f.stop(w.end):u()?f.stop(f.startClocks.timeStamp):f.stop()},Rl),g=t.subscribe(5,({endClocks:w})=>{f.stop(w.timeStamp)}),m=i.subscribe(()=>{f.stop()});f.stopObservable.subscribe(()=>{g.unsubscribe(),p(),m.unsubscribe()})}function b0(e,t,n){const r=e.target.getBoundingClientRect(),s=or(e.target,n.actionNameAttribute);s&&Il(e.timeStamp,s);const i=q1(e.target,n,t);return{type:"click",target:{width:Math.round(r.width),height:Math.round(r.height),selector:s},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:i.name,nameSource:i.nameSource}}function kl(e,t,n,r,s){const i=ye(),o=xe(),a=t.add(i,o.relative),c=il({lifeCycle:e,isChildEvent:p=>p.action!==void 0&&(Array.isArray(p.action.id)?p.action.id.includes(i):p.action.id===i)});let l=0,u;const d=[],f=new G;function h(p){l===0&&(u=p,l=1,u?a.close(zs(u)):a.remove(),c.stop(),f.notify())}return{event:s,stop:h,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return u!==void 0},getUserActivity:n,addFrustration:p=>{d.push(p)},startClocks:o,isStopped:()=>l===1||l===2,clone:()=>kl(e,t,n,r,s),validate:p=>{if(h(),l!==1)return;const{resourceCount:g,errorCount:m,longTaskCount:w}=c.eventCounts,v={duration:u&&me(o.timeStamp,u),startClocks:o,id:i,frustrationTypes:d,counts:{resourceCount:g,errorCount:m,longTaskCount:w},events:p??[s],event:s,...r};e.notify(0,v),l=2},discard:()=>{h(),l=2}}}function w0(e,t){const{isRage:n}=u0(e,t);n?(e.forEach(r=>r.discard()),t.stop(de()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function S0(e,t,n,r,s){e.subscribe(0,a=>e.notify(12,Ol(a))),t.register(0,({startTime:a,eventType:c})=>{if(c!=="error"&&c!=="resource"&&c!=="long_task")return;const l=i.findActionId(a);if(l)return{type:c,action:{id:l}}});let i={findActionId:z},o=z;return s.trackUserInteractions&&({actionContexts:i,stop:o}=g0(e,n,r,s)),{addAction:a=>{e.notify(12,Ol(a))},actionContexts:i,stop:o}}function Ol(e){const t=ds(e)?{action:{id:e.id,loading_time:sl(B(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:void 0,n=Ge({action:{id:ye(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:"action"},t),r=ds(e)?e.duration:void 0,s=ds(e)?void 0:e.context,i=ds(e)?{events:e.events}:{handlingStack:e.handlingStack};return{customerContext:s,rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function ds(e){return e.type!=="custom"}function _0(e){const t=xm([Ur.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function v0(e,t){const n=vg(e,[tr.cspViolation,tr.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function E0(e,t){const n=new G;return _0(n),yg(n),v0(t,n),n.subscribe(r=>e.notify(14,{error:r})),C0(e)}function C0(e){return e.subscribe(14,({error:t,customerContext:n})=>{n=Ge(t.context,n),e.notify(12,{customerContext:n,...x0(t)})}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:s,context:i})=>{const o=vt(t)?_t(t):void 0,a=ac({stackTrace:o,originalError:t,handlingStack:n,componentStack:r,startClocks:s,nonErrorPrefix:"Provided",source:fn.CUSTOM,handling:"handled"});e.notify(14,{customerContext:i,error:a})}}}function x0(e){const t={date:e.startClocks.timeStamp,error:{id:ye(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:"error"},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const Pl=new WeakSet;function T0(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!Pl.has(r)).filter(r=>Yc(r)&&Jc(r)).filter(r=>A0(r,e.startClocks.relative,Ll({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return Pl.add(n[0]),n[0].toJSON()}function Ll(e){return nn(e.startTime,e.duration)}function A0(e,t,n){return e.startTime>=t-1&&Ll(e)<=nn(n,1)}const R0=2*Oe;function I0(e){const t=k0(e)||O0(e);if(!(!t||t.traceTime<=Ve()-R0))return t.traceId}function k0(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return Nl(t&&t.content,n&&n.content)}function O0(e){const t=P0(e);if(t)return Nl(Yn(t,"trace-id"),Yn(t,"trace-time"))}function Nl(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function P0(e){for(let t=0;t<e.childNodes.length;t+=1){const n=Ml(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=Ml(n);if(r)return r;if(!al(n))break}}function Ml(e){if(e&&F1(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function Dl(){if(jt(H.NAVIGATION)){const n=performance.getEntriesByType(H.NAVIGATION)[0];if(n)return n}const e=L0(),t={entryType:H.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function L0(){const e={},t=performance.timing;for(const n in t)if(Wn(t[n])){const r=n,s=t[r];e[r]=s===0?0:zs(s)}return e}function N0(e,t,n=Dl){fi(e,"interactive",()=>{const r=n(),s=Object.assign(r.toJSON(),{entryType:H.RESOURCE,initiatorType:qc,duration:r.responseEnd,traceId:I0(document),toJSON:()=>({...s,toJSON:void 0})});t(s)})}function M0(e,t,n,r=Cm(),s=N0){e.subscribe(8,a=>{o(()=>D0(a,t,n))});const i=tt(t,{type:H.RESOURCE,buffered:!0}).subscribe(a=>{for(const c of a)S1(c)||o(()=>Fl(c,t))});s(t,a=>{o(()=>Fl(a,t))});function o(a){r.push(()=>{const c=a();c&&e.notify(12,c)})}return{stop:()=>{i.unsubscribe()}}}function D0(e,t,n){const r=T0(e),s=r?zr(r.startTime):e.startClocks,i=F0(e,t);if(!t.trackResources&&!i)return;const o=e.type==="xhr"?"xhr":"fetch",a=r?Bl(r):void 0,c=r?Gc(r):U0(n,s,e.duration),l=Ge({date:s.timeStamp,resource:{id:ye(),type:o,duration:B(c),method:e.method,status_code:e.status,protocol:r&&Zc(r),url:el(e.url)?tl(e.url):e.url,delivery_type:r&&Xc(r)},type:"resource",_dd:{discarded:!t.trackResources}},i,a);return{startTime:s.relative,duration:c,rawRumEvent:l,domainContext:{performanceEntry:r,xhr:e.xhr,response:e.response,requestInput:e.input,requestInit:e.init,error:e.error,isAborted:e.isAborted,handlingStack:e.handlingStack}}}function Fl(e,t){const n=zr(e.startTime),r=B0(e,t);if(!t.trackResources&&!r)return;const s=w1(e),i=Bl(e),o=Gc(e),a=Ge({date:n.timeStamp,resource:{id:ye(),type:s,duration:B(o),url:e.name,status_code:$0(e.responseStatus),protocol:Zc(e),delivery_type:Xc(e)},type:"resource",_dd:{discarded:!t.trackResources}},r,i);return{startTime:n.relative,duration:o,rawRumEvent:a,domainContext:{performanceEntry:e}}}function Bl(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...E1(e),..._1(e)}}}function F0(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function B0(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Fc().toString(),rule_psr:t.rulePsr}}}function U0(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function $0(e){return e===0?void 0:e}function V0(e,t,n){const{stop:r,eventCounts:s}=il({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:r,eventCounts:s}}const z0=10*Oe;function H0(e,t,n){return{stop:tt(e,{type:H.PAINT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.name==="first-contentful-paint"&&o.startTime<t.timeStamp&&o.startTime<z0);i&&n(i.startTime)}).unsubscribe}}function j0(e,t,n){const r=tt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.startTime<t.timeStamp);if(i){const o=me(i.startTime,i.processingStart);let a;i.target&&bn(i.target)&&(a=or(i.target,e.actionNameAttribute)),n({delay:o>=0?o:0,time:i.startTime,targetSelector:a})}});return{stop:()=>{r.unsubscribe()}}}function W0(e,t,n=Dl){return G0(e,()=>{const r=n();K0(r)||t(q0(r))})}function q0(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=ze()?e.responseStart:void 0}}function K0(e){return e.loadEventEnd<=0}function G0(e,t){let n;const{stop:r}=fi(e,"complete",()=>{n=fe(()=>t())});return{stop:()=>{r(),Pe(n)}}}const Y0=10*Oe;function J0(e,t,n,r){let s=1/0;const{stop:i}=Ne(e,n,["pointerdown","keydown"],c=>{s=c.timeStamp},{capture:!0,once:!0});let o=0;const a=tt(e,{type:H.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(c=>{const l=th(c,u=>u.entryType===H.LARGEST_CONTENTFUL_PAINT&&u.startTime<s&&u.startTime<t.timeStamp&&u.startTime<Y0&&u.size>o);if(l){let u;l.element&&(u=or(l.element,e.actionNameAttribute)),r({value:l.startTime,targetSelector:u,resourceUrl:Z0(l)}),o=l.size}});return{stop:()=>{i(),a.unsubscribe()}}}function Z0(e){return e.url===""?void 0:e.url}function Ul(e,t=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:z};if(jt(H.VISIBILITY_STATE)){const s=performance.getEntriesByType(H.VISIBILITY_STATE).find(i=>i.name==="hidden");if(s)return{timeStamp:s.startTime,stop:z}}let n=1/0;const{stop:r}=Ne(e,t,["pagehide","visibilitychange"],s=>{(s.type==="pagehide"||document.visibilityState==="hidden")&&(n=s.timeStamp,r())},{capture:!0});return{get timeStamp(){return n},stop:r}}function X0(e,t,n){const r={},{stop:s}=W0(e,u=>{t(u.loadEvent),r.navigationTimings=u,n()}),i=Ul(e),{stop:o}=H0(e,i,u=>{r.firstContentfulPaint=u,n()}),{stop:a}=J0(e,i,window,u=>{r.largestContentfulPaint=u,n()}),{stop:c}=j0(e,i,u=>{r.firstInput=u,n()});function l(){s(),o(),a(),c(),i.stop()}return{stop:l,initialViewMetrics:r}}function Q0(e,t,n){if(!sy())return{stop:z};let r=0,s;n({value:0});const i=ry(),o=tt(e,{type:H.LAYOUT_SHIFT,buffered:!0}).subscribe(a=>{var c;for(const l of a){if(l.hadRecentInput||l.startTime<t)continue;const{cumulatedValue:u,isMaxValue:d}=i.update(l);if(d){const f=ey(l.sources);s={target:f!=null&&f.node?new WeakRef(f.node):void 0,time:me(t,l.startTime),previousRect:f==null?void 0:f.previousRect,currentRect:f==null?void 0:f.currentRect,devicePixelRatio:window.devicePixelRatio}}if(u>r){r=u;const f=(c=s==null?void 0:s.target)===null||c===void 0?void 0:c.deref();n({value:Vr(r,4),targetSelector:f&&or(f,e.actionNameAttribute),time:s==null?void 0:s.time,previousRect:s!=null&&s.previousRect?$l(s.previousRect):void 0,currentRect:s!=null&&s.currentRect?$l(s.currentRect):void 0,devicePixelRatio:s==null?void 0:s.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function ey(e){return e.find(t=>!!t.node&&bn(t.node))}function $l({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const ty=5*Se,ny=Se;function ry(){let e=0,t,n,r=0;return{update:s=>{const i=t===void 0||s.startTime-n>=ny||s.startTime-t>=ty;let o;return i?(t=n=s.startTime,r=e=s.value,o=!0):(e+=s.value,n=s.startTime,o=s.value>r,o&&(r=s.value)),{cumulatedValue:e,isMaxValue:o}}}}function sy(){return jt(H.LAYOUT_SHIFT)&&"WeakRef"in window}let fs,Vl=0,Ai=1/0,Ri=0;function iy(){"interactionCount"in performance||fs||(fs=new window.PerformanceObserver(U(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(Ai=Math.min(Ai,n.interactionId),Ri=Math.max(Ri,n.interactionId),Vl=(Ri-Ai)/7+1)})})),fs.observe({type:"event",buffered:!0,durationThreshold:0}))}const zl=()=>fs?Vl:window.performance.interactionCount||0,Hl=10,oy=1*Oe;function ay(e,t,n){if(!uy())return{getInteractionToNextPaint:()=>{},setViewEnd:z,stop:z};const{getViewInteractionCount:r,stopViewInteractionCount:s}=ly(n);let i=1/0;const o=cy(r);let a=-1,c,l;function u(h){for(const g of h)g.interactionId&&g.startTime>=t&&g.startTime<=i&&o.process(g);const p=o.estimateP98Interaction();p&&p.duration!==a&&(a=p.duration,l=me(t,p.startTime),c=p0(p.startTime),!c&&p.target&&bn(p.target)&&(c=or(p.target,e.actionNameAttribute)))}const d=tt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(u),f=tt(e,{type:H.EVENT,durationThreshold:40,buffered:!0}).subscribe(u);return{getInteractionToNextPaint:()=>{if(a>=0)return{value:Math.min(a,oy),targetSelector:c,time:l};if(r())return{value:0}},setViewEnd:h=>{i=h,s()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function cy(e){const t=[];function n(){t.sort((r,s)=>s.duration-r.duration).splice(Hl)}return{process(r){const s=t.findIndex(o=>r.interactionId===o.interactionId),i=t[t.length-1];s!==-1?r.duration>t[s].duration&&(t[s]=r,n()):(t.length<Hl||r.duration>i.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function ly(e){iy();const t=e==="initial_load"?0:zl();let n={stopped:!1};function r(){return zl()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function uy(){return jt(H.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function dy(e,t,n,r,s,i,o){let a=s==="initial_load",c=!0;const l=[],u=Ul(r);function d(){if(!c&&!a&&l.length>0){const h=Math.max(...l);h<u.timeStamp&&o(h)}}const{stop:f}=vi(e,t,n,r,h=>{c&&(c=!1,h.hadActivity&&l.push(me(i.timeStamp,h.end)),d())});return{stop:()=>{f(),u.stop()},setLoadEvent:h=>{a&&(a=!1,l.push(h),d())}}}function jl(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Ii(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let ki;function Wl(e){return ki||(ki=fy(e)),ki}function fy(e){return new G(t=>{const{throttled:n}=wt(()=>{t.notify(ps())},200);return Z(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function ps(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const py=Se;function hy(e,t,n,r=my(e)){let s=0,i=0,o=0;const a=r.subscribe(({scrollDepth:c,scrollTop:l,scrollHeight:u})=>{let d=!1;if(c>s&&(s=c,d=!0),u>i){i=u;const f=ze();o=me(t.relative,f),d=!0}d&&n({maxDepth:Math.min(s,i),maxDepthScrollTop:l,maxScrollHeight:i,maxScrollHeightTime:o})});return{stop:()=>a.unsubscribe()}}function gy(){const e=Ii(),{height:t}=ps(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function my(e,t=py){return new G(n=>{function r(){n.notify(gy())}if(window.ResizeObserver){const s=wt(r,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,o=new ResizeObserver(U(s.throttled));i&&o.observe(i);const a=Z(e,window,"scroll",s.throttled,{passive:!0});return()=>{s.cancel(),o.disconnect(),a.stop()}}})}function yy(e,t,n,r,s,i,o){const a={},{stop:c,setLoadEvent:l}=dy(e,t,n,r,i,o,g=>{a.loadingTime=g,s()}),{stop:u}=hy(r,o,g=>{a.scroll=g}),{stop:d}=Q0(r,o.relative,g=>{a.cumulativeLayoutShift=g,s()}),{stop:f,getInteractionToNextPaint:h,setViewEnd:p}=ay(r,o.relative,i);return{stop:()=>{c(),d(),u()},stopINPTracking:f,setLoadEvent:l,setViewEnd:p,getCommonViewMetrics:()=>(a.interactionToNextPaint=h(),a)}}const by=3e3,wy=5*Oe,Sy=5*Oe;function _y(e,t,n,r,s,i,o,a){const c=new Set;let l=d("initial_load",Ma(),a);f();let u;o&&(u=h(i));function d(p,g,m){const w=vy(t,n,r,s,e,p,g,m);return c.add(w),w.stopObservable.subscribe(()=>{c.delete(w)}),w}function f(){t.subscribe(10,()=>{l=d("route_change",void 0,{name:l.name,service:l.service,version:l.version,context:l.contextManager.getContext()})}),t.subscribe(9,()=>{l.end({sessionIsActive:!1})})}function h(p){return p.subscribe(({oldLocation:g,newLocation:m})=>{Cy(g,m)&&(l.end(),l=d("route_change"))})}return{addTiming:(p,g=de())=>{l.addTiming(p,g)},startView:(p,g)=>{l.end({endClocks:g}),l=d("route_change",g,p)},setViewContext:p=>{l.contextManager.setContext(p)},setViewContextProperty:(p,g)=>{l.contextManager.setContextProperty(p,g)},setViewName:p=>{l.setViewName(p)},getViewContext:()=>l.contextManager.getContext(),stop:()=>{u&&u.unsubscribe(),l.end(),c.forEach(p=>p.stop())}}}function vy(e,t,n,r,s,i,o=xe(),a){const c=ye(),l=new G,u={};let d=0,f;const h=Gn(s),p=ss();let g=!0,m=a==null?void 0:a.name;const w=(a==null?void 0:a.service)||r.service,v=(a==null?void 0:a.version)||r.version,b=a==null?void 0:a.context;b&&p.setContext(b);const _={id:c,name:m,startClocks:o,service:w,version:v,context:b};e.notify(1,_),e.notify(2,_);const{throttled:k,cancel:x}=wt(ne,by,{leading:!1}),{setLoadEvent:y,setViewEnd:R,stop:C,stopINPTracking:I,getCommonViewMetrics:A}=yy(e,t,n,r,X,i,o),{stop:O,initialViewMetrics:P}=i==="initial_load"?X0(r,y,X):{stop:z,initialViewMetrics:{}},{stop:N,eventCounts:Q}=V0(e,c,X),ge=rn(ne,wy),$e=e.subscribe(11,ee=>{ee.reason===mn.UNLOADING&&ne()});ne(),p.changeObservable.subscribe(X);function qe(){e.notify(3,{id:c,name:m,context:p.getContext(),startClocks:o})}function X(){qe(),k()}function ne(){x(),qe(),d+=1;const ee=f===void 0?de():f.timeStamp;e.notify(4,{customTimings:u,documentVersion:d,id:c,name:m,service:w,version:v,context:p.getContext(),loadingType:i,location:h,startClocks:o,commonViewMetrics:A(),initialViewMetrics:P,duration:me(o.timeStamp,ee),isActive:f===void 0,sessionIsActive:g,eventCounts:Q})}return{get name(){return m},service:w,version:v,contextManager:p,stopObservable:l,end(ee={}){var Re,ve;f||(f=(Re=ee.endClocks)!==null&&Re!==void 0?Re:xe(),g=(ve=ee.sessionIsActive)!==null&&ve!==void 0?ve:!0,e.notify(5,{endClocks:f}),e.notify(6,{endClocks:f}),jr(ge),R(f.relative),C(),$e.unsubscribe(),ne(),fe(()=>{this.stop()},Sy))},stop(){O(),N(),I(),l.notify()},addTiming(ee,Re){if(f)return;const ve=Hp(Re)?Re:me(o.timeStamp,Re);u[Ey(ee)]=ve,X()},setViewName(ee){m=ee,ne()}}}function Ey(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&V.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Cy(e,t){return e.pathname!==t.pathname||!xy(t.hash)&&ql(t.hash)!==ql(e.hash)}function xy(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function ql(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Ty(e,t,n,r,s,i,o,a,c,l){return e.subscribe(4,u=>e.notify(12,Ay(u,n,a))),t.register(0,({startTime:u,eventType:d})=>{const{service:f,version:h,id:p,name:g,context:m}=c.findView(u);return{type:d,service:f,version:h,context:m,view:{id:p,name:g}}}),_y(r,e,s,i,n,o,!n.trackViewsManually,l)}function Ay(e,t,n){var r,s,i,o,a,c,l,u,d,f,h,p,g,m,w,v,b,_;const k=n.getReplayStats(e.id),x=(s=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||s===void 0?void 0:s.devicePixelRatio,y={_dd:{document_version:e.documentVersion,replay_stats:k,cls:x?{device_pixel_ratio:x}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:"view",view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:B((o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.time),cumulative_layout_shift_target_selector:(a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.targetSelector,first_byte:B((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:B((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.domComplete),dom_content_loaded:B((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domContentLoaded),dom_interactive:B((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:B(e.initialViewMetrics.firstContentfulPaint),first_input_delay:B((f=e.initialViewMetrics.firstInput)===null||f===void 0?void 0:f.delay),first_input_time:B((h=e.initialViewMetrics.firstInput)===null||h===void 0?void 0:h.time),first_input_target_selector:(p=e.initialViewMetrics.firstInput)===null||p===void 0?void 0:p.targetSelector,interaction_to_next_paint:B((g=e.commonViewMetrics.interactionToNextPaint)===null||g===void 0?void 0:g.value),interaction_to_next_paint_time:B((m=e.commonViewMetrics.interactionToNextPaint)===null||m===void 0?void 0:m.time),interaction_to_next_paint_target_selector:(w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:B((v=e.initialViewMetrics.largestContentfulPaint)===null||v===void 0?void 0:v.value),largest_contentful_paint_target_selector:(b=e.initialViewMetrics.largestContentfulPaint)===null||b===void 0?void 0:b.targetSelector,load_event:B((_=e.initialViewMetrics.navigationTimings)===null||_===void 0?void 0:_.loadEvent),loading_time:sl(B(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Ry(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:B(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:B(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:k?!0:void 0,is_active:e.sessionIsActive?void 0:!1},privacy:{replay_level:t.defaultPrivacyLevel}};return Lt(e.customTimings)||(y.view.custom_timings=qp(e.customTimings,B)),{rawRumEvent:y,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Ry({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:s}){return{cls:e&&{score:e.value,timestamp:B(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:B(n)},fid:r&&{duration:B(r.delay),timestamp:B(r.time),target_selector:r.targetSelector},inp:t&&{duration:B(t.value),timestamp:B(t.time),target_selector:t.targetSelector},lcp:s&&{timestamp:B(s.value),target_selector:s.targetSelector,resource_url:s.resourceUrl}}}const Iy="rum";function ky(e,t,n){const r=zg(e,Iy,s=>Py(e,s),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:s,newState:i})=>{if(!s.forcedReplay&&i.forcedReplay){const o=r.findSession();o&&(o.isReplayForced=!0)}}),{findTrackedSession:s=>{const i=r.findSession(s);if(!(!i||!Kl(i.trackingType)))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function Oy(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Ac("records")?1:0};return{findTrackedSession:()=>e,expire:z,expireObservable:new G,setForcedReplay:z}}function Py(e,t){let n;return Ly(t)?n=t:yt(e.sessionSampleRate)?yt(e.sessionReplaySampleRate)?n="1":n="2":n="0",{trackingType:n,isTracked:Kl(n)}}function Ly(e){return e==="0"||e==="1"||e==="2"}function Kl(e){return e==="2"||e==="1"}function Ny(e,t,n,r,s,i,o){const a=e.replica,c=cm(e,{endpoint:e.rumEndpointBuilder,encoder:o(2)},a&&{endpoint:a.rumEndpointBuilder,transformMessage:l=>Ge(l,{application:{id:a.applicationId}}),encoder:o(3)},r,s,i);return t.subscribe(13,l=>{l.type==="view"?c.upsert(l,l.view.id):c.add(l)}),n.subscribe(l=>c.add(l,Ng(e))),c}function My(e){const t=gn();e.subscribe(13,n=>{t.send("rum",n)})}const Dy=Mt;function Fy(e,t,n,r){const s=hn({expireDelay:Dy});let i;e.subscribe(1,({startClocks:c})=>{const l=r.href;s.add(a({url:l,referrer:i||document.referrer}),c.relative),i=l}),e.subscribe(6,({endClocks:c})=>{s.closeActive(c.relative)});const o=n.subscribe(({newLocation:c})=>{const l=s.find();if(l){const u=ze();s.closeActive(u),s.add(a({url:c.href,referrer:l.referrer}),u)}});function a({url:c,referrer:l}){return{url:c,referrer:l}}return t.register(0,({startTime:c,eventType:l})=>{const{url:u,referrer:d}=s.find(c);return{type:l,view:{url:u,referrer:d}}}),{findUrl:c=>s.find(c),getAllEntries:()=>s.getAllEntries(),getDeletedEntries:()=>s.getDeletedEntries(),stop:()=>{o.unsubscribe(),s.stop()}}}function By(e,t){let n=Gn(t);return new G(r=>{const{stop:s}=Uy(e,o),{stop:i}=$y(e,o);function o(){if(n.href===t.href)return;const a=Gn(t);r.notify({newLocation:a,oldLocation:n}),n=a}return()=>{s(),i()}})}function Uy(e,t){const{stop:n}=Le(Gl("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:r}=Le(Gl("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:s}=Z(e,window,"popstate",t);return{stop:()=>{n(),r(),s()}}}function $y(e,t){return Z(e,window,"hashchange",t)}function Gl(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Vy=Mt;function zy(e,t,n){const r=hn({expireDelay:Vy});return e.subscribe(1,({startClocks:s})=>{r.add({},s.relative)}),e.subscribe(6,({endClocks:s})=>{r.closeActive(s.relative)}),t.register(0,({startTime:s,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat(["view","error"]).includes(i))return;const a=r.find(s);if(!(!a||Lt(a)))return{type:i,feature_flags:a}}),{addFeatureFlagEvaluation:(s,i)=>{const o=r.find();o&&(o[s]=i)}}}const Hy=10*Se;let Sn,Oi;function jy(e,t,n,r){t.enabled&&yt(e.customerDataTelemetrySampleRate)&&(Zl(),Oi=!1,n.subscribe(13,()=>{Oi=!0}),r.subscribe(({bytesCount:i,messagesCount:o})=>{Oi&&(Sn.batchCount+=1,Jl(Sn.batchBytesCount,i),Jl(Sn.batchMessagesCount,o))}),rn(Wy,Hy))}function Wy(){Sn.batchCount!==0&&(ft("Customer data measures",Sn),Zl())}function Yl(){return{min:1/0,max:0,sum:0}}function Jl(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function Zl(){Sn={batchCount:0,batchBytesCount:Yl(),batchMessagesCount:Yl()}}const qy=4e3,Ky=500,Gy=Mt;function Yy(e,t,n=Ky){const r=hn({expireDelay:Gy,maxEntries:qy});let s;o(Xl(),ze());const{stop:i}=Ne(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],c=>{o(Zy(c),c.timeStamp)},{capture:!0});function o(c,l=ze()){c!==s&&(s=c,r.closeActive(l),r.add({state:s,startTime:l},l))}function a(c,l,u){return r.findAll(l,u).some(d=>d.state===c)}return e.register(0,({startTime:c,duration:l=0,eventType:u})=>{if(u==="view"){const d=r.findAll(c,l);return{type:u,_dd:{page_states:Jy(d,c,n)}}}if(u==="action"||u==="error")return{type:u,view:{in_foreground:a("active",c,0)}}}),{wasInPageStateDuringPeriod:a,addPageState:o,stop:()=>{i(),r.stop()}}}function Jy(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:s})=>({state:r,start:B(me(t,s))}))}function Zy(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":Xl()}function Xl(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Xy(e){let t;const n=requestAnimationFrame(U(()=>{t=ps()})),r=Wl(e).subscribe(s=>{t=s}).unsubscribe;return{get:()=>t?{viewport:t}:void 0,stop:()=>{r(),n&&cancelAnimationFrame(n)}}}const Qy=Se;function eb(e){return new G(t=>tb(e,n=>t.notify(n)))}function tb(e,t){const n=Yn(document.cookie,e),r=rn(()=>{const s=Yn(document.cookie,e);s!==n&&t(s)},Qy);return()=>jr(r)}const Ql="datadog-ci-visibility-test-execution-id";function nb(e,t=eb(Ql)){var n;let r=St(Ql)||((n=window.Cypress)===null||n===void 0?void 0:n.env("traceId"));const s=t.subscribe(i=>{r=i});return e.register(0,({eventType:i})=>{if(typeof r=="string")return{type:i,session:{type:"ci_test"},ci_test:{test_execution_id:r}}}),{stop:()=>{s.unsubscribe()}}}function rb(e,t){const n=tt(t,{type:H.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const s of r){const i=zr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-animation-frame",duration:B(s.duration),blocking_duration:B(s.blockingDuration),first_ui_event_timestamp:B(s.firstUIEventTimestamp),render_start:B(s.renderStart),style_and_layout_start:B(s.styleAndLayoutStart),start_time:B(s.startTime),scripts:s.scripts.map(a=>({duration:B(a.duration),pause_duration:B(a.pauseDuration),forced_style_and_layout_duration:B(a.forcedStyleAndLayoutDuration),start_time:B(a.startTime),execution_start:B(a.executionStart),source_url:a.sourceURL,source_function_name:a.sourceFunctionName,source_char_position:a.sourceCharPosition,invoker:a.invoker,invoker_type:a.invokerType,window_attribution:a.windowAttribution}))},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop:()=>n.unsubscribe()}}function sb(e,t){const n=tt(t,{type:H.LONG_TASK,buffered:!0}).subscribe(r=>{for(const s of r){if(s.entryType!==H.LONG_TASK||!t.trackLongTasks)break;const i=zr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-task",duration:B(s.duration)},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop(){n.unsubscribe()}}}function ib(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const s=(e[t]||[]).map(i=>i(n));return Ge(...s)}}}function ob(e){e.register(0,({eventType:t})=>{const n=Fm(),r=Bm();if(!(!n||!r))return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:Pc()}}})}function ab(e,t,n){const r=ci(e),s=n(r);return Ys(t).forEach(([i,o])=>Pi(e,r,i.split(/\.|(?=\[\])/),o)),s}function Pi(e,t,n,r){const[s,...i]=n;if(s==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((o,a)=>Pi(o,t[a],i,r));return}if(!(!eu(e)||!eu(t))){if(i.length>0)return Pi(e[s],t[s],i,r);cb(e,s,t[s],r)}}function cb(e,t,n,r){const s=$t(n);s===r?e[t]=ie(n):r==="object"&&(s==="undefined"||s==="null")&&(e[t]={})}function eu(e){return $t(e)==="object"}const _n={"view.name":"string","view.url":"string","view.referrer":"string"},vn={context:"object"},Li={service:"string",version:"string"};let tu;function lb(e,t,n,r,s,i,o,a,c){tu={view:{"view.performance.lcp.resource_url":"string",...vn,..._n},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...vn,..._n,...Li},resource:{"resource.url":"string",...es(Ut.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...vn,..._n,...Li},action:{"action.target.name":"string",...vn,..._n,...Li},long_task:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...vn,..._n},vital:{...vn,..._n}};const l={error:di("error",e.eventRateLimiterThreshold,c),action:di("action",e.eventRateLimiterThreshold,c),vital:di("vital",e.eventRateLimiterThreshold,c)};t.subscribe(12,({startTime:u,duration:d,rawRumEvent:f,domainContext:h,customerContext:p})=>{const g=s.findView(u),m=i.findUrl(u),w=r.findTrackedSession(u);if(w&&g&&!m&&es(Ut.MISSING_URL_CONTEXT_TELEMETRY)&&ft("Missing URL entry",{debug:{eventType:f.type,startTime:u,urlEntries:i.getAllEntries(),urlDeletedEntries:i.getDeletedEntries(),viewEntries:s.getAllEntries(),viewDeletedEntries:s.getDeletedEntries()}}),w&&g&&m){const v=a(),b={_dd:{format_version:2,drift:Vp(),configuration:{session_sample_rate:Vr(e.sessionSampleRate,3),session_replay_sample_rate:Vr(e.sessionReplaySampleRate,3)},browser_sdk_version:zt()?"6.6.3":void 0},application:{id:e.applicationId},date:de(),source:"browser",session:{id:w.id,type:"user"},display:o.get(),connectivity:hc(),context:v.context},_=Ge(b,n.triggerHook(0,{eventType:f.type,startTime:u,duration:d}),{context:p},f);"has_replay"in _.session||(_.session.has_replay=v.hasReplay),_.type==="view"&&(_.session.sampled_for_replay=w.sessionReplay===1),w.anonymousId&&!v.user.anonymous_id&&e.trackAnonymousUser&&(v.user.anonymous_id=w.anonymousId),Lt(v.user)||(_.usr=v.user),!Lt(v.account)&&v.account.id&&(_.account=v.account),ub(_,e.beforeSend,h,l)&&(Lt(_.context)&&delete _.context,t.notify(13,_))}})}function ub(e,t,n,r){var s;if(t){const o=ab(e,tu[e.type],a=>t(a,n));if(o===!1&&e.type!=="view")return!1;o===!1&&V.warn("Can't dismiss view events using beforeSend!")}return!((s=r[e.type])===null||s===void 0?void 0:s.isLimitReached())}function db(e,t,n,r){return{context:e.getContext(),user:t.getContext(),account:n.getContext(),hasReplay:r.isRecording()?!0:void 0}}function fb(e,t,n,r,s,i,o){const a=[],c=new g1,l=ib();c.subscribe(13,ce=>ai("rum",ce));const u=pb(e);u.setContextProvider(()=>{var ce,Pn;return{application:{id:e.applicationId},session:{id:(ce=p.findTrackedSession())===null||ce===void 0?void 0:ce.id},view:{id:(Pn=v.findView())===null||Pn===void 0?void 0:Pn.id},action:{id:A.findActionId()}}});const d=ce=>{c.notify(14,{error:ce}),ft("Error reported to customer",{"error.message":ce.message})},f=im(e),h=f.subscribe(ce=>{c.notify(11,ce)});a.push(()=>h.unsubscribe());const p=zt()?Oy():ky(e,c,i);if(zt())My(c);else{const ce=Ny(e,c,u.observable,d,f,p.expireObservable,s);a.push(()=>ce.stop()),jy(e,u,c,ce.flushObservable)}const g=f1(),m=By(e,location),w=Yy(l,e),v=y1(c),b=Fy(c,l,m,location),_=zy(c,l,e),{observable:k,stop:x}=p1();a.push(x);const y=i1(e),R=o1(e),C=a1(e),I=()=>db(y,R,C,t),{actionContexts:A,addAction:O,stop:P}=hb(c,l,e,p,w,g,k,b,v,I,d);a.push(P),Lg();const{addTiming:N,startView:Q,setViewName:ge,setViewContext:$e,setViewContextProperty:qe,getViewContext:X,stop:ne}=Ty(c,l,e,location,g,k,m,t,v,r);a.push(ne);const{stop:ee}=M0(c,e,w);if(a.push(ee),e.trackLongTasks)if(jt(H.LONG_ANIMATION_FRAME)){const{stop:ce}=rb(c,e);a.push(ce)}else sb(c,e);const{addError:Re}=E0(c,e);x1(c,e,p,I);const ve=$m(c,w,o),Co=h1(e.applicationId,p,v,A,b);return a.push(()=>n.stop()),{addAction:O,addError:Re,addTiming:N,addFeatureFlagEvaluation:_.addFeatureFlagEvaluation,startView:Q,setViewContext:$e,setViewContextProperty:qe,getViewContext:X,setViewName:ge,lifeCycle:c,viewHistory:v,session:p,stopSession:()=>p.expire(),getInternalContext:Co.get,startDurationVital:ve.startDurationVital,stopDurationVital:ve.stopDurationVital,addDurationVital:ve.addDurationVital,globalContext:y,userContext:R,accountContext:C,stop:()=>{a.forEach(ce=>ce())}}}function pb(e){const t=Og("browser-rum-sdk",e);if(zt()){const n=gn();t.observable.subscribe(r=>n.send("internal_telemetry",r))}return t}function hb(e,t,n,r,s,i,o,a,c,l,u){const d=S0(e,t,i,o,n),f=Xy(n),h=nb(t);return ob(t),lb(n,e,t,r,c,a,f,l,u),{pageStateHistory:s,addAction:d.addAction,actionContexts:d.actionContexts,stop:()=>{d.stop(),h.stop(),f.stop(),c.stop(),s.stop(),a.stop()}}}function gb(e,{session:t,viewContext:n,errorType:r}){const s=t?t.id:"no-session-id",i=[];r!==void 0&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const o=mb(e),a=`/rum/replay/sessions/${s}`;return`${o}${a}?${i.join("&")}`}function mb(e){const t=e.site,n=e.subdomain||yb(e);return`https://${n?`${n}.`:""}${t}`}function yb(e){switch(e.site){case Bt:case kh:return"app";case nc:return"dd";default:return}}const bb=1e3;let He;function wb(e){return hs(e).segments_count}function Sb(e){hs(e).segments_count+=1}function _b(e){hs(e).records_count+=1}function vb(e,t){hs(e).segments_total_raw_size+=t}function Eb(e){return He==null?void 0:He.get(e)}function hs(e){He||(He=new Map);let t;return He.has(e)?t=He.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},He.set(e,t),He.size>bb&&Cb()),t}function Cb(){if(!He)return;const e=He.keys().next().value;e&&He.delete(e)}function nu(e,t,n){let r=0,s=[],i,o=0;const a=[],{stop:c}=Z(e,t,"message",({data:d})=>{if(d.type!=="wrote"||d.streamId!==n)return;r+=d.additionalBytesCount,s.push(d.result),i=d.trailer;const f=a.shift();f&&f.id===d.id?f.writeCallback?f.writeCallback(d.result.byteLength):f.finishCallback&&f.finishCallback():(c(),ft("Worker responses received out of order."))});function l(){const d=s.length===0?new Uint8Array(0):Wp(s.concat(i)),f={rawBytesCount:r,output:d,outputBytesCount:d.byteLength,encoding:"deflate"};return r=0,s=[],f}function u(){o>0&&(t.postMessage({action:"reset",streamId:n}),o=0)}return{isAsync:!0,get isEmpty(){return o===0},write(d,f){t.postMessage({action:"write",id:o,data:d,streamId:n}),a.push({id:o,writeCallback:f,data:d}),o+=1},finish(d){u(),a.length?(a.forEach(f=>{delete f.writeCallback}),a[a.length-1].finishCallback=()=>d(l())):d(l())},finishSync(){u();const d=a.map(f=>(delete f.writeCallback,delete f.finishCallback,f.data)).join("");return{...l(),pendingData:d}},estimateEncodedBytesCount(d){return d.length/8},stop(){c()}}}function Ni({configuredUrl:e,error:t,source:n,scriptType:r}){if(V.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&xb(t.message)){let s;e?s=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:s="Please make sure CSP is correctly configured.",V.error(`${s} See documentation at ${$r}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&li(t)}function xb(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Tb=30*Se;function ru(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},et=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-J)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=L(s.adler,h,o,l):2===s.state.wrap&&(s.adler=T(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},at=function(t,e){for(var a,n;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},nt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var it=[new rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(et(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)})),new rt(4,4,8,4,at),new rt(4,5,16,8,at),new rt(4,6,32,32,at),new rt(4,4,16,16,nt),new rt(8,16,32,32,nt),new rt(8,16,128,128,nt),new rt(8,32,128,256,nt),new rt(32,128,258,1024,nt),new rt(32,258,258,4096,nt)];function st(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var ht=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=it[e.level].max_lazy,e.good_match=it[e.level].good_length,e.nice_match=it[e.level].nice_length,e.max_chain_length=it[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},lt=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(et(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(et(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):it[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},_t=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},ot=new Uint8Array(256),dt=0;dt<256;dt++)ot[dt]=dt>=252?6:dt>=248?5:dt>=240?4:dt>=224?3:dt>=192?2:1;ot[254]=ot[254]=1;var ut=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ft=Object.prototype.toString;function ct(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ut,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new st;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,ht(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ft.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,et(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function pt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function gt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}ct.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ft.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=lt(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=_t(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ct.prototype.onData=function(t){this.chunks.push(t)},ct.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.6.3"};case"write":{let n=e.get(a.streamId);n||(n=new ct,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:gt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){pt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){pt(e,t)}}()})();'])))}let oe={status:0};function su(e,t,n,r=ru){switch(oe.status===0&&Ab(e,t,r),oe.status){case 1:return oe.initializationFailureCallbacks.push(n),oe.worker;case 3:return oe.worker}}function iu(){return oe.status}function Ab(e,t,n=ru){try{const r=n(e),{stop:s}=Z(e,r,"error",a=>{Mi(e,t,a)}),{stop:i}=Z(e,r,"message",({data:a})=>{a.type==="errored"?Mi(e,t,a.error,a.streamId):a.type==="initialized"&&Ib(a.version)});r.postMessage({action:"init"}),fe(()=>Rb(t),Tb),oe={status:1,worker:r,stop:()=>{s(),i()},initializationFailureCallbacks:[]}}catch(r){Mi(e,t,r)}}function Rb(e){oe.status===1&&(V.error(`${e} failed to start: a timeout occurred while initializing the Worker`),oe.initializationFailureCallbacks.forEach(t=>t()),oe={status:2})}function Ib(e){oe.status===1&&(oe={status:3,worker:oe.worker,stop:oe.stop,version:e})}function Mi(e,t,n,r){oe.status===1||oe.status===0?(Ni({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),oe.status===1&&oe.initializationFailureCallbacks.forEach(s=>s()),oe={status:2}):li(n,{worker_version:oe.status===3&&oe.version,stream_id:r})}function ou(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function kb(e,t,n,r){const s=t.findTrackedSession(),i=Ob(s,r),o=n.findView();return gb(e,{viewContext:o,errorType:i,session:s})}function Ob(e,t){if(!ou())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function Pb(e,t,n,r,s,i){let o=0,a;t.subscribe(9,()=>{(o===2||o===3)&&(u(),o=1)}),t.subscribe(10,()=>{o===1&&l()});const c=async()=>{const[d]=await Promise.all([s(),dm(e,"interactive")]);if(o!==2)return;const f=i();if(!f||!d){o=0;return}({stop:a}=d(t,e,n,r,f)),o=3};function l(d){const f=n.findTrackedSession();if(Lb(f,d)){o=1;return}Nb(o)||(o=2,c().catch(dt),Mb(f,d)&&n.setForcedReplay())}function u(){o===3&&(a==null||a()),o=0}return{start:l,stop:u,getSessionReplayLink(){return kb(e,n,r,o!==0)},isRecording:()=>o===3}}function Lb(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function Nb(e){return e===2||e===3}function Mb(e,t){return t&&t.force&&e.sessionReplay===0}function Db(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:z},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Fb(e,t){if(zt()&&!Ac("records")||!ou())return{start:z,stop:z,getReplayStats:()=>{},onRumStart:z,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=Db();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:s,isRecording:()=>iu()===3&&n.isRecording(),getReplayStats:i=>iu()===3?Eb(i):void 0};function s(i,o,a,c,l){let u;function d(){return u||(l??(l=su(o,"Datadog Session Replay",()=>{n.stop()},t)),l&&(u=nu(o,l,1))),u}n=Pb(o,i,a,c,e,d),r(o)&&n.start()}}async function Bb(e=Ub){try{return await e()}catch(t){Ni({error:t,source:"Recorder",scriptType:"module"})}}async function Ub(){return(await Promise.resolve().then(()=>ov)).startRecording}function $b(){return et().Profiler!==void 0}async function Vb(e=zb){try{return await e()}catch(t){Ni({error:t,source:"Profiler",scriptType:"module"})}}async function zb(){return(await Promise.resolve().then(()=>Sv)).createRumProfiler}function Hb(){let e;function t(n,r,s,i){!$b()||!yt(r.profilingSampleRate)||Vb().then(o=>{if(!o){ft("[DD_RUM] Failed to lazy load the RUM Profiler");return}e=o(r,n,s),e.start(i.findView())}).catch(dt)}return{onRumStart:t,stop:()=>{e==null||e.stop().catch(dt)}}}const jb=Fb(Bb),Wb=Hb(),Be=u1(fb,jb,Wb,{startDeflateWorker:su,createDeflateEncoder:nu});_g(et(),"DD_RUM",Be);const On=class On{init(){if(On.isInitialized){console.info("Tracker [DD]: already initialized");return}Be.init({applicationId:"3ea6bf90-69cc-42fe-9e69-d461f783221d",clientToken:"pub51a171e3f587fb85f6d3f0ed2bf8f531",site:"datadoghq.com",service:"astropay-payments-library",env:"production",version:"0.1.3",sessionSampleRate:50,sessionReplaySampleRate:10,defaultPrivacyLevel:"mask-user-input",trackViewsManually:!0,trackResources:!1,trackUserInteractions:!1,beforeSend:t=>this.filterEvents(t)}),Be.startView({name:"ap_cl_view_mounted"}),Be.startSessionReplayRecording(),On.isInitialized=!0,console.info("Tracker [DD]: initialized")}track(t,n){Be==null||Be.addAction(t,n||{})}trackError(t,n){Be==null||Be.addError(t,{context:n})}destroy(){console.info("Tracker [DD]: destroying"),typeof Be.stopSessionReplayRecording=="function"&&Be.stopSessionReplayRecording(),Be.addAction("ap_cl_view_unmounted",{reason:"component_destroyed"}),On.isInitialized=!1}filterEvents(t){var n,r,s;return!!(t.type==="view"&&((n=t.view.name)!=null&&n.startsWith("ap_cl_"))||t.type==="action"&&typeof((r=t.action.target)==null?void 0:r.name)=="string"&&t.action.target.name.startsWith("ap_cl_")||t.type==="error"&&((s=t.error)==null?void 0:s.source)==="custom")}};T(On,"isInitialized",!1);let Di=On,En=[];class je{static init(t){if(!t){console.info("Tracking disabled");return}En=[new Di],En.forEach(n=>n.init())}static trackEvent(t,n){En.forEach(r=>r.track(t,n))}static trackError(t,n){En.forEach(r=>r.trackError(t,n))}static destroy(){En.forEach(t=>t.destroy()),En=[]}}const he=class he{static init(t,n){if(!t)throw console.error('AstroPay Payments Library: Missing "app-id". Call init function first.'),new Error("app-id is required for authentication.");if(he.isInitialized){console.warn("AstroPay Payments Library: Already initialized.");return}he.token=t,je.init((n==null?void 0:n.tracking)??!0),$.init({theme:(n==null?void 0:n.theme)??"light",styles:(n==null?void 0:n.styles)??{}}),te.init({language:(n==null?void 0:n.language)??"en"}),Nn.init({environment:(n==null?void 0:n.environment)??"production",currencyMode:(n==null?void 0:n.currencyMode)??"iso"}),mt.init({appName:"ap-cl",baseURL:"https://partners-api.astropay.com/api",timeout:5e3}),je.trackEvent("ap_cl_init",{app_id:t,origin:window.location.origin}),he.isInitialized=!0}static registerComponent(t){he.components.add(t)}static unregisterComponent(t){he.components.delete(t)}static getToken(){if(!he.isInitialized){const t="AstroPay Payments Library: Not initialized.";throw console.error(t),new Error(t)}return he.token}static destroy(){he.isInitialized&&(he.components.forEach(t=>t.destroy()),he.components.clear(),he.isInitialized=!1,je.destroy(),he.token="")}static isLibInitialized(){return he.isInitialized}};T(he,"isInitialized",!1),T(he,"token"),T(he,"components",new Set);let rt=he;class ae{constructor({tag:t,elementId:n,styles:r}){T(this,"element");if(this.element=document.createElement(t),n&&this.element.setAttribute("id",n),r){const s=$.getStyles(),i=r(s);this.element.className=i}}addStyleClass(t){this.element.classList.add(t)}render(t){t instanceof ae?t.element.appendChild(this.element):t.appendChild(this.element)}destroy(){this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}function qb(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Kb(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Gb=function(){function e(n){var r=this;this._insertTag=function(s){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,i),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Kb(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var i=qb(s);try{i.insertRule(r,i.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),_e="-ms-",gs="-moz-",j="-webkit-",au="comm",Fi="rule",Bi="decl",Yb="@import",cu="@keyframes",Jb="@layer",Zb=Math.abs,ms=String.fromCharCode,Xb=Object.assign;function Qb(e,t){return be(e,0)^45?(((t<<2^be(e,0))<<2^be(e,1))<<2^be(e,2))<<2^be(e,3):0}function lu(e){return e.trim()}function ew(e,t){return(e=t.exec(e))?e[0]:e}function W(e,t,n){return e.replace(t,n)}function Ui(e,t){return e.indexOf(t)}function be(e,t){return e.charCodeAt(t)|0}function cr(e,t,n){return e.slice(t,n)}function st(e){return e.length}function $i(e){return e.length}function ys(e,t){return t.push(e),e}function tw(e,t){return e.map(t).join("")}var bs=1,Cn=1,uu=0,Me=0,le=0,xn="";function ws(e,t,n,r,s,i,o){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:bs,column:Cn,length:o,return:""}}function lr(e,t){return Xb(ws("",null,null,"",null,null,0),e,{length:-e.length},t)}function nw(){return le}function rw(){return le=Me>0?be(xn,--Me):0,Cn--,le===10&&(Cn=1,bs--),le}function Ue(){return le=Me<uu?be(xn,Me++):0,Cn++,le===10&&(Cn=1,bs++),le}function it(){return be(xn,Me)}function Ss(){return Me}function ur(e,t){return cr(xn,e,t)}function dr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function du(e){return bs=Cn=1,uu=st(xn=e),Me=0,[]}function fu(e){return xn="",e}function _s(e){return lu(ur(Me-1,Vi(e===91?e+2:e===40?e+1:e)))}function sw(e){for(;(le=it())&&le<33;)Ue();return dr(e)>2||dr(le)>3?"":" "}function iw(e,t){for(;--t&&Ue()&&!(le<48||le>102||le>57&&le<65||le>70&&le<97););return ur(e,Ss()+(t<6&&it()==32&&Ue()==32))}function Vi(e){for(;Ue();)switch(le){case e:return Me;case 34:case 39:e!==34&&e!==39&&Vi(le);break;case 40:e===41&&Vi(e);break;case 92:Ue();break}return Me}function ow(e,t){for(;Ue()&&e+le!==57;)if(e+le===84&&it()===47)break;return"/*"+ur(t,Me-1)+"*"+ms(e===47?e:Ue())}function aw(e){for(;!dr(it());)Ue();return ur(e,Me)}function cw(e){return fu(vs("",null,null,null,[""],e=du(e),0,[0],e))}function vs(e,t,n,r,s,i,o,a,c){for(var l=0,u=0,d=o,f=0,h=0,p=0,g=1,m=1,w=1,v=0,b="",_=s,k=i,x=r,y=b;m;)switch(p=v,v=Ue()){case 40:if(p!=108&&be(y,d-1)==58){Ui(y+=W(_s(v),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:y+=_s(v);break;case 9:case 10:case 13:case 32:y+=sw(p);break;case 92:y+=iw(Ss()-1,7);continue;case 47:switch(it()){case 42:case 47:ys(lw(ow(Ue(),Ss()),t,n),c);break;default:y+="/"}break;case 123*g:a[l++]=st(y)*w;case 125*g:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+u:w==-1&&(y=W(y,/\f/g,"")),h>0&&st(y)-d&&ys(h>32?hu(y+";",r,n,d-1):hu(W(y," ","")+";",r,n,d-2),c);break;case 59:y+=";";default:if(ys(x=pu(y,t,n,l,u,s,a,b,_=[],k=[],d),i),v===123)if(u===0)vs(y,t,x,x,_,i,d,a,k);else switch(f===99&&be(y,3)===110?100:f){case 100:case 108:case 109:case 115:vs(e,x,x,r&&ys(pu(e,x,x,0,0,s,a,b,s,_=[],d),k),s,k,d,a,r?_:k);break;default:vs(y,x,x,x,[""],k,0,a,k)}}l=u=h=0,g=w=1,b=y="",d=o;break;case 58:d=1+st(y),h=p;default:if(g<1){if(v==123)--g;else if(v==125&&g++==0&&rw()==125)continue}switch(y+=ms(v),v*g){case 38:w=u>0?1:(y+="\f",-1);break;case 44:a[l++]=(st(y)-1)*w,w=1;break;case 64:it()===45&&(y+=_s(Ue())),f=it(),u=d=st(b=y+=aw(Ss())),v++;break;case 45:p===45&&st(y)==2&&(g=0)}}return i}function pu(e,t,n,r,s,i,o,a,c,l,u){for(var d=s-1,f=s===0?i:[""],h=$i(f),p=0,g=0,m=0;p<r;++p)for(var w=0,v=cr(e,d+1,d=Zb(g=o[p])),b=e;w<h;++w)(b=lu(g>0?f[w]+" "+v:W(v,/&\f/g,f[w])))&&(c[m++]=b);return ws(e,t,n,s===0?Fi:a,c,l,u)}function lw(e,t,n){return ws(e,t,n,au,ms(nw()),cr(e,2,-2),0)}function hu(e,t,n,r){return ws(e,t,n,Bi,cr(e,0,r),cr(e,r+1,-1),r)}function Tn(e,t){for(var n="",r=$i(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function uw(e,t,n,r){switch(e.type){case Jb:if(e.children.length)break;case Yb:case Bi:return e.return=e.return||e.value;case au:return"";case cu:return e.return=e.value+"{"+Tn(e.children,r)+"}";case Fi:e.value=e.props.join(",")}return st(n=Tn(e.children,r))?e.return=e.value+"{"+n+"}":""}function dw(e){var t=$i(e);return function(n,r,s,i){for(var o="",a=0;a<t;a++)o+=e[a](n,r,s,i)||"";return o}}function fw(e){return function(t){t.root||(t=t.return)&&e(t)}}function pw(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var hw=function(t,n,r){for(var s=0,i=0;s=i,i=it(),s===38&&i===12&&(n[r]=1),!dr(i);)Ue();return ur(t,Me)},gw=function(t,n){var r=-1,s=44;do switch(dr(s)){case 0:s===38&&it()===12&&(n[r]=1),t[r]+=hw(Me-1,n,r);break;case 2:t[r]+=_s(s);break;case 4:if(s===44){t[++r]=it()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=ms(s)}while(s=Ue());return t},mw=function(t,n){return fu(gw(du(t),n))},gu=new WeakMap,yw=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!gu.get(r))&&!s){gu.set(t,!0);for(var i=[],o=mw(n,i),a=r.props,c=0,l=0;c<o.length;c++)for(var u=0;u<a.length;u++,l++)t.props[l]=i[c]?o[c].replace(/&\f/g,a[u]):a[u]+" "+o[c]}}},bw=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function mu(e,t){switch(Qb(e,t)){case 5103:return j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return j+e+gs+e+_e+e+e;case 6828:case 4268:return j+e+_e+e+e;case 6165:return j+e+_e+"flex-"+e+e;case 5187:return j+e+W(e,/(\w+).+(:[^]+)/,j+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return j+e+_e+"flex-item-"+W(e,/flex-|-self/,"")+e;case 4675:return j+e+_e+"flex-line-pack"+W(e,/align-content|flex-|-self/,"")+e;case 5548:return j+e+_e+W(e,"shrink","negative")+e;case 5292:return j+e+_e+W(e,"basis","preferred-size")+e;case 6060:return j+"box-"+W(e,"-grow","")+j+e+_e+W(e,"grow","positive")+e;case 4554:return j+W(e,/([^-])(transform)/g,"$1"+j+"$2")+e;case 6187:return W(W(W(e,/(zoom-|grab)/,j+"$1"),/(image-set)/,j+"$1"),e,"")+e;case 5495:case 3959:return W(e,/(image-set\([^]*)/,j+"$1$`$1");case 4968:return W(W(e,/(.+:)(flex-)?(.*)/,j+"box-pack:$3"+_e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+j+e+e;case 4095:case 3583:case 4068:case 2532:return W(e,/(.+)-inline(.+)/,j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(st(e)-1-t>6)switch(be(e,t+1)){case 109:if(be(e,t+4)!==45)break;case 102:return W(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+gs+(be(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ui(e,"stretch")?mu(W(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(be(e,t+1)!==115)break;case 6444:switch(be(e,st(e)-3-(~Ui(e,"!important")&&10))){case 107:return W(e,":",":"+j)+e;case 101:return W(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j+(be(e,14)===45?"inline-":"")+"box$3$1"+j+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(be(e,t+11)){case 114:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return j+e+_e+e+e}return e}var ww=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case Bi:t.return=mu(t.value,t.length);break;case cu:return Tn([lr(t,{value:W(t.value,"@","@"+j)})],s);case Fi:if(t.length)return tw(t.props,function(i){switch(ew(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Tn([lr(t,{props:[W(i,/:(read-\w+)/,":"+gs+"$1")]})],s);case"::placeholder":return Tn([lr(t,{props:[W(i,/:(plac\w+)/,":"+j+"input-$1")]}),lr(t,{props:[W(i,/:(plac\w+)/,":"+gs+"$1")]}),lr(t,{props:[W(i,/:(plac\w+)/,_e+"input-$1")]})],s)}return""})}},Sw=[ww],_w=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var s=t.stylisPlugins||Sw,i={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),w=1;w<m.length;w++)i[m[w]]=!0;a.push(g)});var c,l=[yw,bw];{var u,d=[uw,fw(function(g){u.insert(g)})],f=dw(l.concat(s,d)),h=function(m){return Tn(cw(m),f)};c=function(m,w,v,b){u=v,h(m?m+"{"+w.styles+"}":w.styles),b&&(p.inserted[w.name]=!0)}}var p={key:n,sheet:new Gb({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return p.sheet.hydrate(a),p};function vw(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ew={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Cw=/[A-Z]|^ms/g,xw=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yu=function(t){return t.charCodeAt(1)===45},bu=function(t){return t!=null&&typeof t!="boolean"},zi=pw(function(e){return yu(e)?e:e.replace(Cw,"-$&").toLowerCase()}),wu=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(xw,function(r,s,i){return Ct={name:s,styles:i,next:Ct},s})}return Ew[t]!==1&&!yu(t)&&typeof n=="number"&&n!==0?n+"px":n};function Es(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return Ct={name:s.name,styles:s.styles,next:Ct},s.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)Ct={name:o.name,styles:o.styles,next:Ct},o=o.next;var a=i.styles+";";return a}return Tw(e,t,n)}}var c=n;if(t==null)return c;var l=t[c];return l!==void 0?l:c}function Tw(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=Es(e,t,n[s])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=i+"{"+t[a]+"}":bu(a)&&(r+=zi(i)+":"+wu(i,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)bu(o[c])&&(r+=zi(i)+":"+wu(i,o[c])+";");else{var l=Es(e,t,o);switch(i){case"animation":case"animationName":{r+=zi(i)+":"+l+";";break}default:r+=i+"{"+l+"}"}}}return r}var Su=/label:\s*([^\s;{]+)\s*(;|$)/g,Ct;function Hi(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";Ct=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,s+=Es(n,t,i);else{var o=i;s+=o[0]}for(var a=1;a<e.length;a++)if(s+=Es(n,t,e[a]),r){var c=i;s+=c[a]}Su.lastIndex=0;for(var l="",u;(u=Su.exec(s))!==null;)l+="-"+u[1];var d=vw(s)+l;return{name:d,styles:s,next:Ct}}function _u(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var Aw=function(t,n,r){var s=t.key+"-"+n.name;t.registered[s]===void 0&&(t.registered[s]=n.styles)},Rw=function(t,n,r){Aw(t,n);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+s:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function vu(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Eu(e,t,n){var r=[],s=_u(e,r,n);return r.length<2?n:s+t(r)}var Iw=function(t){var n=_w(t);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered,void 0);return Rw(n,d),n.key+"-"+d.name},s=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered),f="animation-"+d.name;return vu(n,{name:d.name,styles:"@keyframes "+f+"{"+d.styles+"}"}),f},i=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered);vu(n,d)},o=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];return Eu(n.registered,r,kw(l))};return{css:r,cx:o,injectGlobal:i,keyframes:s,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:_u.bind(null,n.registered),merge:Eu.bind(null,n.registered,r)}},kw=function e(t){for(var n="",r=0;r<t.length;r++){var s=t[r];if(s!=null){var i=void 0;switch(typeof s){case"boolean":break;case"object":{if(Array.isArray(s))i=e(s);else{i="";for(var o in s)s[o]&&o&&(i&&(i+=" "),i+=o)}break}default:i=s}i&&(n&&(n+=" "),n+=i)}}return n},ji=Iw({key:"css"}),Ow=ji.cx,fr=ji.keyframes,K=ji.css;const Pw=(e,t)=>K`
|
|
20
20
|
font-family: ${e.fontFamily};
|
|
21
21
|
color: ${(t==null?void 0:t.color)||e.textPrimaryColor};
|
|
22
22
|
|
|
@@ -687,7 +687,7 @@ Minimum version required to store current data is: `+A+`.
|
|
|
687
687
|
align-items: center;
|
|
688
688
|
gap: 8px;
|
|
689
689
|
}
|
|
690
|
-
`;class JS extends ae{constructor({methodCode:n,paymentExternalId:r,onSuccess:s}){super({tag:"div",styles:i=>YS(i)});T(this,"loadingWrapper");T(this,"paymentMethodData");T(this,"onSuccess");T(this,"timerElement",null);T(this,"timerInstance",null);T(this,"pollingService",null);this.paymentMethodData={methodCode:n,paymentExternalId:r},s&&(this.onSuccess=s),this.loadingWrapper=this.createLoadingWrapper(),this.element.append(this.loadingWrapper),this.fetchPaymentMethodData()}createLoadingWrapper(){const n=document.createElement("div");n.classList.add("loading-wrapper");const r=new xt({size:100,variant:"fetching",color:$.getStyles().primaryColor}).element,s=new q({text:te.translate("waiting_confirmation"),size:20,lineHeight:30,weight:600}).element;s.style.marginTop="8px";const i=new q({text:te.translate("do_not_close_window"),size:16,lineHeight:24}).element;return n.append(r,s,i),n}async fetchPaymentMethodData(){try{const n=await ld.postPaymentMethodCreation(this.paymentMethodData);this.renderSections(n.sections)}catch(n){const r=n;this.showErrorMessage(r.message)}finally{this.loadingWrapper.remove()}}async checkPaymentStatus(){try{const n=await at.getPaymentStatus(this.paymentMethodData.paymentExternalId);n.pollingStatus===In.ACCEPTED?this.initializePollingService(n.pollingMetadata):n.pollingStatus===In.FINISHED&&this.renderSuccessPage(n)}catch(n){const r=n;this.showErrorMessage(r.message),this.stopTimer(),this.pollingService&&this.pollingService.stopPolling()}}initializePollingService(n){this.pollingService=new od(n,r=>this.showWaitingInfo(r),r=>this.renderSuccessPage(r),r=>{const s=r;this.showErrorMessage(s.message)}),this.pollingService.startPolling()}stopTimer(){this.timerInstance&&(this.timerInstance.stopTimer(),this.timerInstance=null,this.timerElement=null)}renderSuccessPage(n){var i,o;const r=[],s=new id({type:"success",title:(i=n.data.successSection)==null?void 0:i.title,description:(o=n.data.successSection)==null?void 0:o.description}).element;r.push(s),this.onSuccess?this.onSuccess(r):(this.element.innerHTML="",r.forEach(a=>this.element.append(a)))}showErrorMessage(n){this.element.innerHTML="";const r=document.createElement("div");r.classList.add("timeout-container");const s=new q({text:n,size:12,color:$.getStyles().apErrorText}).element;r.append(s,this.renderRetryButton()),this.element.append(r)}showWaitingInfo(n){let r=this.element.querySelector(".loading-pooling");r||(r=document.createElement("div"),r.classList.add("loading-pooling"),this.element.append(r)),r.innerHTML="";const s=new xt({size:12,color:$.getStyles().textPrimaryColor}).element,i=new q({text:n}).element;r.append(s,i)}async renderSections(n){n.filter(r=>!!r).sort((r,s)=>r.order-s.order).forEach(r=>{const{componentType:s,metadata:i}=r;switch(s){case Kt.AMOUNT_DISPLAY:this.renderAmountDisplay(i);break;case Kt.COPY:this.renderCopy(i);break;case Kt.DESCRIPTION:this.renderDescription(i);break;case Kt.EXPIRATION_TIMER:this.renderTimer(i);break;case Kt.QR_CODE:this.renderQRCode(i);break;case Kt.SHARE:this.renderShare(i);break;default:console.warn("Unknown component type:",s)}}),await this.checkPaymentStatus()}renderCopy(n){const r=new An({text:n.label,variant:"copy-to-clipboard",size:"medium",iconLeft:n.iconLeft,iconRight:n.iconRight??"copy_2_line",onClick:()=>{Ts(n.value)}}).element;this.element.append(r)}renderShare(n){const r=new An({text:n.label,variant:"text",size:"medium",iconRight:n.iconRight,iconLeft:n.iconLeft,onClick:()=>{var s,i,o;Ld(((s=n==null?void 0:n.richTextInfo)==null?void 0:s.title)??"Share",((i=n==null?void 0:n.richTextInfo)==null?void 0:i.description)??n.value,(o=n==null?void 0:n.richTextInfo)==null?void 0:o.url)}}).element;this.element.append(r)}renderDescription(n){const r=new q({text:`${n.text} ${GS(n.amount,n.currency,Nn.getCurrencyMode())}`,size:16,lineHeight:24,weight:600}).element;this.element.append(r)}renderQRCode(n){const r=new sd({value:n.value,altText:te.translate("qr_code")}).element;this.element.append(r)}renderAmountDisplay(n){const r=new q({text:n.value,size:16,lineHeight:24,weight:600}).element;this.element.append(r)}renderTimer(n){this.timerInstance=new jS({time:n.time,text:n.label,iconLeft:n.iconLeft,iconRight:n.iconRight,timeoutText:n.timeoutInfo.description,onTimeOut:()=>{this.handleTimeout(n),this.pollingService&&this.pollingService.stopPolling()}}),this.timerElement=this.timerInstance.element,this.element.append(this.timerElement)}handleTimeout(n){this.pollingService&&this.pollingService.stopPolling(),this.stopTimer();const r=document.createElement("div");r.classList.add("timeout-container"),this.timerElement&&r.append(this.timerElement),n.timeoutInfo.description&&r.append(this.renderExpiredPill(n.timeoutInfo.description)),n.timeoutInfo.retry&&r.append(this.renderRetryButton()),this.element.innerHTML="",this.element.append(r)}renderRetryButton(){return new An({text:te.translate("try_again"),variant:"primary",size:"medium",iconRight:"refresh_2_fill",onClick:()=>{this.element.innerHTML="",this.timerElement=null,this.timerInstance=null,this.pollingService&&this.pollingService.stopPolling(),this.element.append(this.loadingWrapper),this.fetchPaymentMethodData()}}).element}renderExpiredPill(n){return new Ki({items:[{title:n,icon:"alert_line"}],bgColor:$.getStyles().apPillDisableBgColor,color:$.getStyles().apPillDisableTxtColor,align:"center"}).element}}const ZS={PIX:"system_pix",CREDIT_CARD:"bank_card_line"},XS=({paymentMethods:e,paymentExternalId:t,onSuccess:n})=>e?e.filter(r=>r.enabled).map(r=>({icon:r.logo||ZS[r.code],title:r.label,content:()=>new JS({paymentExternalId:t,methodCode:r.code,onSuccess:s=>n(s)}).element})):[];class QS extends ae{constructor(n){super({tag:"div",elementId:"payment-component",styles:s=>VS(s)});T(this,"loadingWrapper");T(this,"componentProps");if(this.componentProps={showTitle:!0,showDescription:!0,...n},!rt.isLibInitialized()){const s="AstroPay Payments Library: Not initialized. Call init function first.";console.error(s),this.element.innerHTML="";const i=new q({text:s,size:12,color:$.getStyles().apErrorText}).element;this.element.append(i);return}rt.registerComponent(this),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const r=new xt({size:100,variant:"fetching",color:$.getStyles().primaryColor}).element;this.loadingWrapper.append(r),this.element.appendChild(this.loadingWrapper),je.trackEvent("ap_cl_full_checkout_init"),this.createPayment()}async createPayment(){try{const{amount:n,currency:r,country:s}=this.componentProps,i={country:s.trim(),currency:r.trim(),amount:n},o=await at.postCreatePayment(i,"full_checkout");this.renderPaymentMethods(o)}catch(n){const r=n;this.componentProps.onError&&this.componentProps.onError();const s=new q({text:r.message,size:12,color:$.getStyles().apErrorText}).element;this.element.appendChild(s)}finally{this.loadingWrapper.remove()}}renderPaymentMethods(n){const{paymentExternalId:r,user:s,paymentMethods:i,countries:o,paymentComponentDescription:a,benefits:c}=n;if(this.element.innerHTML="",this.componentProps.showTitle){const f=new q({text:te.translate("astro_express_checkout"),variant:"div",size:16,weight:600}).element;this.element.append(f)}if(this.componentProps.showDescription&&a){const f=new q({text:a}).element;this.element.append(f)}const l={amount:this.componentProps.amount,currency:this.componentProps.currency},u=new cd({paymentExternalId:r,user:s,countries:o,benefits:c,paymentAmount:l,onSuccess:f=>this.showSuccessContent(f)}).element;this.element.append(u);const d=XS({paymentMethods:i,paymentExternalId:r,onSuccess:f=>this.showSuccessContent(f)});if(d.length>0){const f=new Cu({borderType:"dashed"}).element,h=new Kw({items:d}).element;this.element.append(f,h)}}showSuccessContent(n){this.element.innerHTML="";const r=document.createElement("div");if(r.classList.add("payment-success-content"),n.forEach(s=>r.append(s)),this.element.append(r),this.componentProps.onSuccess){const s=document.createElement("div");s.classList.add("loading-success-callback");const i=new xt({size:12,color:$.getStyles().textPrimaryColor}).element,o=new q({text:te.translate("almost_done"),size:12}).element;s.append(i,o),this.element.append(s),
|
|
690
|
+
`;class JS extends ae{constructor({methodCode:n,paymentExternalId:r,onSuccess:s}){super({tag:"div",styles:i=>YS(i)});T(this,"loadingWrapper");T(this,"paymentMethodData");T(this,"onSuccess");T(this,"timerElement",null);T(this,"timerInstance",null);T(this,"pollingService",null);this.paymentMethodData={methodCode:n,paymentExternalId:r},s&&(this.onSuccess=s),this.loadingWrapper=this.createLoadingWrapper(),this.element.append(this.loadingWrapper),this.fetchPaymentMethodData()}createLoadingWrapper(){const n=document.createElement("div");n.classList.add("loading-wrapper");const r=new xt({size:100,variant:"fetching",color:$.getStyles().primaryColor}).element,s=new q({text:te.translate("waiting_confirmation"),size:20,lineHeight:30,weight:600}).element;s.style.marginTop="8px";const i=new q({text:te.translate("do_not_close_window"),size:16,lineHeight:24}).element;return n.append(r,s,i),n}async fetchPaymentMethodData(){try{const n=await ld.postPaymentMethodCreation(this.paymentMethodData);this.renderSections(n.sections)}catch(n){const r=n;this.showErrorMessage(r.message)}finally{this.loadingWrapper.remove()}}async checkPaymentStatus(){try{const n=await at.getPaymentStatus(this.paymentMethodData.paymentExternalId);n.pollingStatus===In.ACCEPTED?this.initializePollingService(n.pollingMetadata):n.pollingStatus===In.FINISHED&&this.renderSuccessPage(n)}catch(n){const r=n;this.showErrorMessage(r.message),this.stopTimer(),this.pollingService&&this.pollingService.stopPolling()}}initializePollingService(n){this.pollingService=new od(n,r=>this.showWaitingInfo(r),r=>this.renderSuccessPage(r),r=>{const s=r;this.showErrorMessage(s.message)}),this.pollingService.startPolling()}stopTimer(){this.timerInstance&&(this.timerInstance.stopTimer(),this.timerInstance=null,this.timerElement=null)}renderSuccessPage(n){var i,o;const r=[],s=new id({type:"success",title:(i=n.data.successSection)==null?void 0:i.title,description:(o=n.data.successSection)==null?void 0:o.description}).element;r.push(s),this.onSuccess?this.onSuccess(r):(this.element.innerHTML="",r.forEach(a=>this.element.append(a)))}showErrorMessage(n){this.element.innerHTML="";const r=document.createElement("div");r.classList.add("timeout-container");const s=new q({text:n,size:12,color:$.getStyles().apErrorText}).element;r.append(s,this.renderRetryButton()),this.element.append(r)}showWaitingInfo(n){let r=this.element.querySelector(".loading-pooling");r||(r=document.createElement("div"),r.classList.add("loading-pooling"),this.element.append(r)),r.innerHTML="";const s=new xt({size:12,color:$.getStyles().textPrimaryColor}).element,i=new q({text:n}).element;r.append(s,i)}async renderSections(n){n.filter(r=>!!r).sort((r,s)=>r.order-s.order).forEach(r=>{const{componentType:s,metadata:i}=r;switch(s){case Kt.AMOUNT_DISPLAY:this.renderAmountDisplay(i);break;case Kt.COPY:this.renderCopy(i);break;case Kt.DESCRIPTION:this.renderDescription(i);break;case Kt.EXPIRATION_TIMER:this.renderTimer(i);break;case Kt.QR_CODE:this.renderQRCode(i);break;case Kt.SHARE:this.renderShare(i);break;default:console.warn("Unknown component type:",s)}}),await this.checkPaymentStatus()}renderCopy(n){const r=new An({text:n.label,variant:"copy-to-clipboard",size:"medium",iconLeft:n.iconLeft,iconRight:n.iconRight??"copy_2_line",onClick:()=>{Ts(n.value)}}).element;this.element.append(r)}renderShare(n){const r=new An({text:n.label,variant:"text",size:"medium",iconRight:n.iconRight,iconLeft:n.iconLeft,onClick:()=>{var s,i,o;Ld(((s=n==null?void 0:n.richTextInfo)==null?void 0:s.title)??"Share",((i=n==null?void 0:n.richTextInfo)==null?void 0:i.description)??n.value,(o=n==null?void 0:n.richTextInfo)==null?void 0:o.url)}}).element;this.element.append(r)}renderDescription(n){const r=new q({text:`${n.text} ${GS(n.amount,n.currency,Nn.getCurrencyMode())}`,size:16,lineHeight:24,weight:600}).element;this.element.append(r)}renderQRCode(n){const r=new sd({value:n.value,altText:te.translate("qr_code")}).element;this.element.append(r)}renderAmountDisplay(n){const r=new q({text:n.value,size:16,lineHeight:24,weight:600}).element;this.element.append(r)}renderTimer(n){this.timerInstance=new jS({time:n.time,text:n.label,iconLeft:n.iconLeft,iconRight:n.iconRight,timeoutText:n.timeoutInfo.description,onTimeOut:()=>{this.handleTimeout(n),this.pollingService&&this.pollingService.stopPolling()}}),this.timerElement=this.timerInstance.element,this.element.append(this.timerElement)}handleTimeout(n){this.pollingService&&this.pollingService.stopPolling(),this.stopTimer();const r=document.createElement("div");r.classList.add("timeout-container"),this.timerElement&&r.append(this.timerElement),n.timeoutInfo.description&&r.append(this.renderExpiredPill(n.timeoutInfo.description)),n.timeoutInfo.retry&&r.append(this.renderRetryButton()),this.element.innerHTML="",this.element.append(r)}renderRetryButton(){return new An({text:te.translate("try_again"),variant:"primary",size:"medium",iconRight:"refresh_2_fill",onClick:()=>{this.element.innerHTML="",this.timerElement=null,this.timerInstance=null,this.pollingService&&this.pollingService.stopPolling(),this.element.append(this.loadingWrapper),this.fetchPaymentMethodData()}}).element}renderExpiredPill(n){return new Ki({items:[{title:n,icon:"alert_line"}],bgColor:$.getStyles().apPillDisableBgColor,color:$.getStyles().apPillDisableTxtColor,align:"center"}).element}}const ZS={PIX:"system_pix",CREDIT_CARD:"bank_card_line"},XS=({paymentMethods:e,paymentExternalId:t,onSuccess:n})=>e?e.filter(r=>r.enabled).map(r=>({icon:r.logo||ZS[r.code],title:r.label,content:()=>new JS({paymentExternalId:t,methodCode:r.code,onSuccess:s=>n(s)}).element})):[];class QS extends ae{constructor(n){super({tag:"div",elementId:"payment-component",styles:s=>VS(s)});T(this,"loadingWrapper");T(this,"componentProps");if(this.componentProps={showTitle:!0,showDescription:!0,...n},!rt.isLibInitialized()){const s="AstroPay Payments Library: Not initialized. Call init function first.";console.error(s),this.element.innerHTML="";const i=new q({text:s,size:12,color:$.getStyles().apErrorText}).element;this.element.append(i);return}rt.registerComponent(this),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const r=new xt({size:100,variant:"fetching",color:$.getStyles().primaryColor}).element;this.loadingWrapper.append(r),this.element.appendChild(this.loadingWrapper),je.trackEvent("ap_cl_full_checkout_init"),this.createPayment()}async createPayment(){try{const{amount:n,currency:r,country:s}=this.componentProps,i={country:s.trim(),currency:r.trim(),amount:n},o=await at.postCreatePayment(i,"full_checkout");this.renderPaymentMethods(o)}catch(n){const r=n;this.componentProps.onError&&this.componentProps.onError();const s=new q({text:r.message,size:12,color:$.getStyles().apErrorText}).element;this.element.appendChild(s)}finally{this.loadingWrapper.remove()}}renderPaymentMethods(n){const{paymentExternalId:r,user:s,paymentMethods:i,countries:o,paymentComponentDescription:a,benefits:c}=n;if(this.element.innerHTML="",this.componentProps.showTitle){const f=new q({text:te.translate("astro_express_checkout"),variant:"div",size:16,weight:600}).element;this.element.append(f)}if(this.componentProps.showDescription&&a){const f=new q({text:a}).element;this.element.append(f)}const l={amount:this.componentProps.amount,currency:this.componentProps.currency},u=new cd({paymentExternalId:r,user:s,countries:o,benefits:c,paymentAmount:l,onSuccess:f=>this.showSuccessContent(f)}).element;this.element.append(u);const d=XS({paymentMethods:i,paymentExternalId:r,onSuccess:f=>this.showSuccessContent(f)});if(d.length>0){const f=new Cu({borderType:"dashed"}).element,h=new Kw({items:d}).element;this.element.append(f,h)}}showSuccessContent(n){this.element.innerHTML="";const r=document.createElement("div");if(r.classList.add("payment-success-content"),n.forEach(s=>r.append(s)),this.element.append(r),je.trackEvent("ap_cl_payment_success"),this.componentProps.onSuccess){const s=document.createElement("div");s.classList.add("loading-success-callback");const i=new xt({size:12,color:$.getStyles().textPrimaryColor}).element,o=new q({text:te.translate("almost_done"),size:12}).element;s.append(i,o),this.element.append(s),setTimeout(()=>{this.componentProps.onSuccess()},5e3)}}render(n){if(!n)throw new Error("Container element not found");n.appendChild(this.element)}destroy(){this.element.remove(),rt.unregisterComponent(this)}}const e_=e=>K`
|
|
691
691
|
background-color: ${e.backgroundColor};
|
|
692
692
|
|
|
693
693
|
display: flex;
|
|
@@ -722,5 +722,5 @@ Minimum version required to store current data is: `+A+`.
|
|
|
722
722
|
justify-content: center;
|
|
723
723
|
gap: 8px;
|
|
724
724
|
}
|
|
725
|
-
`;class t_ extends ae{constructor(n){super({tag:"div",styles:s=>e_(s)});T(this,"loadingWrapper");T(this,"componentProps");this.componentProps=n,rt.registerComponent(this),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const r=new xt({size:100,variant:"fetching",color:$.getStyles().primaryColor}).element;this.loadingWrapper.append(r),this.element.appendChild(this.loadingWrapper),je.trackEvent("ap_cl_astropay_payment_init"),this.createPayment()}async createPayment(){try{const{amount:n,currency:r,country:s}=this.componentProps,i={country:s.trim(),currency:r.trim(),amount:n},o=await at.postCreatePayment(i,"astropay_payment");this.renderAstroPayMethod(o)}catch(n){const r=n;this.componentProps.onError&&this.componentProps.onError();const s=new q({text:r.message,size:12,color:$.getStyles().apErrorText}).element;this.element.appendChild(s)}finally{this.loadingWrapper.remove()}}renderAstroPayMethod(n){const{paymentExternalId:r,user:s,countries:i,benefits:o}=n;this.element.innerHTML="";const a={amount:this.componentProps.amount,currency:this.componentProps.currency},c=new cd({paymentExternalId:r,user:s,countries:i,benefits:o,paymentAmount:a,onSuccess:l=>this.showSuccessContent(l)}).element;this.element.append(c)}showSuccessContent(n){this.element.innerHTML="";const r=document.createElement("div");if(r.classList.add("payment-success-content"),n.forEach(s=>r.append(s)),this.element.append(r),this.componentProps.onSuccess){const s=document.createElement("div");s.classList.add("loading-success-callback");const i=new xt({size:12,color:$.getStyles().textPrimaryColor}).element,o=new q({text:te.translate("almost_done"),size:12}).element;s.append(i,o),this.element.append(s),je.trackEvent("ap_cl_payment_success"),setTimeout(()=>{this.componentProps.onSuccess()},5e3)}}render(n){if(!n)throw new Error("Container element not found");n.appendChild(this.element)}destroy(){this.element.remove(),rt.unregisterComponent(this)}}Np();const wo=new WeakMap;function ct(e){return wo.has(e)}function n_(e){let t=e;for(;t;){if(!ct(t)&&!Ci(t))return!1;t=as(t)}return!0}function De(e){return wo.get(e)}function r_(e,t){wo.set(e,t)}function So(e,t){const n=e.tagName,r=e.value;if(cs(e,t)){const s=e.type;return n==="INPUT"&&(s==="button"||s==="submit"||s==="reset")?r:!r||n==="OPTION"?void 0:Et}if(n==="OPTION"||n==="SELECT")return e.value;if(!(n!=="INPUT"&&n!=="TEXTAREA"))return r}const s_=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,i_=/^[A-Za-z]+:|^\/\//,o_=/^data:.*,/i;function a_(e,t){return e.replace(s_,(n,r,s,i,o,a)=>{const c=s||o||a;if(!t||!c||i_.test(c)||o_.test(c))return n;const l=r||i||"";return`url(${l}${c_(c,t)}${l})`})}function c_(e,t){try{return Zr(e,t).href}catch{return e}}const l_=/[^a-z1-6-_]/;function dd(e){const t=e.toLowerCase().trim();return l_.test(t)?"div":t}function fd(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`}const lt={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},Gt={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},We={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},Je={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},pd={Play:0,Pause:1};function hd(e){if(!(e===void 0||e.length===0))return e.map(t=>{const n=t.cssRules||t.rules;return{cssRules:Array.from(n,i=>i.cssText),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}})}function gd(e,t,n,r){if(t===M.HIDDEN)return null;const s=e.getAttribute(n);if(t===M.MASK&&n!==xi&&!wl.includes(n)&&n!==r.actionNameAttribute){const i=e.tagName;switch(n){case"title":case"alt":case"placeholder":return Et}if(i==="IMG"&&(n==="src"||n==="srcset")){const o=e;if(o.naturalWidth>0)return fd(o.naturalWidth,o.naturalHeight);const{width:a,height:c}=e.getBoundingClientRect();return a>0||c>0?fd(a,c):ll}if(i==="SOURCE"&&(n==="src"||n==="srcset"))return ll;if(i==="A"&&n==="href"||s&&n.startsWith("data-")||i==="IFRAME"&&n==="srcdoc")return Et}return!s||typeof s!="string"?s:el(s)?tl(s):s}function u_(e,t,n){if(t===M.HIDDEN)return{};const r={},s=dd(e.tagName),i=e.ownerDocument;for(let u=0;u<e.attributes.length;u+=1){const f=e.attributes.item(u).name,h=gd(e,t,f,n.configuration);h!==null&&(r[f]=h)}if(e.value&&(s==="textarea"||s==="select"||s==="option"||s==="input")){const u=So(e,t);u!==void 0&&(r.value=u)}if(s==="option"&&t===M.ALLOW){const u=e;u.selected&&(r.selected=u.selected)}if(s==="link"){const u=Array.from(i.styleSheets).find(f=>f.href===e.href),d=_o(u);d&&u&&(r._cssText=d)}if(s==="style"&&e.sheet){const u=_o(e.sheet);u&&(r._cssText=u)}const o=e;if(s==="input"&&(o.type==="radio"||o.type==="checkbox")&&(t===M.ALLOW?r.checked=!!o.checked:cs(o,t)&&delete r.checked),s==="audio"||s==="video"){const u=e;r.rr_mediaState=u.paused?"paused":"played"}let a,c;const l=n.serializationContext;switch(l.status){case 0:a=Math.round(e.scrollTop),c=Math.round(e.scrollLeft),(a||c)&&l.elementsScrollPositions.set(e,{scrollTop:a,scrollLeft:c});break;case 1:l.elementsScrollPositions.has(e)&&({scrollTop:a,scrollLeft:c}=l.elementsScrollPositions.get(e));break}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}function _o(e){if(!e)return null;let t;try{t=e.rules||e.cssRules}catch{}if(!t)return null;const n=Array.from(t,Zp()?d_:md).join("");return a_(n,e.href)}function d_(e){if(p_(e)&&e.selectorText.includes(":")){const t=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return e.cssText.replace(t,"$1\\$2")}return md(e)}function md(e){return f_(e)&&_o(e.styleSheet)||e.cssText}function f_(e){return"styleSheet"in e}function p_(e){return"selectorText"in e}function vo(e,t){const n=m_(e,t);if(!n)return null;const r=De(e)||g_(),s=n;return s.id=r,r_(e,r),t.serializedNodeIds&&t.serializedNodeIds.add(r),s}let h_=1;function g_(){return h_++}function Eo(e,t){const n=[];return cl(e,r=>{const s=vo(r,t);s&&n.push(s)}),n}function m_(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return y_(e,t);case e.DOCUMENT_FRAGMENT_NODE:return b_(e,t);case e.DOCUMENT_TYPE_NODE:return w_(e);case e.ELEMENT_NODE:return S_(e,t);case e.TEXT_NODE:return v_(e,t);case e.CDATA_SECTION_NODE:return E_()}}function y_(e,t){return{type:Gt.Document,childNodes:Eo(e,t),adoptedStyleSheets:hd(e.adoptedStyleSheets)}}function b_(e,t){const n=Ci(e);return n&&t.serializationContext.shadowRootsController.addShadowRoot(e),{type:Gt.DocumentFragment,childNodes:Eo(e,t),isShadowRoot:n,adoptedStyleSheets:n?hd(e.adoptedStyleSheets):void 0}}function w_(e){return{type:Gt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId}}function S_(e,t){const n=dd(e.tagName),r=__(e)||void 0,s=ul(dl(e),t.parentNodePrivacyLevel);if(s===M.HIDDEN){const{width:a,height:c}=e.getBoundingClientRect();return{type:Gt.Element,tagName:n,attributes:{rr_width:`${a}px`,rr_height:`${c}px`,[xi]:U1},childNodes:[],isSVG:r}}if(s===M.IGNORE)return;const i=u_(e,s,t);let o=[];if(B1(e)&&n!=="style"){let a;t.parentNodePrivacyLevel===s&&t.ignoreWhiteSpace===(n==="head")?a=t:a={...t,parentNodePrivacyLevel:s,ignoreWhiteSpace:n==="head"},o=Eo(e,a)}return{type:Gt.Element,tagName:n,attributes:i,childNodes:o,isSVG:r}}function __(e){return e.tagName==="svg"||e instanceof SVGElement}function v_(e,t){const n=pl(e,t.ignoreWhiteSpace||!1,t.parentNodePrivacyLevel);if(n!==void 0)return{type:Gt.Text,textContent:n}}function E_(){return{type:Gt.CDATA,textContent:""}}function C_(e,t,n){return vo(e,{serializationContext:n,parentNodePrivacyLevel:t.defaultPrivacyLevel,configuration:t})}function yd(e){return!!e.changedTouches}function gr(e){return e.composed===!0&&os(e.target)?e.composedPath()[0]:e.target}const bd=25;function x_(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>bd||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>bd}const T_=(e,t)=>{const n=window.visualViewport,r={layoutViewportX:e,layoutViewportY:t,visualViewportX:e,visualViewportY:t};if(n)x_(n)?(r.layoutViewportX=Math.round(e+n.offsetLeft),r.layoutViewportY=Math.round(t+n.offsetTop)):(r.visualViewportX=Math.round(e-n.offsetLeft),r.visualViewportY=Math.round(t-n.offsetTop));else return r;return r},wd=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function Ze(e,t){return{data:{source:e,...t},type:lt.IncrementalSnapshot,timestamp:de()}}const A_=50;function R_(e,t){const{throttled:n,cancel:r}=wt(i=>{const o=gr(i);if(ct(o)){const a=Sd(i);if(!a)return;const c={id:De(o),timeOffset:0,x:a.x,y:a.y};t(Ze(yd(i)?We.TouchMove:We.MouseMove,{positions:[c]}))}},A_,{trailing:!1}),{stop:s}=Ne(e,document,["mousemove","touchmove"],n,{capture:!0,passive:!0});return{stop:()=>{s(),r()}}}function Sd(e){let{clientX:t,clientY:n}=yd(e)?e.changedTouches[0]:e;if(window.visualViewport){const{visualViewportX:r,visualViewportY:s}=T_(t,n);t=r,n=s}if(!Number.isFinite(t)||!Number.isFinite(n)){e.isTrusted&&ft("mouse/touch event without x/y");return}return{x:t,y:n}}const _d={pointerup:Je.MouseUp,mousedown:Je.MouseDown,click:Je.Click,contextmenu:Je.ContextMenu,dblclick:Je.DblClick,focus:Je.Focus,blur:Je.Blur,touchstart:Je.TouchStart,touchend:Je.TouchEnd};function I_(e,t,n){const r=s=>{const i=gr(s);if(nt(i,e.defaultPrivacyLevel)===M.HIDDEN||!ct(i))return;const o=De(i),a=_d[s.type];let c;if(a!==Je.Blur&&a!==Je.Focus){const u=Sd(s);if(!u)return;c={id:o,type:a,x:u.x,y:u.y}}else c={id:o,type:a};const l={id:n.getIdForEvent(s),...Ze(We.MouseInteraction,c)};t(l)};return Ne(e,document,Object.keys(_d),r,{capture:!0,passive:!0})}const k_=100;function vd(e,t,n,r=document){const{throttled:s,cancel:i}=wt(a=>{const c=gr(a);if(!c||nt(c,e.defaultPrivacyLevel)===M.HIDDEN||!ct(c))return;const l=De(c),u=c===document?{scrollTop:Ii(),scrollLeft:jl()}:{scrollTop:Math.round(c.scrollTop),scrollLeft:Math.round(c.scrollLeft)};n.set(c,u),t(Ze(We.Scroll,{id:l,x:u.scrollLeft,y:u.scrollTop}))},k_),{stop:o}=Z(e,r,"scroll",s,{capture:!0,passive:!0});return{stop:()=>{o(),i()}}}const O_=200;function P_(e,t){const n=Wl(e).subscribe(r=>{t(Ze(We.ViewportResize,r))});return{stop:()=>{n.unsubscribe()}}}function L_(e,t){const n=window.visualViewport;if(!n)return{stop:z};const{throttled:r,cancel:s}=wt(()=>{t({data:wd(n),type:lt.VisualViewport,timestamp:de()})},O_,{trailing:!1}),{stop:i}=Ne(e,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),s()}}}function N_(e,t){return Ne(e,document,["play","pause"],n=>{const r=gr(n);!r||nt(r,e.defaultPrivacyLevel)===M.HIDDEN||!ct(r)||t(Ze(We.MediaInteraction,{id:De(r),type:n.type==="play"?pd.Play:pd.Pause}))},{capture:!0,passive:!0})}function M_(e){function t(s,i){s&&ct(s.ownerNode)&&i(De(s.ownerNode))}const n=[Le(CSSStyleSheet.prototype,"insertRule",({target:s,parameters:[i,o]})=>{t(s,a=>e(Ze(We.StyleSheetRule,{id:a,adds:[{rule:i,index:o}]})))}),Le(CSSStyleSheet.prototype,"deleteRule",({target:s,parameters:[i]})=>{t(s,o=>e(Ze(We.StyleSheetRule,{id:o,removes:[{index:i}]})))})];typeof CSSGroupingRule<"u"?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule));function r(s){n.push(Le(s.prototype,"insertRule",({target:i,parameters:[o,a]})=>{t(i.parentStyleSheet,c=>{const l=Ed(i);l&&(l.push(a||0),e(Ze(We.StyleSheetRule,{id:c,adds:[{rule:o,index:l}]})))})}),Le(s.prototype,"deleteRule",({target:i,parameters:[o]})=>{t(i.parentStyleSheet,a=>{const c=Ed(i);c&&(c.push(o),e(Ze(We.StyleSheetRule,{id:a,removes:[{index:c}]})))})}))}return{stop:()=>{n.forEach(s=>s.stop())}}}function Ed(e){const t=[];let n=e;for(;n.parentRule;){const o=Array.from(n.parentRule.cssRules).indexOf(n);t.unshift(o),n=n.parentRule}if(!n.parentStyleSheet)return;const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return t.unshift(s),t}function D_(e,t){return Ne(e,window,["focus","blur"],()=>{t({data:{has_focus:document.hasFocus()},type:lt.Focus,timestamp:de()})})}function F_(e,t,n){const r=e.subscribe(12,s=>{var i,o;s.rawRumEvent.type==="action"&&s.rawRumEvent.action.type==="click"&&(!((o=(i=s.rawRumEvent.action.frustration)===null||i===void 0?void 0:i.type)===null||o===void 0)&&o.length)&&"events"in s.domainContext&&s.domainContext.events&&s.domainContext.events.length&&t({timestamp:s.rawRumEvent.date,type:lt.FrustrationRecord,data:{frustrationTypes:s.rawRumEvent.action.frustration.type,recordIds:s.domainContext.events.map(a=>n.getIdForEvent(a))}})});return{stop:()=>{r.unsubscribe()}}}function B_(e,t){const n=e.subscribe(5,()=>{t({timestamp:de(),type:lt.ViewEnd})});return{stop:()=>{n.unsubscribe()}}}function Cd(e,t,n=document){const r=e.defaultPrivacyLevel,s=new WeakMap,i=n!==document,{stop:o}=Ne(e,n,i?["change"]:["input","change"],u=>{const d=gr(u);(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement)&&c(d)},{capture:!0,passive:!0});let a;if(i)a=z;else{const u=[er(HTMLInputElement.prototype,"value",c),er(HTMLInputElement.prototype,"checked",c),er(HTMLSelectElement.prototype,"value",c),er(HTMLTextAreaElement.prototype,"value",c),er(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{u.forEach(d=>d.stop())}}return{stop:()=>{a(),o()}};function c(u){const d=nt(u,r);if(d===M.HIDDEN)return;const f=u.type;let h;if(f==="radio"||f==="checkbox"){if(cs(u,d))return;h={isChecked:u.checked}}else{const g=So(u,d);if(g===void 0)return;h={text:g}}l(u,h);const p=u.name;f==="radio"&&p&&u.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(p)}"]`).forEach(g=>{g!==u&&l(g,{isChecked:!1})})}function l(u,d){if(!ct(u))return;const f=s.get(u);(!f||f.text!==d.text||f.isChecked!==d.isChecked)&&(s.set(u,d),t(Ze(We.Input,{id:De(u),...d})))}}const U_=100,$_=16;function V_(e){let t=z,n=[];function r(){t(),e(n),n=[]}const{throttled:s,cancel:i}=wt(r,$_,{leading:!1});return{addMutations:o=>{n.length===0&&(t=Oc(s,{timeout:U_})),n.push(...o)},flush:r,stop:()=>{t(),i()}}}function xd(e,t,n,r){const s=Wc();if(!s)return{stop:z,flush:z};const i=V_(a=>{z_(a.concat(o.takeRecords()),e,t,n)}),o=new s(U(i.addMutations));return o.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{o.disconnect(),i.stop()},flush:()=>{i.flush()}}}function z_(e,t,n,r){const s=new Map;e.filter(d=>d.type==="childList").forEach(d=>{d.removedNodes.forEach(f=>{Td(f,r.removeShadowRoot)})});const i=e.filter(d=>d.target.isConnected&&n_(d.target)&&nt(d.target,n.defaultPrivacyLevel,s)!==M.HIDDEN),{adds:o,removes:a,hasBeenSerialized:c}=H_(i.filter(d=>d.type==="childList"),n,r,s),l=j_(i.filter(d=>d.type==="characterData"&&!c(d.target)),n,s),u=W_(i.filter(d=>d.type==="attributes"&&!c(d.target)),n,s);!l.length&&!u.length&&!a.length&&!o.length||t(Ze(We.Mutation,{adds:o,removes:a,texts:l,attributes:u}))}function H_(e,t,n,r){const s=new Set,i=new Map;for(const f of e)f.addedNodes.forEach(h=>{s.add(h)}),f.removedNodes.forEach(h=>{s.has(h)||i.set(h,f.target),s.delete(h)});const o=Array.from(s);q_(o);const a=new Set,c=[];for(const f of o){if(u(f))continue;const h=nt(f.parentNode,t.defaultPrivacyLevel,r);if(h===M.HIDDEN||h===M.IGNORE)continue;const p=vo(f,{serializedNodeIds:a,parentNodePrivacyLevel:h,serializationContext:{status:2,shadowRootsController:n},configuration:t});if(!p)continue;const g=as(f);c.push({nextId:d(f),parentId:De(g),node:p})}const l=[];return i.forEach((f,h)=>{ct(h)&&l.push({parentId:De(f),id:De(h)})}),{adds:c,removes:l,hasBeenSerialized:u};function u(f){return ct(f)&&a.has(De(f))}function d(f){let h=f.nextSibling;for(;h;){if(ct(h))return De(h);h=h.nextSibling}return null}}function j_(e,t,n){var r;const s=[],i=new Set,o=e.filter(a=>i.has(a.target)?!1:(i.add(a.target),!0));for(const a of o){if(a.target.textContent===a.oldValue)continue;const l=nt(as(a.target),t.defaultPrivacyLevel,n);l===M.HIDDEN||l===M.IGNORE||s.push({id:De(a.target),value:(r=pl(a.target,!1,l))!==null&&r!==void 0?r:null})}return s}function W_(e,t,n){const r=[],s=new Map,i=e.filter(a=>{const c=s.get(a.target);return c&&c.has(a.attributeName)?!1:(c?c.add(a.attributeName):s.set(a.target,new Set([a.attributeName])),!0)}),o=new Map;for(const a of i){if(a.target.getAttribute(a.attributeName)===a.oldValue)continue;const l=nt(a.target,t.defaultPrivacyLevel,n),u=gd(a.target,l,a.attributeName,t);let d;if(a.attributeName==="value"){const h=So(a.target,l);if(h===void 0)continue;d=h}else typeof u=="string"?d=u:d=null;let f=o.get(a.target);f||(f={id:De(a.target),attributes:{}},r.push(f),o.set(a.target,f)),f.attributes[a.attributeName]=d}return r}function q_(e){e.sort((t,n)=>{const r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_CONTAINS||r&Node.DOCUMENT_POSITION_FOLLOWING?1:r&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function Td(e,t){os(e)&&t(e.shadowRoot),cl(e,n=>Td(n,t))}function K_(){const e=new WeakMap;return{set(t,n){t===document&&!document.scrollingElement||e.set(t===document?document.scrollingElement:t,n)},get(t){return e.get(t)},has(t){return e.has(t)}}}const G_=(e,t,n)=>{const r=new Map,s={addShadowRoot:i=>{if(r.has(i))return;const o=xd(t,e,s,i),a=Cd(e,t,i),c=vd(e,t,n,i);r.set(i,{flush:()=>o.flush(),stop:()=>{o.stop(),a.stop(),c.stop()}})},removeShadowRoot:i=>{const o=r.get(i);o&&(o.stop(),r.delete(i))},stop:()=>{r.forEach(({stop:i})=>i())},flush:()=>{r.forEach(({flush:i})=>i())}};return s};function Y_(e,t,n,r,s,i){const o=(c=de(),l={status:0,elementsScrollPositions:e,shadowRootsController:t})=>{const{width:u,height:d}=ps(),f=[{data:{height:d,href:window.location.href,width:u},type:lt.Meta,timestamp:c},{data:{has_focus:document.hasFocus()},type:lt.Focus,timestamp:c},{data:{node:C_(document,r,l),initialOffset:{left:jl(),top:Ii()}},type:lt.FullSnapshot,timestamp:c}];return window.visualViewport&&f.push({data:wd(window.visualViewport),type:lt.VisualViewport,timestamp:c}),f};i(o());const{unsubscribe:a}=n.subscribe(2,c=>{s(),i(o(c.startClocks.timeStamp,{shadowRootsController:t,status:1,elementsScrollPositions:e}))});return{stop:a}}function J_(){const e=new WeakMap;let t=1;return{getIdForEvent(n){return e.has(n)||e.set(n,t++),e.get(n)}}}function Z_(e){const{emit:t,configuration:n,lifeCycle:r}=e;if(!t)throw new Error("emit function is required");const s=f=>{t(f),ai("record",{record:f});const h=e.viewHistory.findView();_b(h.id)},i=K_(),o=G_(n,s,i),{stop:a}=Y_(i,o,r,n,c,f=>f.forEach(h=>s(h)));function c(){o.flush(),u.flush()}const l=J_(),u=xd(s,n,o,document),d=[u,R_(n,s),I_(n,s,l),vd(n,s,i,document),P_(n,s),Cd(n,s),N_(n,s),M_(s),D_(n,s),L_(n,s),F_(r,s,l),B_(r,f=>{c(),s(f)})];return{stop:()=>{o.stop(),d.forEach(f=>f.stop()),a()},flushMutations:c,shadowRootsController:o}}function X_(e,t,n){const r=new FormData;r.append("segment",new Blob([e],{type:"application/octet-stream"}),`${t.session.id}-${t.start}`);const s={raw_segment_size:n,compressed_segment_size:e.byteLength,...t},i=JSON.stringify(s);return r.append("event",new Blob([i],{type:"application/json"})),{data:r,bytesCount:e.byteLength}}function Q_({context:e,creationReason:t,encoder:n}){let r=0;const s=e.view.id,i={start:1/0,end:-1/0,creation_reason:t,records_count:0,has_full_snapshot:!1,index_in_view:wb(s),source:"browser",...e};Sb(s);function o(c,l){i.start=Math.min(i.start,c.timestamp),i.end=Math.max(i.end,c.timestamp),i.records_count+=1,i.has_full_snapshot||(i.has_full_snapshot=c.type===lt.FullSnapshot);const u=n.isEmpty?'{"records":[':",";n.write(u+JSON.stringify(c),d=>{r+=d,l(r)})}function a(c){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(i).slice(1)}
|
|
725
|
+
`;class t_ extends ae{constructor(n){super({tag:"div",styles:s=>e_(s)});T(this,"loadingWrapper");T(this,"componentProps");this.componentProps=n,rt.registerComponent(this),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const r=new xt({size:100,variant:"fetching",color:$.getStyles().primaryColor}).element;this.loadingWrapper.append(r),this.element.appendChild(this.loadingWrapper),je.trackEvent("ap_cl_astropay_payment_init"),this.createPayment()}async createPayment(){try{const{amount:n,currency:r,country:s}=this.componentProps,i={country:s.trim(),currency:r.trim(),amount:n},o=await at.postCreatePayment(i,"astropay_payment");this.renderAstroPayMethod(o)}catch(n){const r=n;this.componentProps.onError&&this.componentProps.onError();const s=new q({text:r.message,size:12,color:$.getStyles().apErrorText}).element;this.element.appendChild(s)}finally{this.loadingWrapper.remove()}}renderAstroPayMethod(n){const{paymentExternalId:r,user:s,countries:i,benefits:o}=n;this.element.innerHTML="";const a={amount:this.componentProps.amount,currency:this.componentProps.currency},c=new cd({paymentExternalId:r,user:s,countries:i,benefits:o,paymentAmount:a,onSuccess:l=>this.showSuccessContent(l)}).element;this.element.append(c)}showSuccessContent(n){this.element.innerHTML="";const r=document.createElement("div");if(r.classList.add("payment-success-content"),n.forEach(s=>r.append(s)),this.element.append(r),je.trackEvent("ap_cl_payment_success"),this.componentProps.onSuccess){const s=document.createElement("div");s.classList.add("loading-success-callback");const i=new xt({size:12,color:$.getStyles().textPrimaryColor}).element,o=new q({text:te.translate("almost_done"),size:12}).element;s.append(i,o),this.element.append(s),setTimeout(()=>{this.componentProps.onSuccess()},5e3)}}render(n){if(!n)throw new Error("Container element not found");n.appendChild(this.element)}destroy(){this.element.remove(),rt.unregisterComponent(this)}}Np();const wo=new WeakMap;function ct(e){return wo.has(e)}function n_(e){let t=e;for(;t;){if(!ct(t)&&!Ci(t))return!1;t=as(t)}return!0}function De(e){return wo.get(e)}function r_(e,t){wo.set(e,t)}function So(e,t){const n=e.tagName,r=e.value;if(cs(e,t)){const s=e.type;return n==="INPUT"&&(s==="button"||s==="submit"||s==="reset")?r:!r||n==="OPTION"?void 0:Et}if(n==="OPTION"||n==="SELECT")return e.value;if(!(n!=="INPUT"&&n!=="TEXTAREA"))return r}const s_=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,i_=/^[A-Za-z]+:|^\/\//,o_=/^data:.*,/i;function a_(e,t){return e.replace(s_,(n,r,s,i,o,a)=>{const c=s||o||a;if(!t||!c||i_.test(c)||o_.test(c))return n;const l=r||i||"";return`url(${l}${c_(c,t)}${l})`})}function c_(e,t){try{return Zr(e,t).href}catch{return e}}const l_=/[^a-z1-6-_]/;function dd(e){const t=e.toLowerCase().trim();return l_.test(t)?"div":t}function fd(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`}const lt={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},Gt={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},We={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},Je={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},pd={Play:0,Pause:1};function hd(e){if(!(e===void 0||e.length===0))return e.map(t=>{const n=t.cssRules||t.rules;return{cssRules:Array.from(n,i=>i.cssText),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}})}function gd(e,t,n,r){if(t===M.HIDDEN)return null;const s=e.getAttribute(n);if(t===M.MASK&&n!==xi&&!wl.includes(n)&&n!==r.actionNameAttribute){const i=e.tagName;switch(n){case"title":case"alt":case"placeholder":return Et}if(i==="IMG"&&(n==="src"||n==="srcset")){const o=e;if(o.naturalWidth>0)return fd(o.naturalWidth,o.naturalHeight);const{width:a,height:c}=e.getBoundingClientRect();return a>0||c>0?fd(a,c):ll}if(i==="SOURCE"&&(n==="src"||n==="srcset"))return ll;if(i==="A"&&n==="href"||s&&n.startsWith("data-")||i==="IFRAME"&&n==="srcdoc")return Et}return!s||typeof s!="string"?s:el(s)?tl(s):s}function u_(e,t,n){if(t===M.HIDDEN)return{};const r={},s=dd(e.tagName),i=e.ownerDocument;for(let u=0;u<e.attributes.length;u+=1){const f=e.attributes.item(u).name,h=gd(e,t,f,n.configuration);h!==null&&(r[f]=h)}if(e.value&&(s==="textarea"||s==="select"||s==="option"||s==="input")){const u=So(e,t);u!==void 0&&(r.value=u)}if(s==="option"&&t===M.ALLOW){const u=e;u.selected&&(r.selected=u.selected)}if(s==="link"){const u=Array.from(i.styleSheets).find(f=>f.href===e.href),d=_o(u);d&&u&&(r._cssText=d)}if(s==="style"&&e.sheet){const u=_o(e.sheet);u&&(r._cssText=u)}const o=e;if(s==="input"&&(o.type==="radio"||o.type==="checkbox")&&(t===M.ALLOW?r.checked=!!o.checked:cs(o,t)&&delete r.checked),s==="audio"||s==="video"){const u=e;r.rr_mediaState=u.paused?"paused":"played"}let a,c;const l=n.serializationContext;switch(l.status){case 0:a=Math.round(e.scrollTop),c=Math.round(e.scrollLeft),(a||c)&&l.elementsScrollPositions.set(e,{scrollTop:a,scrollLeft:c});break;case 1:l.elementsScrollPositions.has(e)&&({scrollTop:a,scrollLeft:c}=l.elementsScrollPositions.get(e));break}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}function _o(e){if(!e)return null;let t;try{t=e.rules||e.cssRules}catch{}if(!t)return null;const n=Array.from(t,Zp()?d_:md).join("");return a_(n,e.href)}function d_(e){if(p_(e)&&e.selectorText.includes(":")){const t=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return e.cssText.replace(t,"$1\\$2")}return md(e)}function md(e){return f_(e)&&_o(e.styleSheet)||e.cssText}function f_(e){return"styleSheet"in e}function p_(e){return"selectorText"in e}function vo(e,t){const n=m_(e,t);if(!n)return null;const r=De(e)||g_(),s=n;return s.id=r,r_(e,r),t.serializedNodeIds&&t.serializedNodeIds.add(r),s}let h_=1;function g_(){return h_++}function Eo(e,t){const n=[];return cl(e,r=>{const s=vo(r,t);s&&n.push(s)}),n}function m_(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return y_(e,t);case e.DOCUMENT_FRAGMENT_NODE:return b_(e,t);case e.DOCUMENT_TYPE_NODE:return w_(e);case e.ELEMENT_NODE:return S_(e,t);case e.TEXT_NODE:return v_(e,t);case e.CDATA_SECTION_NODE:return E_()}}function y_(e,t){return{type:Gt.Document,childNodes:Eo(e,t),adoptedStyleSheets:hd(e.adoptedStyleSheets)}}function b_(e,t){const n=Ci(e);return n&&t.serializationContext.shadowRootsController.addShadowRoot(e),{type:Gt.DocumentFragment,childNodes:Eo(e,t),isShadowRoot:n,adoptedStyleSheets:n?hd(e.adoptedStyleSheets):void 0}}function w_(e){return{type:Gt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId}}function S_(e,t){const n=dd(e.tagName),r=__(e)||void 0,s=ul(dl(e),t.parentNodePrivacyLevel);if(s===M.HIDDEN){const{width:a,height:c}=e.getBoundingClientRect();return{type:Gt.Element,tagName:n,attributes:{rr_width:`${a}px`,rr_height:`${c}px`,[xi]:U1},childNodes:[],isSVG:r}}if(s===M.IGNORE)return;const i=u_(e,s,t);let o=[];if(B1(e)&&n!=="style"){let a;t.parentNodePrivacyLevel===s&&t.ignoreWhiteSpace===(n==="head")?a=t:a={...t,parentNodePrivacyLevel:s,ignoreWhiteSpace:n==="head"},o=Eo(e,a)}return{type:Gt.Element,tagName:n,attributes:i,childNodes:o,isSVG:r}}function __(e){return e.tagName==="svg"||e instanceof SVGElement}function v_(e,t){const n=pl(e,t.ignoreWhiteSpace||!1,t.parentNodePrivacyLevel);if(n!==void 0)return{type:Gt.Text,textContent:n}}function E_(){return{type:Gt.CDATA,textContent:""}}function C_(e,t,n){return vo(e,{serializationContext:n,parentNodePrivacyLevel:t.defaultPrivacyLevel,configuration:t})}function yd(e){return!!e.changedTouches}function gr(e){return e.composed===!0&&os(e.target)?e.composedPath()[0]:e.target}const bd=25;function x_(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>bd||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>bd}const T_=(e,t)=>{const n=window.visualViewport,r={layoutViewportX:e,layoutViewportY:t,visualViewportX:e,visualViewportY:t};if(n)x_(n)?(r.layoutViewportX=Math.round(e+n.offsetLeft),r.layoutViewportY=Math.round(t+n.offsetTop)):(r.visualViewportX=Math.round(e-n.offsetLeft),r.visualViewportY=Math.round(t-n.offsetTop));else return r;return r},wd=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function Ze(e,t){return{data:{source:e,...t},type:lt.IncrementalSnapshot,timestamp:de()}}const A_=50;function R_(e,t){const{throttled:n,cancel:r}=wt(i=>{const o=gr(i);if(ct(o)){const a=Sd(i);if(!a)return;const c={id:De(o),timeOffset:0,x:a.x,y:a.y};t(Ze(yd(i)?We.TouchMove:We.MouseMove,{positions:[c]}))}},A_,{trailing:!1}),{stop:s}=Ne(e,document,["mousemove","touchmove"],n,{capture:!0,passive:!0});return{stop:()=>{s(),r()}}}function Sd(e){let{clientX:t,clientY:n}=yd(e)?e.changedTouches[0]:e;if(window.visualViewport){const{visualViewportX:r,visualViewportY:s}=T_(t,n);t=r,n=s}if(!Number.isFinite(t)||!Number.isFinite(n)){e.isTrusted&&ft("mouse/touch event without x/y");return}return{x:t,y:n}}const _d={pointerup:Je.MouseUp,mousedown:Je.MouseDown,click:Je.Click,contextmenu:Je.ContextMenu,dblclick:Je.DblClick,focus:Je.Focus,blur:Je.Blur,touchstart:Je.TouchStart,touchend:Je.TouchEnd};function I_(e,t,n){const r=s=>{const i=gr(s);if(nt(i,e.defaultPrivacyLevel)===M.HIDDEN||!ct(i))return;const o=De(i),a=_d[s.type];let c;if(a!==Je.Blur&&a!==Je.Focus){const u=Sd(s);if(!u)return;c={id:o,type:a,x:u.x,y:u.y}}else c={id:o,type:a};const l={id:n.getIdForEvent(s),...Ze(We.MouseInteraction,c)};t(l)};return Ne(e,document,Object.keys(_d),r,{capture:!0,passive:!0})}const k_=100;function vd(e,t,n,r=document){const{throttled:s,cancel:i}=wt(a=>{const c=gr(a);if(!c||nt(c,e.defaultPrivacyLevel)===M.HIDDEN||!ct(c))return;const l=De(c),u=c===document?{scrollTop:Ii(),scrollLeft:jl()}:{scrollTop:Math.round(c.scrollTop),scrollLeft:Math.round(c.scrollLeft)};n.set(c,u),t(Ze(We.Scroll,{id:l,x:u.scrollLeft,y:u.scrollTop}))},k_),{stop:o}=Z(e,r,"scroll",s,{capture:!0,passive:!0});return{stop:()=>{o(),i()}}}const O_=200;function P_(e,t){const n=Wl(e).subscribe(r=>{t(Ze(We.ViewportResize,r))});return{stop:()=>{n.unsubscribe()}}}function L_(e,t){const n=window.visualViewport;if(!n)return{stop:z};const{throttled:r,cancel:s}=wt(()=>{t({data:wd(n),type:lt.VisualViewport,timestamp:de()})},O_,{trailing:!1}),{stop:i}=Ne(e,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),s()}}}function N_(e,t){return Ne(e,document,["play","pause"],n=>{const r=gr(n);!r||nt(r,e.defaultPrivacyLevel)===M.HIDDEN||!ct(r)||t(Ze(We.MediaInteraction,{id:De(r),type:n.type==="play"?pd.Play:pd.Pause}))},{capture:!0,passive:!0})}function M_(e){function t(s,i){s&&ct(s.ownerNode)&&i(De(s.ownerNode))}const n=[Le(CSSStyleSheet.prototype,"insertRule",({target:s,parameters:[i,o]})=>{t(s,a=>e(Ze(We.StyleSheetRule,{id:a,adds:[{rule:i,index:o}]})))}),Le(CSSStyleSheet.prototype,"deleteRule",({target:s,parameters:[i]})=>{t(s,o=>e(Ze(We.StyleSheetRule,{id:o,removes:[{index:i}]})))})];typeof CSSGroupingRule<"u"?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule));function r(s){n.push(Le(s.prototype,"insertRule",({target:i,parameters:[o,a]})=>{t(i.parentStyleSheet,c=>{const l=Ed(i);l&&(l.push(a||0),e(Ze(We.StyleSheetRule,{id:c,adds:[{rule:o,index:l}]})))})}),Le(s.prototype,"deleteRule",({target:i,parameters:[o]})=>{t(i.parentStyleSheet,a=>{const c=Ed(i);c&&(c.push(o),e(Ze(We.StyleSheetRule,{id:a,removes:[{index:c}]})))})}))}return{stop:()=>{n.forEach(s=>s.stop())}}}function Ed(e){const t=[];let n=e;for(;n.parentRule;){const o=Array.from(n.parentRule.cssRules).indexOf(n);t.unshift(o),n=n.parentRule}if(!n.parentStyleSheet)return;const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return t.unshift(s),t}function D_(e,t){return Ne(e,window,["focus","blur"],()=>{t({data:{has_focus:document.hasFocus()},type:lt.Focus,timestamp:de()})})}function F_(e,t,n){const r=e.subscribe(12,s=>{var i,o;s.rawRumEvent.type==="action"&&s.rawRumEvent.action.type==="click"&&(!((o=(i=s.rawRumEvent.action.frustration)===null||i===void 0?void 0:i.type)===null||o===void 0)&&o.length)&&"events"in s.domainContext&&s.domainContext.events&&s.domainContext.events.length&&t({timestamp:s.rawRumEvent.date,type:lt.FrustrationRecord,data:{frustrationTypes:s.rawRumEvent.action.frustration.type,recordIds:s.domainContext.events.map(a=>n.getIdForEvent(a))}})});return{stop:()=>{r.unsubscribe()}}}function B_(e,t){const n=e.subscribe(5,()=>{t({timestamp:de(),type:lt.ViewEnd})});return{stop:()=>{n.unsubscribe()}}}function Cd(e,t,n=document){const r=e.defaultPrivacyLevel,s=new WeakMap,i=n!==document,{stop:o}=Ne(e,n,i?["change"]:["input","change"],u=>{const d=gr(u);(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement)&&c(d)},{capture:!0,passive:!0});let a;if(i)a=z;else{const u=[er(HTMLInputElement.prototype,"value",c),er(HTMLInputElement.prototype,"checked",c),er(HTMLSelectElement.prototype,"value",c),er(HTMLTextAreaElement.prototype,"value",c),er(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{u.forEach(d=>d.stop())}}return{stop:()=>{a(),o()}};function c(u){const d=nt(u,r);if(d===M.HIDDEN)return;const f=u.type;let h;if(f==="radio"||f==="checkbox"){if(cs(u,d))return;h={isChecked:u.checked}}else{const g=So(u,d);if(g===void 0)return;h={text:g}}l(u,h);const p=u.name;f==="radio"&&p&&u.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(p)}"]`).forEach(g=>{g!==u&&l(g,{isChecked:!1})})}function l(u,d){if(!ct(u))return;const f=s.get(u);(!f||f.text!==d.text||f.isChecked!==d.isChecked)&&(s.set(u,d),t(Ze(We.Input,{id:De(u),...d})))}}const U_=100,$_=16;function V_(e){let t=z,n=[];function r(){t(),e(n),n=[]}const{throttled:s,cancel:i}=wt(r,$_,{leading:!1});return{addMutations:o=>{n.length===0&&(t=Oc(s,{timeout:U_})),n.push(...o)},flush:r,stop:()=>{t(),i()}}}function xd(e,t,n,r){const s=Wc();if(!s)return{stop:z,flush:z};const i=V_(a=>{z_(a.concat(o.takeRecords()),e,t,n)}),o=new s(U(i.addMutations));return o.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{o.disconnect(),i.stop()},flush:()=>{i.flush()}}}function z_(e,t,n,r){const s=new Map;e.filter(d=>d.type==="childList").forEach(d=>{d.removedNodes.forEach(f=>{Td(f,r.removeShadowRoot)})});const i=e.filter(d=>d.target.isConnected&&n_(d.target)&&nt(d.target,n.defaultPrivacyLevel,s)!==M.HIDDEN),{adds:o,removes:a,hasBeenSerialized:c}=H_(i.filter(d=>d.type==="childList"),n,r,s),l=j_(i.filter(d=>d.type==="characterData"&&!c(d.target)),n,s),u=W_(i.filter(d=>d.type==="attributes"&&!c(d.target)),n,s);!l.length&&!u.length&&!a.length&&!o.length||t(Ze(We.Mutation,{adds:o,removes:a,texts:l,attributes:u}))}function H_(e,t,n,r){const s=new Set,i=new Map;for(const f of e)f.addedNodes.forEach(h=>{s.add(h)}),f.removedNodes.forEach(h=>{s.has(h)||i.set(h,f.target),s.delete(h)});const o=Array.from(s);q_(o);const a=new Set,c=[];for(const f of o){if(u(f))continue;const h=nt(f.parentNode,t.defaultPrivacyLevel,r);if(h===M.HIDDEN||h===M.IGNORE)continue;const p=vo(f,{serializedNodeIds:a,parentNodePrivacyLevel:h,serializationContext:{status:2,shadowRootsController:n},configuration:t});if(!p)continue;const g=as(f);c.push({nextId:d(f),parentId:De(g),node:p})}const l=[];return i.forEach((f,h)=>{ct(h)&&l.push({parentId:De(f),id:De(h)})}),{adds:c,removes:l,hasBeenSerialized:u};function u(f){return ct(f)&&a.has(De(f))}function d(f){let h=f.nextSibling;for(;h;){if(ct(h))return De(h);h=h.nextSibling}return null}}function j_(e,t,n){var r;const s=[],i=new Set,o=e.filter(a=>i.has(a.target)?!1:(i.add(a.target),!0));for(const a of o){if(a.target.textContent===a.oldValue)continue;const l=nt(as(a.target),t.defaultPrivacyLevel,n);l===M.HIDDEN||l===M.IGNORE||s.push({id:De(a.target),value:(r=pl(a.target,!1,l))!==null&&r!==void 0?r:null})}return s}function W_(e,t,n){const r=[],s=new Map,i=e.filter(a=>{const c=s.get(a.target);return c&&c.has(a.attributeName)?!1:(c?c.add(a.attributeName):s.set(a.target,new Set([a.attributeName])),!0)}),o=new Map;for(const a of i){if(a.target.getAttribute(a.attributeName)===a.oldValue)continue;const l=nt(a.target,t.defaultPrivacyLevel,n),u=gd(a.target,l,a.attributeName,t);let d;if(a.attributeName==="value"){const h=So(a.target,l);if(h===void 0)continue;d=h}else typeof u=="string"?d=u:d=null;let f=o.get(a.target);f||(f={id:De(a.target),attributes:{}},r.push(f),o.set(a.target,f)),f.attributes[a.attributeName]=d}return r}function q_(e){e.sort((t,n)=>{const r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_CONTAINS||r&Node.DOCUMENT_POSITION_FOLLOWING?1:r&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function Td(e,t){os(e)&&t(e.shadowRoot),cl(e,n=>Td(n,t))}function K_(){const e=new WeakMap;return{set(t,n){t===document&&!document.scrollingElement||e.set(t===document?document.scrollingElement:t,n)},get(t){return e.get(t)},has(t){return e.has(t)}}}const G_=(e,t,n)=>{const r=new Map,s={addShadowRoot:i=>{if(r.has(i))return;const o=xd(t,e,s,i),a=Cd(e,t,i),c=vd(e,t,n,i);r.set(i,{flush:()=>o.flush(),stop:()=>{o.stop(),a.stop(),c.stop()}})},removeShadowRoot:i=>{const o=r.get(i);o&&(o.stop(),r.delete(i))},stop:()=>{r.forEach(({stop:i})=>i())},flush:()=>{r.forEach(({flush:i})=>i())}};return s};function Y_(e,t,n,r,s,i){const o=(c=de(),l={status:0,elementsScrollPositions:e,shadowRootsController:t})=>{const{width:u,height:d}=ps(),f=[{data:{height:d,href:window.location.href,width:u},type:lt.Meta,timestamp:c},{data:{has_focus:document.hasFocus()},type:lt.Focus,timestamp:c},{data:{node:C_(document,r,l),initialOffset:{left:jl(),top:Ii()}},type:lt.FullSnapshot,timestamp:c}];return window.visualViewport&&f.push({data:wd(window.visualViewport),type:lt.VisualViewport,timestamp:c}),f};i(o());const{unsubscribe:a}=n.subscribe(2,c=>{s(),i(o(c.startClocks.timeStamp,{shadowRootsController:t,status:1,elementsScrollPositions:e}))});return{stop:a}}function J_(){const e=new WeakMap;let t=1;return{getIdForEvent(n){return e.has(n)||e.set(n,t++),e.get(n)}}}function Z_(e){const{emit:t,configuration:n,lifeCycle:r}=e;if(!t)throw new Error("emit function is required");const s=f=>{t(f),ai("record",{record:f});const h=e.viewHistory.findView();_b(h.id)},i=K_(),o=G_(n,s,i),{stop:a}=Y_(i,o,r,n,c,f=>f.forEach(h=>s(h)));function c(){o.flush(),u.flush()}const l=J_(),u=xd(s,n,o,document),d=[u,R_(n,s),I_(n,s,l),vd(n,s,i,document),P_(n,s),Cd(n,s),N_(n,s),M_(s),D_(n,s),L_(n,s),F_(r,s,l),B_(r,f=>{c(),s(f)})];return{stop:()=>{o.stop(),d.forEach(f=>f.stop()),a()},flushMutations:c,shadowRootsController:o}}function X_(e,t,n){const r=new FormData;r.append("segment",new Blob([e],{type:"application/octet-stream"}),`${t.session.id}-${t.start}`);const s={raw_segment_size:n,compressed_segment_size:e.byteLength,...t},i=JSON.stringify(s);return r.append("event",new Blob([i],{type:"application/json"})),{data:r,bytesCount:e.byteLength}}function Q_({context:e,creationReason:t,encoder:n}){let r=0;const s=e.view.id,i={start:1/0,end:-1/0,creation_reason:t,records_count:0,has_full_snapshot:!1,index_in_view:wb(s),source:"browser",...e};Sb(s);function o(c,l){i.start=Math.min(i.start,c.timestamp),i.end=Math.max(i.end,c.timestamp),i.records_count+=1,i.has_full_snapshot||(i.has_full_snapshot=c.type===lt.FullSnapshot);const u=n.isEmpty?'{"records":[':",";n.write(u+JSON.stringify(c),d=>{r+=d,l(r)})}function a(c){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(i).slice(1)}
|
|
726
726
|
`),n.finish(l=>{vb(i.view.id,l.rawBytesCount),c(i,l)})}return{addRecord:o,flush:a}}const ev=5*Se;let Ad=6e4;function tv(e,t,n,r,s,i){return nv(e,()=>rv(t.applicationId,n,r),s,i)}function nv(e,t,n,r){let s={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:i}=e.subscribe(2,()=>{a("view_change")}),{unsubscribe:o}=e.subscribe(11,c=>{a(c.reason)});function a(c){s.status===1&&(s.segment.flush((l,u)=>{const d=X_(u.output,l,u.rawBytesCount);Rc(c)?n.sendOnExit(d):n.send(d)}),Pe(s.expirationTimeoutId)),c!=="stop"?s={status:0,nextSegmentCreationReason:c}:s={status:2}}return{addRecord:c=>{if(s.status!==2){if(s.status===0){const l=t();if(!l)return;s={status:1,segment:Q_({encoder:r,context:l,creationReason:s.nextSegmentCreationReason}),expirationTimeoutId:fe(()=>{a("segment_duration_limit")},ev)}}s.segment.addRecord(c,l=>{l>Ad&&a("segment_bytes_limit")})}},stop:()=>{a("stop"),i(),o()}}}function rv(e,t,n){const r=t.findTrackedSession(),s=n.findView();if(!(!r||!s))return{application:{id:e},session:{id:r.id},view:{id:s.id}}}function sv(e){const t=gn();return{addRecord:n=>{const r=e.findView();t.send("record",n,r.id)}}}function iv(e,t,n,r,s,i){const o=[],a=d=>{e.notify(14,{error:d}),ft("Error reported to customer",{"error.message":d.message})},c=i||xc(t.sessionReplayEndpointBuilder,Ad,a);let l;if(zt())({addRecord:l}=sv(r));else{const d=tv(e,t,n,r,c,s);l=d.addRecord,o.push(d.stop)}const{stop:u}=Z_({emit:l,configuration:t,lifeCycle:e,viewHistory:r});return o.push(u),{stop:()=>{o.forEach(d=>d())}}}const ov=Object.freeze(Object.defineProperty({__proto__:null,startRecording:iv},Symbol.toStringTag,{value:"Module"}));function av(e){let t=0;for(const n of e)n.stackId!==void 0&&t++;return t}const mr=new Map;let kn=!1;function cv(){kn=performance.now()}function lv(){kn=!1,mr.clear()}function uv(e,t){mr.set(t,e)}function Rd(e){if(!(kn===!1||e.startTime<kn))return mr.get(e.startTime)}function dv(e){if(!(kn===!1||e<kn))for(const t of mr.keys())t<e&&mr.delete(t)}function fv({rawRumEvent:e,startTime:t}){if(e.type!=="long_task")return;const n=e.long_task.id;uv(n,t)}const pv=(e,t,n,r)=>{const s=hv(e,t,n,r),i=mv(e,s),o=t.build("fetch",i);return ft("Sending profile to public profiling intake",{profilingIntakeURL:o,applicationId:n,sessionId:r}),fetch(o,{body:i.data,method:"POST"})};function hv(e,t,n,r){const s=t.tags,i=yv(e,n,r),o=gv(s),a=new Date(e.timeOrigin+e.startTime),c=new Date(e.timeOrigin+e.endTime);return{...i,attachments:["wall-time.json"],start:a.toISOString(),end:c.toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:o.join(",")}}function gv(e){return e.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"])}function mv(e,t){const n=new Blob([JSON.stringify(e)],{type:"application/json"}),r=new FormData;return r.append("event",new Blob([JSON.stringify(t)],{type:"application/json"}),"event.json"),r.append("wall-time.json",n,"wall-time.json"),{data:r,bytesCount:0}}function yv(e,t,n){const r={application:{id:t}};n&&(r.session={id:n});const s=Array.from(new Set(e.views.map(o=>o.viewId)));s.length&&(r.view={id:s});const i=e.longTasks.map(o=>Rd(o)).filter(o=>o!==void 0);return i.length&&(r.long_task={id:i}),r}const bv={sendProfile:pv},Id={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3,minNumberOfSamples:50};function wv(e,t,n,r=Id){const s=jt(H.LONG_ANIMATION_FRAME);let i;const o=[];let a={state:"stopped"};function c(C){a.state!=="running"&&(i=C?{startTime:C.startClocks.relative,viewId:C.id,viewName:C.name}:void 0,o.push(Z(e,window,"visibilitychange",b).stop,Z(e,window,"beforeunload",_).stop),d())}async function l(){await h("stopped"),lv(),o.forEach(C=>C())}function u(C){if(C.state==="running")return{cleanupTasks:C.cleanupTasks,observer:C.observer};const I=[];let A;if(e.trackLongTasks){A=new PerformanceObserver(w),A.observe({entryTypes:[k()]});const P=t.subscribe(12,N=>{fv(N)});cv(),I.push(()=>A==null?void 0:A.disconnect()),I.push(P.unsubscribe)}const O=t.subscribe(2,P=>{p({viewId:P.id,viewName:P.name,startTime:P.startClocks.relative})});return I.push(O.unsubscribe),{cleanupTasks:I,observer:A}}function d(){const C=et().Profiler;if(!C)throw new Error("RUM Profiler is not supported in this browser.");f(a).catch(dt);const{cleanupTasks:I,observer:A}=u(a);let O;try{O=new C({sampleInterval:r.sampleIntervalMs,maxBufferSize:Math.round(r.collectIntervalMs*1.5/r.sampleIntervalMs)})}catch(P){V.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",P);return}a={state:"running",startTime:performance.now(),profiler:O,timeoutId:fe(d,r.collectIntervalMs),longTasks:[],views:[],cleanupTasks:I,observer:A},p(i),O.addEventListener("samplebufferfull",m)}async function f(C){var I,A;if(C.state!=="running")return;v((A=(I=C.observer)===null||I===void 0?void 0:I.takeRecords())!==null&&A!==void 0?A:[]),Pe(C.timeoutId),C.profiler.removeEventListener("samplebufferfull",m);const{startTime:O,longTasks:P,views:N}=C,Q=performance.now();await C.profiler.stop().then(ge=>{const $e=performance.now(),qe=P.length>0,X=$e-O<r.minProfileDurationMs,ne=av(ge.samples)<r.minNumberOfSamples;!qe&&(X||ne)||(g(Object.assign(ge,{startTime:O,endTime:$e,timeOrigin:performance.timeOrigin,longTasks:P,views:N,sampleInterval:r.sampleIntervalMs})),dv(Q))}).catch(dt)}async function h(C){a.state==="running"&&(a.cleanupTasks.forEach(I=>I()),await f(a),a={state:C})}function p(C){a.state!=="running"||!C||a.views.push(C)}function g(C){var I;const A=(I=n.findTrackedSession())===null||I===void 0?void 0:I.id;bv.sendProfile(C,e.profilingEndpointBuilder,e.applicationId,A).catch(dt)}function m(){d()}function w(C){v(C.getEntries())}function v(C){if(a.state==="running")for(const I of C)I.duration<r.sampleIntervalMs||a.longTasks.push({id:Rd(I),duration:I.duration,entryType:I.entryType,startTime:I.startTime})}function b(){document.visibilityState==="hidden"&&a.state==="running"?h("paused").catch(dt):document.visibilityState==="visible"&&a.state==="paused"&&d()}function _(){d()}function k(){return s?"long-animation-frame":"longtask"}function x(){return a.state==="stopped"}function y(){return a.state==="running"}function R(){return a.state==="paused"}return{start:c,stop:l,isStopped:x,isRunning:y,isPaused:R}}const Sv=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_RUM_PROFILER_CONFIGURATION:Id,createRumProfiler:wv},Symbol.toStringTag,{value:"Module"}));Ee.AstroPayCore=rt,Ee.AstroPayFullCheckout=QS,Ee.AstroPayPayment=t_,Ee.Core=rt,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -4904,9 +4904,9 @@ x(G, "GET", async ({
|
|
|
4904
4904
|
var r, s, i, o, a, c, l, u;
|
|
4905
4905
|
const n = {
|
|
4906
4906
|
error: ((s = (r = t.response) == null ? void 0 : r.data) == null ? void 0 : s.error) || "UNKNOWN_ERROR",
|
|
4907
|
-
internalTerm: (
|
|
4907
|
+
internalTerm: (o = (i = t.response) == null ? void 0 : i.data) == null ? void 0 : o.internalTerm,
|
|
4908
4908
|
message: ((c = (a = t.response) == null ? void 0 : a.data) == null ? void 0 : c.message) || ee.translate("generic_error"),
|
|
4909
|
-
description: (
|
|
4909
|
+
description: (u = (l = t.response) == null ? void 0 : l.data) == null ? void 0 : u.description
|
|
4910
4910
|
};
|
|
4911
4911
|
return Promise.reject(n);
|
|
4912
4912
|
}), x(G, "getEncodeParams", () => {
|
|
@@ -4915,7 +4915,7 @@ x(G, "GET", async ({
|
|
|
4915
4915
|
app_id: ut.getToken(),
|
|
4916
4916
|
environment: Pn.getEnvironment(),
|
|
4917
4917
|
platform: Ya(),
|
|
4918
|
-
version: "0.1.
|
|
4918
|
+
version: "0.1.3"
|
|
4919
4919
|
};
|
|
4920
4920
|
return Ja(t);
|
|
4921
4921
|
});
|
|
@@ -11282,7 +11282,7 @@ async function ab(e = cb) {
|
|
|
11282
11282
|
async function cb() {
|
|
11283
11283
|
return (await import(
|
|
11284
11284
|
/* webpackChunkName: "recorder" */
|
|
11285
|
-
"./startRecording-
|
|
11285
|
+
"./startRecording-BDrOJilH.js"
|
|
11286
11286
|
)).startRecording;
|
|
11287
11287
|
}
|
|
11288
11288
|
function lb() {
|
|
@@ -11302,7 +11302,7 @@ async function ub(e = db) {
|
|
|
11302
11302
|
async function db() {
|
|
11303
11303
|
return (await import(
|
|
11304
11304
|
/* webpackChunkName: "profiler" */
|
|
11305
|
-
"./profiler-
|
|
11305
|
+
"./profiler-DiQDgm1N.js"
|
|
11306
11306
|
)).createRumProfiler;
|
|
11307
11307
|
}
|
|
11308
11308
|
function fb() {
|
|
@@ -11340,7 +11340,7 @@ const Kt = class Kt {
|
|
|
11340
11340
|
site: "datadoghq.com",
|
|
11341
11341
|
service: "astropay-payments-library",
|
|
11342
11342
|
env: "production",
|
|
11343
|
-
version: "0.1.
|
|
11343
|
+
version: "0.1.3",
|
|
11344
11344
|
sessionSampleRate: 50,
|
|
11345
11345
|
sessionReplaySampleRate: 10,
|
|
11346
11346
|
defaultPrivacyLevel: "mask-user-input",
|
|
@@ -16180,7 +16180,7 @@ class eS extends ae {
|
|
|
16180
16180
|
showSuccessContent(n) {
|
|
16181
16181
|
this.element.innerHTML = "";
|
|
16182
16182
|
const r = document.createElement("div");
|
|
16183
|
-
if (r.classList.add("payment-success-content"), n.forEach((s) => r.append(s)), this.element.append(r), this.componentProps.onSuccess) {
|
|
16183
|
+
if (r.classList.add("payment-success-content"), n.forEach((s) => r.append(s)), this.element.append(r), De.trackEvent("ap_cl_payment_success"), this.componentProps.onSuccess) {
|
|
16184
16184
|
const s = document.createElement("div");
|
|
16185
16185
|
s.classList.add("loading-success-callback");
|
|
16186
16186
|
const i = new pt({
|
|
@@ -16190,7 +16190,7 @@ class eS extends ae {
|
|
|
16190
16190
|
text: ee.translate("almost_done"),
|
|
16191
16191
|
size: 12
|
|
16192
16192
|
}).element;
|
|
16193
|
-
s.append(i, o), this.element.append(s),
|
|
16193
|
+
s.append(i, o), this.element.append(s), setTimeout(() => {
|
|
16194
16194
|
this.componentProps.onSuccess();
|
|
16195
16195
|
}, 5e3);
|
|
16196
16196
|
}
|
|
@@ -16317,7 +16317,7 @@ class tS extends ae {
|
|
|
16317
16317
|
showSuccessContent(n) {
|
|
16318
16318
|
this.element.innerHTML = "";
|
|
16319
16319
|
const r = document.createElement("div");
|
|
16320
|
-
if (r.classList.add("payment-success-content"), n.forEach((s) => r.append(s)), this.element.append(r), this.componentProps.onSuccess) {
|
|
16320
|
+
if (r.classList.add("payment-success-content"), n.forEach((s) => r.append(s)), this.element.append(r), De.trackEvent("ap_cl_payment_success"), this.componentProps.onSuccess) {
|
|
16321
16321
|
const s = document.createElement("div");
|
|
16322
16322
|
s.classList.add("loading-success-callback");
|
|
16323
16323
|
const i = new pt({
|
|
@@ -16327,7 +16327,7 @@ class tS extends ae {
|
|
|
16327
16327
|
text: ee.translate("almost_done"),
|
|
16328
16328
|
size: 12
|
|
16329
16329
|
}).element;
|
|
16330
|
-
s.append(i, o), this.element.append(s),
|
|
16330
|
+
s.append(i, o), this.element.append(s), setTimeout(() => {
|
|
16331
16331
|
this.componentProps.onSuccess();
|
|
16332
16332
|
}, 5e3);
|
|
16333
16333
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as A, C, b as ft, i as Y, g as V, N as h, P as X, S as pt, a as B, c as ht, d as mt, e as St, f as q, r as gt, h as Et, j as yt, k as Tt, l as j, m as J, t as _, n as x, o as M, p as K, q as N, u as Q, v as Z, w as Nt, x as vt, y as b, z as D, A as R, B as wt, D as Mt, E as It, F as Rt, G as Ct, H as bt, I as _t, J as Lt, K as Dt, L as xt, M as Ot, O as At, Q as Vt, R as Pt, T as kt, U as zt } from "./main-
|
|
1
|
+
import { s as A, C, b as ft, i as Y, g as V, N as h, P as X, S as pt, a as B, c as ht, d as mt, e as St, f as q, r as gt, h as Et, j as yt, k as Tt, l as j, m as J, t as _, n as x, o as M, p as K, q as N, u as Q, v as Z, w as Nt, x as vt, y as b, z as D, A as R, B as wt, D as Mt, E as It, F as Rt, G as Ct, H as bt, I as _t, J as Lt, K as Dt, L as xt, M as Ot, O as At, Q as Vt, R as Pt, T as kt, U as zt } from "./main-BcVhtQav.js";
|
|
2
2
|
const P = /* @__PURE__ */ new WeakMap();
|
|
3
3
|
function T(t) {
|
|
4
4
|
return P.has(t);
|
package/package.json
CHANGED